Problem 124
Easy Nonhomogeneous Equations

Find the general solution of y'' + 2y = x^2 + 2

Find the general solution of $y'' + 2y = x^2 + 2$.

Explanation of Method

With complex characteristic roots ±i√2, the trial y*=Ax²+Bx+C (r=0 not a root) matches coefficients to A=1/2, B=0, C=1/2.

Step 1: Homogeneous solution

$r^2+2=0 \implies r=\pm i\sqrt{2}$, $Y_h = C_1\cos\sqrt{2}\,x + C_2\sin\sqrt{2}\,x$.

Step 2: Particular solution

The right-hand side $f(x)=x^2+2$ is a polynomial of degree 2, and $r=0$ is not a root of the characteristic equation, so try $y^*=Ax^2+Bx+C$: $y^{*\prime}=2Ax+B, \qquad y^{*\prime\prime}=2A.$

Substitute into the equation: \[2A + 2(Ax^2+Bx+C) = x^2+2 \implies 2Ax^2 + 2Bx + (2A+2C) = x^2+2.\]

Step 3: Match coefficients

\[ x^2:\ 2A=1\implies A=\frac{1}{2}, \qquad x^1:\ 2B=0\implies B=0, \qquad x^0:\ 2A+2C=2\implies 1+2C=2\implies C=\frac{1}{2}. \]

\[ y^* = \frac{x^2}{2}+\frac{1}{2} = \frac{x^2+1}{2}. \]

Step 4: Verify

\[ y^{*\prime\prime} + 2y^* = 1 + 2\cdot\frac{x^2+1}{2} = 1+x^2+1 = x^2+2.\ \checkmark \]

Step 5: General solution

The solution is recorded in the result below.


Result

Final answer:

\[\boxed{\,y = C_1\cos\sqrt{2}\,x + C_2\sin\sqrt{2}\,x + \frac{x^2+1}{2}\,}\]