= Solution
For $L=d^2/dx^2+1$ with homogeneous <Dirichlet boundary condition>[Dirichlet data] at $0$ and $2\pi$, <integration by parts> shows that $L^*=L$. Its homogeneous kernel is
$$
\ker L=\operatorname{span}\{\sin x\},
$$
because $A\cos x+B\sin x$ vanishes at both endpoints exactly when $A=0$.
The forcing obeys the <orthogonality> condition
$$
\int_0^{2\pi}\cos x\sin x\,dx=0.
$$
The <Fredholm alternative for an elliptic Dirichlet problem> therefore says that solutions exist, though they are not unique. Indeed,
$$
\boxed{u(x)=\frac{x}{2}\sin x+C\sin x}
$$
satisfies $u''+u=\cos x$ and both boundary conditions for every constant $C$.
Back to article page