= Solution
Multiply by a <test function> vanishing at the endpoints and apply <integration by parts>. The positive operator is $-u''+xu$, so the forcing changes sign. The <weak formulation> of this <forced Airy boundary-value problem> is: find $u\in V=H_0^1(0,1)$ such that
$$
\boxed{a(u,v)=\ell(v)\quad(v\in V),\qquad
a(u,v)=\int_0^1(u'v'+xuv)\,dx,\quad
\ell(v)=-\int_0^1v\,dx.}
$$
Here $V$ is the <zero-boundary Sobolev space> and can be equipped with $\|v\|_V=\|v'\|_{L^2}$. The interval <Poincaré inequality> states $\|v\|_{L^2}\leq\pi^{-1}\|v'\|_{L^2}$, so this <norm> makes $V$ a <Hilbert space> and is equivalent to its usual $H^1$ <Sobolev norm>. The form is symmetric and satisfies
$$
|a(u,v)|\leq(1+\pi^{-2})\|u\|_V\|v\|_V,\qquad
a(v,v)\geq\|v\|_V^2,\qquad
|\ell(v)|\leq\pi^{-1}\|v\|_V.
$$
The <Lax-Milgram theorem> says that a bounded <coercive bilinear form> on a <Hilbert space> and a <bounded linear functional> determine exactly one weak solution. All its hypotheses have just been verified. Moreover, $u''=xu+1\in L^2$ gives $u\in H^2$ on the interval; the right-hand side is then continuous, so this weak solution is the classical solution with the prescribed endpoint values.
Since the form is symmetric, the equivalent <Ritz method> minimizes
$$
\boxed{J(v)=\frac12\int_0^1[(v')^2+xv^2]\,dx+\int_0^1v\,dx
\quad\text{over }H_0^1(0,1).}
$$
Indeed, stationarity gives the weak equation and
$$
J(v)-J(u)=\tfrac12a(v-u,v-u)\geq0,
$$
with equality only at $u$. This proves the minimization equivalence, including the sign of the linear term.
Restricting to a <conforming finite element space> $V_h\subset V$ gives a unique discrete solution and <Galerkin orthogonality>, $a(u-u_h,v_h)=0$ for every $v_h\in V_h$. The <Céa lemma> states that if the continuity and coercivity constants are $M$ and $\alpha$, then $\|u-u_h\|_V\leq(M/\alpha)\inf_{v_h\in V_h}\|u-v_h\|_V$. For this symmetric problem the exact best-approximation constant in the <energy norm> is one. The piecewise-linear <finite element interpolation estimate> $\|u-I_hu\|_{H^1}\leq Ch\|u\|_{H^2}$ on regular <finite element meshes> therefore gives <convergence of a numerical method> of the <Ritz method>, with first-order error in the <energy norm>.
Back to article page