= Solution
First expand the variational integrand:
$$
\mathcal L=f'^2+(3f-x)f'+2f^2-2x^2.
$$
Its needed partial <derivatives> are $\mathcal L_f=3f'+4f$ and $\mathcal L_{f'}=2f'+3f-x$. The <Euler-Lagrange equation> is therefore
$$
\frac d{dx}(2f'+3f-x)-(3f'+4f)=0,\qquad\boxed{f''-2f=\frac12.}
$$
The general solution is $f=A\cosh(\sqrt2x)+B\sinh(\sqrt2x)-1/4$. Subtracting the two endpoint equations gives $B=0$; adding them gives $A=1/[4\cosh\sqrt2]$. Hence
$$
\boxed{f(x)=\frac14\left[\frac{\cosh(\sqrt2x)}{\cosh\sqrt2}-1\right].}
$$
This is the unique stationary solution. It is also the unique <global minimizer>: after discarding the fixed <boundary terms>, <integration by parts> rewrites $I$ as $\int_{-1}^1[f'^2+2f^2+f-2x^2]dx$. For an endpoint-zero <variation> $\eta$, the linear part vanishes at the displayed solution and
$$
I[f+\eta]-I[f]=\int_{-1}^1[\eta'^2+2\eta^2]dx\geq0,
$$
with equality only for $\eta=0$.
Back to article page