Second order non-homogeneous ODE (BVP)

418 Views Asked by At

\begin{cases} u''+a^2u=\sin(\pi x),\quad 0<x<1 \\ u(0)=1,\quad u(1)=-2 \end{cases}

I found the characteristic equation to be $$r^2+a^2=0\implies r=\pm ai$$

So $$u=C\cos(ax)+D\sin(ax)$$ $$u'=-Ca\sin(ax)+Da\cos(ax)$$ $$u''=-Ca^2\cos(ax)-Da^2\sin(ax)$$

I find substitute these expressions into the BVP to get,

$$(-Ca^2\cos(ax)-Da^2\sin(ax))+a^2(C\cos(ax)+D\sin(ax))=\sin(\pi x),$$

But I'm just getting the left side terms cancelling themselves out...

1

There are 1 best solutions below

2
On

The general solution of the homogeneous equation is as you found out $$ u_h(x)=A\cos(a\,x)+B\sin(a\,x). $$ To find a particular solution you can use the method of variation of constants or the method of undetermined coefficients, which in this case is simpler. If $a\ne\pi$, a particular solution is of the form $$ u_p(x)=C_1\cos(\pi\,x)+C_2\sin(\pi\,x). $$ Plug this into the equation to find $C_1$ and $C_2$.

If $a=\pi$, then the particular solution will be of the form $$ u_p(x)=x\bigl(C_1\cos(\pi\,x)+C_2\sin(\pi\,x)\bigr). $$