Solution (source code)

= Solution

Choose real normalized <eigenfunctions>, including the two <zero-energy filament modes>. The expansion is
$$
h=a_{\rm tr}W_{\rm tr}+a_{\rm tilt}W_{\rm tilt}+\sum_{n\geq1}a_nW_n.
$$
<Integration by parts> with the natural endpoints gives $\int W_m''W_n''dx=k_n^4\delta_{mn}$. Hence
$$
\mathcal E=\frac A2\sum_{n\geq1}k_n^4a_n^2.
$$
For each positive mode, the <equipartition theorem> gives
$$
\boxed{\langle a_n^2\rangle=\frac{k_BT}{Ak_n^4}.}
$$
Distinct modal amplitudes are independent centered <Gaussian random variables> in the canonical bending ensemble.

The rigid translation and tilt amplitudes have no energy cost. Their integrals in the <canonical ensemble> are unbounded, so \b[a completely free filament has no normalizable equilibrium height distribution and no finite height <variance> determined by this energy alone]. This is a physical qualification of the requested <variance>, not a reason to omit the bending fluctuations.

Fixing translation and tilt, for example by imposing $\int h\,dx=\int(x-L/2)h\,dx=0$, leaves the <rigid-motion-projected thermal covariance of a free filament>:
$$
\boxed{C(x,y)=\frac{k_BT}{A}\sum_{n\geq1}\frac{W_n(x)W_n(y)}{k_n^4},\qquad
\operatorname{Var}h(x)=\frac{k_BT}{A}\sum_{n\geq1}\frac{W_n(x)^2}{k_n^4}.}
$$
For unnormalized modes, divide each summand by $\int W_n^2dx$. Any prescribed independent <variance> of the two rigid amplitudes must be added separately; <equipartition theorem> does not assign it.

The <free-filament variance with fixed translation and tilt> also has a closed form. Integrate a <white noise> curvature field twice, and subtract its affine least-squares projection. With $u=x/L$, $t=s/L$, the dimensionless kernel is
$$
\mathcal K(u,t)=(u-t)_+-\frac{(1-t)^2}{2}
-(1-3t^2+2t^3)(u-\tfrac12).
$$
It has zero mean and first spatial moment, while its second $u$ derivative is the delta source. Since the <covariance> is $(k_BT/A)\delta(s-s')$, integrate its squared kernel to obtain
$$
\boxed{\operatorname{Var}h(x)=\frac{k_BTL^3}{A}P(u),\qquad
P(u)=\frac1{105}-\frac{11u}{105}+\frac{13u^2}{35}-\frac{u^3}{3}
-\frac{u^4}{3}+\frac{3u^5}{5}-\frac{u^6}{5}.}
$$
This conditional profile is symmetric about the midpoint: $P(1-u)=P(u)$, with endpoint value $1/105$ and midpoint value $1/320$. It refers to removing the free rigid motion, not to clamping either end.