Strain energy stored in the rod Question:
A uniform rod of length l, young's modulus Y and cross section A, placed on a smooth horizontal table, is pulled by a force F applied parallel to the rod at one end. The other end of the rod is free. Find the strain energy stored in the rod.
My attempt:
If the table was rough(i.e.,had friction), the static friction force would have adjusted itself to match the external force F and hence two equal and opposite forces would have caused stress to occur in the rod. But here the table is smooth, so I don't know what other force will oppose the external force and how stress will be produced.
I'm not sure of this but if I assume that atomic force of attraction would oppose the external force and the rod is reduced to the center of mass(at a distance of $\frac{l}{2}$), the following strain energy would be stored in the rod:-
$$U=\frac{1}{2Y}(stress)^2A\frac{l}{2}$$
$$U=\frac{1}{2Y}(\frac{F}{A})^2A\frac{l}{2}$$
$$U=\frac{F^2l}{4YA}$$
The answser is given as $U=\frac{F^2l}{6YA}$
 A: There is no other force. The rod is being accelerated. The tension $T=F(x/L)$ in the rod will vary linearly from $F$ at the pulled end where $x=L$ to $0$ at the free end where $x=0$. 
This situation is like a train of trucks being pulled by an engine. The forces on each truck are different, although if the mass of each is the same then the net force on each is also the same. However, the elastic energy stored in each truck (or in the coupling springs between trucks) depends on the balanced force at the two ends (ie the tension force in the spring) rather than the net force accelerating the truck/spring.
A: Stress is produced due to the internal forces only, which is tension in this case. Now, the body is accelerating with an acceleration $a=F/m$. Tension from the left end is $T=F(x/L)$(Assuming force is acting on the right end).
Now, taking a differential element "dx" and extension on it as "dl", we find that:
$$Y\frac{dl}{dx} = \frac{F(x/L)}{A}\tag{1}$$
Now, using the energy density formula, we get:
$$dU = \frac{YAdx}{2}(\frac{dl}{dx})^2\tag{2}$$
Substituting (1) in (2) and integrating will give you the desired result.
A: I can’t stand that this still hasn’t been solved in five years. Lol

The rod is being accelerated. The tension $T=\frac{z}{L}F$.
Set mass per unit length $q:= m/L$ , $a = F/ m$
A small section $dz$:
$$F’ = ma = qadz = \frac{m}{L}~ \frac{F}{m} ~ dz~ = ~\frac{F}{L} ~ dz$$
Check (accelerating force from differential tension):
$$F’ = T_R-T_L = dT = \frac{dz}{L} F$$
Strain energy in $dz$: $U_{dz}= \frac{T^2dz}{2YA}$
$$U=\int_{0}^L  \frac{T^2dz}{2YA}= \frac{F^2}{2L^2YA} \int_{0}^L  z^2dz$$
$$= \frac{F^2}{2L^2YA} \frac{L^3}{3} = \frac{F^2L}{6YA}$$
Which is the Answer Given
A: The question seems not to be detailed enough. 
According to your equations, all you have to find is the force "F".
I would say that there could be 3 things that determines the force:
1- The friction coefficient of the surface.
2- Drag of air due to cross section area of the rod.
3- The acceleration of the rod (F=ma)
But the word "smooth" suggests a simple situation to me. Besides, it will complicate things terribly to add frictional heat, heat transfer ratio, aerodynamics etc.
So I suggest just go for the F=ma by assuming that you accelerate the rod in "t" time to "v" speed. 
