Potential energy of an infinitesimal length of elastic rod I am having an embarrassingly hard time with the derivation for the potential energy of an infinitesimal element of an elastic rod of area $A$. The picture shown below is an element of the rod that has been extended by $du$ by the force $F$. 
 
I've tried this derivation several times and have yet to obtain the factor of $\frac{1}{2}$ in 

$$dU=\frac{1}{2}AY\big(\frac{du}{dx}\big)^2dx,\tag{1} $$ 

which is given in my lecture notes. Here is my best attempt so far:
From the stress strain relation, $\sigma=Y\epsilon$, where $Y$ is Youngs modulus we obtain:
$$\frac{F}{A}=Y\frac{du}{dx}.\tag{2} $$
I asked a similar question a few days ago, and based on that response I've assumed that the work done in extending the rod element from length $dx$ to $du+dx$ is 
$$dW=F\big[ (du+dx)-dx\big]\tag{3}  $$
$$=YA\frac{du}{dx}du.\tag{4} $$
And I can make it look more like the answer given in my lecture notes if I divide and multiply by $dx$:
$$dW=YA\big(\frac{du}{dx}\big)^2dx.\tag{5}$$
And I am assuming that $dW=dU$ here ($F=-\frac{dU}{du} $ but forget about the negative sign)
I have tried other approaches but they make even less sense to me. A formula that I think will come in handy is the deflection at section x of a rod: 
$$\delta(x)=\frac{F}{AY}x ,\tag{6}$$ 
and I think an integral will come in to play but I'm not sure what I'm integrating over any more (I'm dealing with an infinitesimal element of the rod). So how do I use the infinitesimal Work to find the infinitesimal change in potential energy here to get that factor of $\frac{1}{2}$ (assuming that it does in fact belong in $dU$)? 
 A: OP is pondering why the factor $\color{Red}{\frac{1}{2}}$ should be in eq. (1). OP seems aware of that it is related to the factor $\color{Red}{\frac{1}{2}}$ in the elastic potential energy $$\Delta U ~=~\color{Red}{\frac{1}{2}}k(\Delta u)^2 \tag{A} $$ of a spring, but precisely how? 
Answer: 


*

*The $\Delta$ on the left-hand side of eq. (A) has to be properly understood. Imagine that we before the experiment have drawn an $x$-axis on the unstretched string. (Therefore when the string is stretched, the $x$-labels get deformed. In fluid dynamics we would say that we have adapted the Lagrangian (as opposed to the Eulerian) picture.) Let $\Delta x$ refer to a certain interval of the string. Then $\Delta U$ in eq. (A) is the total potential energy in that part of the string, hence the half. 

*To avoid paradoxes with dividing infinitesimal quantities, we assume that $\Delta x$ is small, but not infinitesimal small. (For this reason, we do not use the notations $\delta x$ or $dx$.)

*We next need to relate the microscopic spring constant $k$ to the macroscopic Young modulus $Y$. By comparison of the formula
$$\frac{|F|}{A}~=~Y\frac{|\Delta u|}{\Delta x},\tag{2}$$
and Hooke's law
$$ |F| ~=~  k|\Delta u|,\tag{B}$$
we see that we should identify
$$k~\stackrel{(2)+(B)}{=}~ \frac{YA}{\Delta x} .\tag{C} $$


*Finally, combine eqs. (A) & (C) to achieve OP's sought-for formula



$$\text{Elastic potential energy density}~=~  \frac{1}{A}\frac{\Delta U}{\Delta x}
~\stackrel{(A)+(C)}{=}~\color{Red}{\frac{1}{2}} Y \left(\frac{\Delta u}{\Delta x} \right)^2.\tag{1}$$ 

For further details, see Wikipedia and Refs. 1-2.
References:


*

*H. Goldstein, Classical Mechanics; 2nd ed;  Section 12.1.

*H. Goldstein, Classical Mechanics; 3rd ed;  Section 13.1.
A: I got some help, I will post it for the few people that ever run into this (please correct me if I abused the notation):
$$dW=-dU=-\int_0^{du}Fd(du)=-\int_0^{du}AY\frac{du}{dx}d(du)$$
$$ dU= \int_0^yAY\frac{y}{dx}dy$$
$$=\frac{1}{2}AY\frac{y^2}{dx}$$
$$=\frac{1}{2}AY\frac{du^2}{dx}$$
$$=\frac{1}{2}AY(\frac{du}{dx})^2dx$$
A: The force is proportional to the extension:
$$ F = kx $$
where we subsume all the various constants like Young's modulus and area into the constant $k$. We know $dW = Fdx$, so:
$$ dW = k x dx $$
and integrating this gives:
$$ W = \tfrac{1}{2}kx^2 + C $$
If we define the work to be zero when the extension is zero the constant $C$ is zero, and we get the relation between work and extension complete with the factor of $1/2$.
