Where does the formula for bending of a rod come from? For a rod of length $l$, breadth $b$, depth $d$, and Young's modulus $Y$, 
the rod's center of mass comes down by a distance $\delta$ when a weight $W$ is hanged from its center
$$\delta = \frac{Wl^3}{4bYd^3}.$$
How do I derive this formula? In what way should I take the element for integration, assuming it is derived using integration? (Please ignore the labelings in the diagram)

 A: A thin slender beam (rod) with length $\ell$, 2nd area moment $I = \frac{1}{12} b d^3$ and Young's modulus $E$ obeys the following differential equation
$$ M(x) = E I \frac{\partial ^2 y(x)}{\partial x^2}  $$ where $y(x)$ is the deflection shape and $M(x)$ the internal moment function.
Using statics split the beam into two sections and do a free body diagram on each one 

For the first section from A to C the internal moment is $$M_1(x) = -x\,A_y = - x \,\frac{F}{2} $$
For the second section from C to B the internal moment is $$M_2(x) = -x \, A_y+ F (x-\frac{\ell}{2}) = - (\ell -x) \frac{F}{2}$$
Now you can integrate the moment to get slope and deflection and make sure you use the constants of integration for fitting into the boundary conditions (at $y_1(0)=0$ and $y_2(\ell)=0$) and continuity ($y_1(\frac{\ell}{2})=y_2(\frac{\ell}{2})$ and $y_1'(\frac{\ell}{2}) = y_2'(\frac{\ell}{2})$)
The deflection shape is $$ 
y_1(x) = \frac{1}{E I} \int \int M_1(x)\,{\rm d}x{\rm d}x + K_1 + K_2 x = -\frac{F x (4 x^2-3 \ell^2)}{48 E I} \\ 
y_2(x) = \frac{1}{E I} \int \int M_2(x)\,{\rm d}x{\rm d}x + K_3 + K_4 x  =
-\frac{F ( \ell^3 -9 \ell^2 x+12 \ell x^2 -4 x^3)}{4 8 EI }$$
In the middle use $x=\frac{\ell}{2}$ for $$ \boxed{\delta = -\frac{F \ell^3}{48 E I} } $$
Here the result is negative because the deflection is along the negative y direction

There is also a shorter method using what is called an energy method. After finding the internal moments, find total internal energy of the system as a function of the applied load
$$U(F) = \int \limits_{0}^{\ell/2} \frac{M_1^2(x)}{2 E I}\,{\rm d}x + \int \limits_{\ell/2}^{\ell} \frac{M_2^2(x)}{2 E I}\,{\rm d}x  = \frac{F^2 \ell^3}{96 E I}$$
The deflection at the point $F$ is applied (the middle) use the following partial derivative
$$\boxed{ \delta = \frac{\partial U(F)}{\partial F} = \frac{F \ell^3}{48 E I} } $$
Here the result is positive because the deflection is along the direction of the force
