The fundamental beam equation is
$$\dfrac{\text{d}^2}{\text{d}x^2}\left(EI\dfrac{\text{d}^2w}{\text{d}x^2}\right) = q$$
Which basically translates to "the fourth derivative of the deflection function is equal to the applied load". In fact
- the first derivative is the tangent of the deflection, which for small angles is approximately equal to the angle of deflection
- the second derivative is the bending moment
- the third derivative is the shear force
- the fourth derivative (to repeat myself), is the applied load.
All deflection results are obtained using this equation.
To simplify this answer, I'm going to start off from the second derivative, the bending moment, since it (and the ones after it) is trivial to find by inspection.
For the simply-supported beam with a concentrated load at midspan, we have:
$$\begin{align}
M &= \begin{cases}
\dfrac{Fx}{2} &\text{ for } x \in [0,\dfrac{L}{2}] \\
\dfrac{F(L-x)}{2} &\text{ for } x \in [\dfrac{L}{2}, L] \\
\end{cases} \\
EI\theta = \int M\text{d}x &= \begin{cases}
\dfrac{Fx^2}{4} + C_1 &\text{ for } x \in [0,\dfrac{L}{2}] \\
\dfrac{FLx}{2} - \dfrac{Fx^2}{4} + C_2 &\text{ for } x \in [\dfrac{L}{2}, L] \\
\end{cases} \\
EI\delta = EI\int \theta\text{d}x &= \begin{cases}
\dfrac{Fx^3}{12} + C_1x + C_3 &\text{ for } x \in [0,\dfrac{L}{2}] \\
\dfrac{FLx^2}{4} - \dfrac{Fx^3}{12} + C_2x + C_4 &\text{ for } x \in [\dfrac{L}{2}, L] \\
\end{cases}
\end{align}$$
We know that $\delta(0) = \delta(L) = 0$ and that $\theta\left(\dfrac{L}{2}^+\right) = \theta\left(\dfrac{L}{2}^-\right)$ and $\delta\left(\dfrac{L}{2}^+\right) = \delta\left(\dfrac{L}{2}^-\right)$ (that is, the deflection and angle is continuous at $\dfrac{L}{2}$).
So you solve it:
$$\begin{gather}
\delta(0) = C_3 = 0 \\
\delta(L) = \dfrac{FL^3}{4} - \dfrac{FL^3}{12} + C_2L + C_4 = 0 \\
\therefore C_4 = -\dfrac{FL^3}{6} - C_2L \\
\theta\left(\dfrac{L}{2}^+\right) = \theta\left(\dfrac{L}{2}^-\right) \\
\therefore \dfrac{FL^2}{16} + C_1 = \dfrac{FL^2}{4} - \dfrac{FL^2}{16} + C_2 \\
\therefore C_1 = \dfrac{FL^2}{8} + C_2 \\
\delta\left(\dfrac{L}{2}^+\right) = \delta\left(\dfrac{L}{2}^-\right) \\
\therefore \dfrac{FL^3}{96} + \dfrac{FL^3}{16} + \dfrac{C_2L}{2} = \dfrac{FL^3}{16} - \dfrac{FL^3}{96} + \dfrac{C_2L}{2} - \dfrac{FL^3}{6} - C_2L \\
\therefore C_2 = -\dfrac{9FL^2}{48} \\
\therefore C_1 = -\dfrac{3FL^2}{48} \\
\therefore C_4 = \dfrac{FL^3}{48}
\end{gather}$$
Now, by inspection we can easily see the deflection is at the midspan, so let's calculate it (doesn't matter which $\delta$ equation you choose).
$$\delta\left(\dfrac{L}{2}\right) = \dfrac{1}{EI}\left(\dfrac{FL^3}{96} - \dfrac{3FL^3}{96}\right) = -\dfrac{FL^3}{48EI}$$
The same process can be repeated for a cantilevered beam, only it's much simpler:
$$\begin{align}
M &= FL - Fx \\
EI\theta = \int M\text{d}x &= FLx - \dfrac{Fx^2}{2} + C_1 \\
EI\delta = EI\int \theta\text{d}x &= \dfrac{FLx^2}{2} - \dfrac{Fx^3}{6} + C_1x + C_2 \\
\theta(0) &= C_1 = 0 \\
\delta(0) &= C_2 = 0 \\
\therefore EI\delta &= \dfrac{FLx^2}{2} - \dfrac{Fx^3}{6} \\
\therefore \delta(L) &= \dfrac{FL^3}{3EI}
\end{align}$$