Solution (source code)

= Solution

Put $C_a=\sqrt{15/(16a^5)}$, with $a>0$. Direct <integration> confirms the normalization:
$$
\int_{-a}^aC_a^2(a^2-x^2)^2dx=C_a^2\frac{16a^5}{15}=1.
$$
The <kinetic energy> and <potential energy> terms in the dimensionless <Rayleigh quotient> are
$$
K=C_a^2\int_{-a}^a4x^2dx=\frac5{2a^2},\qquad V=C_a^2\int_{-a}^ax^2(a^2-x^2)^2dx=\frac{a^2}{7}.
$$
Thus $\lambda_0\leq5/(2a^2)+a^2/7$. Differentiating with respect to $a$ gives $-5/a^3+2a/7=0$, so the unique minimizing width is $a=(35/2)^{1/4}$. The two energy contributions are equal there, and the <compact parabolic trial bound for the quantum harmonic oscillator> is
$$
\boxed{a_{\rm opt}=\left(\frac{35}{2}\right)^{1/4},\qquad\lambda_0\leq\sqrt{\frac{10}{7}}\simeq1.195229.}
$$
The trial is continuous and zero at $\pm a$, so its weak first derivative is $-2C_ax$ inside and zero outside. The jumps of that derivative do not add delta terms to the first derivative, and its squared norm is finite. The energy-form calculation is therefore valid even though the trial does not belong to the operator domain of the harmonic oscillator. Applying the second-derivative operator naively and omitting its endpoint distributions would be incorrect.