Find the general solution of y'' + y = 2xcos xcos 3x
Find the general solution of $y'' + y = 2x\cos x\cos 3x$.
Explanation of Method
The product-to-sum identity 2cos x cos 3x = cos 2x + cos 4x splits the right-hand side into two independent, non-resonant polynomial×trig sub-problems.
Step 1: Simplify the right-hand side first
Before choosing a trial, it pays to simplify the product of trig functions using the product-to-sum identity $2\cos A\cos B=\cos(B-A)+\cos(B+A)$, with $A=x,\ B=3x$: $2\cos x\cos 3x = \cos(3x-x)+\cos(3x+x) = \cos 2x+\cos 4x.$
The equation becomes $y''+y = x\cos 2x+x\cos 4x$, and by superposition $y^*=y_1^*+y_2^*$.
Step 2: Homogeneous solution
$r^2+1=0 \implies r=\pm i$, $Y_h = C_1\cos x + C_2\sin x$.
Step 3: Part 1: $x\cos 2x$
Here $\alpha=0,\ \beta=2$, degree $n=1$. The associated exponents $r=\pm2i$ are checked against the roots $\{\pm i\}$: not a match ($s=0$), so try $y_1^*=(A_1x+A_0)\cos 2x+(B_1x+B_0)\sin 2x$. Substituting into $y''+y=x\cos 2x$ and matching $x\cos2x,\ x\sin2x,\ \cos2x,\ \sin2x$ gives:
\[ x\cos2x:\ -3A_1=1 \implies A_1=-\frac13, \qquad x\sin2x:\ -3B_1=0 \implies B_1=0, \]
\[ \cos2x:\ 4B_1-3A_0=0 \implies A_0=0, \qquad \sin2x:\ -4A_1-3B_0=0 \implies B_0=\frac49. \]
\[ y_1^* = -\frac{x\cos 2x}{3}+\frac{4\sin 2x}{9} = \frac19\bigl(4\sin 2x-3x\cos 2x\bigr). \]
Step 4: Part 2: $x\cos 4x$
Here $\alpha=0,\ \beta=4$, degree $n=1$. The exponents $r=\pm4i$ are again not among $\{\pm i\}$ ($s=0$), so the same procedure with $\beta=4$ applies to $y_2^*=(A_1x+A_0)\cos 4x+(B_1x+B_0)\sin 4x$, solving $y''+y=x\cos 4x$:
\[ x\cos4x:\ -15A_1=1 \implies A_1=-\frac{1}{15}, \qquad x\sin4x:\ -15B_1=0 \implies B_1=0, \]
\[ \cos4x:\ 8B_1-15A_0=0 \implies A_0=0, \qquad \sin4x:\ -8A_1-15B_0=0 \implies B_0=\frac{8}{225}. \]
\[ y_2^* = -\frac{x\cos 4x}{15}+\frac{8\sin 4x}{225} = \frac{1}{225}\bigl(8\sin 4x-15x\cos 4x\bigr). \]
Step 5: Combine and verify
Direct substitution of $y_1^*+y_2^*$ into $y''+y$ reproduces $x\cos2x+x\cos4x=2x\cos x\cos3x$ exactly, confirming both parts.
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 + \frac19\bigl(4\sin 2x-3x\cos 2x\bigr) + \frac{1}{225}\bigl(8\sin 4x-15x\cos 4x\bigr)\,}\]