To solve the differential equation \( (D^2 + 2)y = x^2 \), we need to find the complementary function (C.F.) and the particular integral (P.I.).
Complementary Function (C.F.):
The auxiliary equation is \( D^2 + 2 = 0 \).
This gives \( D^2 = -2 \), or \( D = \pm i\sqrt{2} \).
Therefore, the complementary function is:
\( C_1 \cos(\sqrt{2}x) + C_2 \sin(\sqrt{2}x) \).
Particular Integral (P.I.):
For the given non-homogeneous part \( x^2 \), we use:
\[ \text{P.I.} = \frac{1}{D^2 + 2} \cdot x^2 \]
As \( (D^2 + 2) \) does not divide \( x^2 \), apply the formula:
\[ \frac{1}{f(D)} \cdot x^n = \frac{1}{f(\partial)} \cdot x^n \]
where \( \partial \left(x^n\right) = 0 \). Applying this,
\[ P.I. = \frac{1}{2}x^2 - \frac{1}{2} \cdot 1 \]
\( = \frac{1}{2}(x^2 - 1) \).
Thus, the general solution is the sum of C.F. and P.I.:
\( C_1 \cos(\sqrt{2}x) + C_2 \sin(\sqrt{2}x) + \frac{1}{2}(x^2 - 1) \).