1. **Stating the problem:** Solve the differential equation $$\frac{d^2y}{dx^2} + \frac{dy}{dx} - 2y = x \sin x.$$\n\n2. **Identify the type of equation:** This is a nonhomogeneous linear second-order differential equation with constant coefficients.\n\n3. **Solve the homogeneous equation:** $$\frac{d^2y}{dx^2} + \frac{dy}{dx} - 2y = 0.$$\nCharacteristic equation: $$r^2 + r - 2 = 0.$$\nSolve for $r$: $$r = \frac{-1 \pm \sqrt{1 + 8}}{2} = \frac{-1 \pm 3}{2}.$$\nSo, $$r_1 = 1, \quad r_2 = -2.$$\nGeneral solution to homogeneous equation: $$y_h = C_1 e^{x} + C_2 e^{-2x}.$$\n\n4. **Find a particular solution $y_p$:** Since the right side is $x \sin x$, try variation of parameters or undetermined coefficients.\nBecause the forcing function is $x \sin x$, try a particular solution of the form: $$y_p = (A x + B) \cos x + (C x + D) \sin x.$$\n\n5. **Compute derivatives:**\n$$y_p' = (A \cos x + (A x + B)(-\sin x)) + (C \sin x + (C x + D) \cos x)$$\nSimplify carefully and compute $$y_p''$$ similarly.\n\n6. **Substitute $y_p$, $y_p'$, and $y_p''$ into the original equation:**\nCollect coefficients of $\sin x$ and $\cos x$ terms and equate to the right side $x \sin x$.\n\n7. **Solve the resulting system of equations for $A$, $B$, $C$, and $D$.**\n\n8. **Write the general solution:**\n$$y = y_h + y_p = C_1 e^{x} + C_2 e^{-2x} + (A x + B) \cos x + (C x + D) \sin x.$$\n\n**Final answer:** The solution is $$y = C_1 e^{x} + C_2 e^{-2x} + (A x + B) \cos x + (C x + D) \sin x,$$ where $A$, $B$, $C$, and $D$ are constants found by substituting into the equation and equating coefficients.
Diff Eq Sinx 100600
Step-by-step solutions with LaTeX - clean, fast, and student-friendly.