Problem 138
Easy Nonhomogeneous Equations

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

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

Explanation of Method

With characteristic roots ±i, the forcing frequency β=2 does not match, so the trial Acos2x+Bsin2x needs no extra factor of x.

Step 1: Homogeneous solution

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

Step 2: Choose the trial form

The right-hand side is $\sin\beta x$ with $\alpha=0,\ \beta=2$, so we test whether $r=\pm2i$ is a root. The roots are $\pm i$, so $\pm2i$ is not a root ($s=0$), and the trial is unmodified:

\[ y^* = A\cos 2x + B\sin 2x. \]

Step 3: Substitute

\[ y^{*\prime}=-2A\sin2x+2B\cos2x, \qquad y^{*\prime\prime}=-4A\cos2x-4B\sin2x. \]

\[ (-4A\cos2x-4B\sin2x)+(A\cos2x+B\sin2x)=\sin2x \implies -3A\cos2x-3B\sin2x=\sin2x. \]

Step 4: Match coefficients

\[ \cos2x:\ -3A=0\implies A=0, \qquad \sin2x:\ -3B=1\implies B=-\tfrac13. \]

\[ y^* = -\frac{\sin 2x}{3}. \]

Step 5: Verify

\[ y^{*\prime\prime}=\frac{4\sin2x}{3}, \qquad y^{*\prime\prime}+y^* = \frac{4\sin2x}{3}-\frac{\sin2x}{3}=\sin2x.\ \checkmark \]

Step 6: General solution

The solution is recorded in the result below.


Result

Final answer:

\[\boxed{\,y = C_1\cos x + C_2\sin x - \frac{\sin 2x}{3}\,}\]