Strain-Energy and Deflection function I am trying to understand how to derive the mechanical strain energy in an Euler-Bernoulli beam fixed between two torsional springs as shown in this paper: http://iopscience.iop.org/article/10.1088/0960-1317/17/9/016/meta
 A: *

*An axial residual stress is going to tend to change the length of the beam. For a beam oriented along the $x$ axis with deflection $w(x)$, we can write the length at any one point in differential form as $$ds=\left\{\left(dx\right)^2+\left[dw(x)\right]^2\right\}^{1/2}=dx\left[1+\left(\frac{dw(x)}{dx}\right)^2\right]^{1/2}\approx dx\left[1+\frac{1}{2}\left(\frac{dw(x)}{dx}\right)^2\right]$$ where the approximation arises from a Taylor series expansion for small displacements.
The corresponding axial strain in this differential element is $\epsilon=\frac{ds-dx}{dx}=\frac{1}{2}\left(\frac{dw(x)}{dx}\right)^2$. Multiply this strain by the constant residual stress to obtain the work done per unit volume and then integrate over the beam volume to obtain
$$U_\mathrm{residual\;stress}=\int_0^L \sigma_0\left[\frac{1}{2}\left(\frac{dw(x)}{dx}\right)^2\right] hb\,dx$$ where $hb$ is the cross-sectional area.

*For bending, we have a stress that generally varies across the cross section as well as down the length of the beam. The differential strain energy density per unit volume is $\sigma\,d\epsilon$. Assume linear elasticity of an isotropic material (so that $\sigma=E\epsilon$, where $E$ is Young's modulus) and integrate $E\epsilon\,d\epsilon$ with respect to the strain to obtain $\frac{E\epsilon^2}{2}$, which is also known as the strain energy density or elastic energy density. This density applies to any arbitrary differential element; therefore, let's write $dU=\left(\frac{E\epsilon^2}{2}\right)dV$ to represent the differential strain energy.  Now approximate the curvature as $w(x)^{\prime\prime}$ to obtain a strain of $\epsilon\approx -w(x)^{\prime\prime}y$ for a distance of $y$ from the neutral axis.
Integrating over the beam volume, we note that the moment of inertia $I$ is defined as $\int\int_A y^2 dA$; thus, we pull that part out, leaving only the integration over the beam length: $$U_\mathrm{bending}=\int_0^L EI\left[\frac{1}{2}\left(-\frac{d^2w(x)}{dx^2}\right)^2\right]dx$$

*The beam is supported on both sides by a spring, whose torsional stiffness (or resisting moment per angular displacement $\theta$) is derived elsewhere in the paper as $k=4EI_a/L_a$. The elastic energy is therefore $\frac{1}{2}k\theta^2$ or $\frac{1}{2}k\left[dw(0)/dx\right]^2$ and $\frac{1}{2}k\left[dw(L)/dx\right]^2$ for the left and right spring, respectively. Because $w(0)=w(L)$ by symmetry, the total spring energy is $$U_\mathrm{spring}=\frac{4EI_a}{L_a}\left(\frac{dw(L)}{dx}\right)^2.$$
