Solve the BVP $$\begin{cases} u''+a^2u=sin\pi x, \quad 0<x<1 \\ u(0)=1,\quad u(1)=-2 \end{cases}$$
for all $a\in\mathbb{R}$. What are the solutions in the cases $a=\pm\pi$?
Here, $'=\frac{du}{dx}$. I know I need the characteristic function, which I get $r^2+a^2=0\implies r=\pm ai$. Then the complementary solution is, $$u_c=C_1e^{ai*t}+C_2e^{-ai*t}$$
HINT:
Since the homogeneous solutions to the ODE $u''+\pi^2 u=\sin(\pi x)$ are of the form $u_h=A\sin(\pi x)+B\cos(\pi x)$, try complementary solutions of the form $u_c=Cx\sin(\pi x)+Dx\cos(\pi x)$.
Alternatively, use Laplace Transforms.
Alternatively, find the Green (or Green's) function for the problem
$$G''(x,x')+\pi^2 G(x,x')=\delta(x-x')$$
with $G(0,x')=1$, $G(1,x')=-2$, $G$ is continuous at $x=x'$, and $\left.\frac{\partial G}{\partial x}\right|_{x=x'^+}-\left.\frac{\partial G}{\partial x}\right|_{x=x'^-}=1$ and integrate.