Solution (source code)

= Solution

Interpret “held” and then “released” as zero initial velocity. In the small-slope <wave equation on a string> model, the elastic energy is $U=(T/2)\int_0^L y_x^2dx$ and the initial <kinetic energy> is zero. The given profile has
$$
y_x(x,0)=\frac\pi L\left(\cos\frac{\pi x}L-\cos\frac{3\pi x}L\right).
$$
The two cosine functions are orthogonal on $[0,L]$ and each has squared integral $L/2$. Thus
$$
\boxed{E(0)=\frac T2\frac{\pi^2}{L^2}\left(\frac L2+\frac L2\right)=\frac{T\pi^2}{2L}.}
$$
The implicit leading displacement amplitude is one in the source's chosen length units. If that amplitude is written explicitly as $A$, all energies here and below acquire a factor $A^2$.