<s>[INST] solving differential equation $\frac{d^3y}{dx^3}+\frac{d^2y}{dx^2}=x^2+2x+2$ How would you solve this third order differential equation:
$$\frac{d^3y}{dx^3}+\frac{d^2y}{dx^2}=x^2+2x+2$$
My first thought was to take a double integral:
$$\iint\frac{d^3y}{dx^3}+\frac{d^2y}{dx^2}dxdx=\iint{x^2+2x+2}dxdx$$
so:
$$y+\frac{dy}{dx}=\frac{x^4}{12}+\frac{x^3}{3}+x^2+c_1x+c_2$$
This is what I got to but I am unsure beyond here 
 [/INST] Well, there are many ways you can you solve this DE. However, the simplest would be using the characteristic equation and since its a non-homogeneous DE, we need to find a particular solution as well. Finally we need to use the superposition principle to add the solution. 
Now, in symbols and numbers
$$
r^3 +r^2 = 0 \\
r = 0\; \text{or}\; r = -1
$$
Note that for $r =0$ it is a double root because every n-polynomial has n roots. Therefore,
$$
y_c = c_1 + c_2x + c_3e^{-x}
$$
now plugging $y_p = Ax^4 + Bx^3 + Cx^2$ in such  a way that it satisfies the DE we get 
$$
24Ax + B + 12Ax^2 + 6Bx +2C = x^2+2x+2 \\
12Ax^2+ (24A + 6B)x +(B+2C) = x^2 +2x+2
$$
hence $A=\frac{1}{12}$, $B = 0$ and $C=1$ therefore $y_p = \frac{1}{12}x^4 + x^2$ and our general solution would be the sum, so 
$$
y = c_1+ +c_2x+ c_3e^{-x} +\frac{1}{12}x^4 +x^2
$$
Hope this helps !
</s>