# Solving second order linear ordinary differential equation - cauchy problem

I would like to solve the following Cauchy problem:

$$\left\{ \begin{array}{rcl} y'' + 3y' + 2y &=& x^2 + 1,\\ y(2)&=&1,\\ y'(2)&=& 4. \end{array} \right.$$

I found the characteristic equation: $$r^2 + 3r + 2 = 0$$, which has as roots $$r_1 = -1$$ and $$r_2 = -2$$.

The solutions of the homogeneous equation will be of type $$y = Ae^{-x} + Be^{-2x}$$.

To find a solution of the general equation, I used: $$y = \lambda x^2 + \mu$$ $$y' = 2\lambda x$$ $$y'' = 2\lambda$$

So a particular solution of the general equation would something like: $$2\lambda + 3(2\lambda x) + 2(\lambda x^2 + \mu) = x^2 + 1$$ and here is where I got stuck. I don't if the polynomial I used as "candidate" solution ($$y = \lambda x^2 + \mu$$) is incorrect. Does the "proposed" polynomial must have the exact terms or the one I proposed is correct? Could someone give a hint? Thank you

• Yes, you should consider $\alpha x^2+\beta x+\gamma$. Commented Dec 10, 2020 at 21:11

By using Annihilator's Method,, we have the ODE can be written like $$(D^2+3D+2)[y]=x^2+1.$$ By other hand, it is straightforward verify that $$D^3[x^2+1]=0$$, thus, applying $$D^3$$ in the previous operator, we obtain: $$D^3(D^2+3D+2)[y]=0.$$ The roots for the auxiliar equation are $$-1,,2,0,0,0$$, thus, the "general solution" for the previous equation is $$y=c_1e^{-x}+c_2e^{-2x}+c_3+c_4x+c_5x^2.$$ The first couple of terms are exactly the terms of the original homogeneous equation, the remain terms are the terms for a "candidate" of a particular solution, thus, $$y_p=A+Bx+Cx^2.$$ Thus, applying this particular solution into the ODE we obtain $$(2C+3B+2A)+(6C+2B)x+2Cx2\equiv 1+x^2$$ $$\Downarrow$$ $$A=\frac{9}{4},\quad B=-\frac{3}{2}\quad\mbox{e}\quad C=\frac{1}{2}.$$ Finally, $$y_p(x)=\frac{9}{4}-\frac{3}{2}x+\frac{1}{2}x^2.$$ After the Initial Value substituition, we obtain the solution
$$\boxed{y(x)=\frac{13}{4}e^{2-x}-\frac{13}{4}e^{4-2x}+\frac{9}{4}-\frac{3}{2}x+\frac{1}{2}x^2.}$$