Solution (source code)

= Solution

For a nonzero real <function>, write $\Lambda=F/G$ with $G=\int_a^bw y^2dx>0$. Multiplying the <Sturm-Liouville equation> by $y$ and integrating gives
$$
\lambda G=\int_a^b\bigl[p(y')^2+qy^2\bigr]dx-\left[pyy'\right]_a^b.
$$
Thus the stated vanishing boundary product proves $\lambda=\Lambda[y]$.

For the variational statement, the <first variation> is
$$
\delta\Lambda=\frac2G\left\{\left[py'\eta\right]_a^b+\int_a^b\left[-(py')'+qy-\Lambda wy\right]\eta\,dx\right\}.
$$
With admissible <boundary conditions> that also make $[py'\eta]_a^b=0$ for every allowed variation, the <fundamental lemma of the calculus of variations> identifies stationary functions with the <eigenfunctions> and stationary values with their <eigenvalues>. Zero <Dirichlet boundary conditions>, zero <Neumann boundary conditions>, and matched periodic data give familiar examples. The single printed condition $[pyy']_a^b=0$ proves the quotient identity but, by itself, does not specify the admissible variations needed for stationarity; the <boundary conditions for variational Rayleigh quotients> make this distinction explicit.

For the half-line equation, multiplication by $x^{n-1}$ gives $p=w=x^{n-1}$ and $q=x^{n+1}$. Use the regular radial boundary condition at zero and square-integrable decay at infinity, under which the proposed Gaussian is admissible. With $y=e^{ax^2}$, $a<0$, $y'=2axy$, so
$$
\Lambda(a)=(4a^2+1)\frac{\int_0^\infty x^{n+1}e^{2ax^2}dx}{\int_0^\infty x^{n-1}e^{2ax^2}dx}=-n\left(a+\frac1{4a}\right).
$$
The ratio of the two <Gaussian integrals> is $n/(-4a)$, from a <change of variables> and the <Gamma function recurrence>. Differentiating gives $\Lambda'(a)=-n[1-1/(4a^2)]$, so the minimum on $a<0$ occurs at $a=-1/2$. The <Gaussian variational bound for a radial harmonic oscillator> therefore gives
$$
\boxed{\lambda_0\leq n,\qquad y_{\rm trial}=e^{-x^2/2}.}
$$
Here the trial actually satisfies the <differential equation> with $\lambda=n$. Moreover, on the same regular decaying domain, <integration by parts> gives $F[y]-nG[y]=\int_0^\infty x^{n-1}(y'+xy)^2dx\geq0$. Hence the estimate is exact, with $\boxed{\lambda_0=n}$. For $n=1$, regular radial data mean the <Neumann boundary condition> $y'(0)=0$; imposing a zero <Dirichlet boundary condition> there would exclude this trial and give a different problem.