Forced nonlinear oscillator - analytical methods This is an example from Kovacic & Brennan (2011). Consider the following equation of motion for a forced, non-linear oscillator (Duffing's equation):
$$
\ddot x + 2 \zeta \dot x + \alpha x + \gamma x^3 = F \cos \Omega t,
$$
where $\zeta, \alpha, \gamma, F$ and $\Omega$ are parameters. We assume "the steady-state harmonic solution" as
$$
x = Y\cos{(\Omega t - \theta)}.
$$
My goal is to obtain the following equation for $Y$:
$$
Y^2 = \frac{F^2}{4\zeta^2\Omega^2 + \left( \Omega^2 - \alpha - 
%
\frac{3}{4}\gamma Y^2 \right)^2}.
$$
This is done by 1) substituting the second equation into the first, and 2) equating the coefficients of $\sin\Omega t$ and $\cos\Omega t$ from both sides.
The substitution part seems straightforward, but I can't quite wrap my head around the last step. Especially the "$\cos(\Omega t-\theta)$" on the right hand side is causing headaches.
Suggestions are welcome!
 A: This problem is simple differentiation and substitution...except that the cubic term makes things a little hairy.  First thing is to expand the cosine term as 
$$\cos{(\Omega t-\theta)} = \cos{\Omega t} \cos{\theta} + \sin{\Omega t} \sin{\theta}$$
Now differentiate and plug in.  The linear terms involving the derivative are simple and I'll just list them here:
$$\ddot{x} + 2 \zeta \dot{x} + \alpha x = Y \left [ \left ( -\Omega^2 \cos{\theta} - 2 \zeta \Omega \sin{\theta} + \alpha \cos{\theta}  \right ) \cos{\Omega t} \\+ \left (-\Omega^2 \sin{\theta} + 2 \zeta \Omega \cos{\theta} + \alpha \sin{\theta}  \right ) \sin{\Omega t} \right ]  $$
The cubic piece is expanded as usual:
$$\gamma x^3 = \gamma Y^3 (\cos^3{\Omega t} \cos^3{\theta} + 3 \cos^2{\Omega t} \sin{\Omega t} \cos^2{\theta} \sin{\theta} + 3 \sin^2{\Omega t} \cos{\Omega t} \sin^2{\theta} \cos{\theta}+ \sin^3{\Omega t} \sin^3{\theta}$$
Now we do not want powers of the sines and cosines, but rather linear terms.  Use the fact that
$$\cos{3 y} = 4 \cos^3{y} - 3 \cos{y}$$
$$\sin{3 y} = 3 \sin{y} - 4 \sin^3{y}$$
and, doing some rearranging, get that
$$\gamma x^3 = \gamma Y^3 \left [\frac{3}{4} \cos{\theta} \cos{\Omega t} + \frac{3}{4} \sin{\theta} \sin{\Omega t} \\+ \frac{1}{4} \cos{\theta}\left (\cos^2{\theta} - 3 \sin^2{\theta} \right ) \cos{3 \Omega t} + \frac{1}{4} \sin{\theta}\left (3 \cos^2{\theta}-\sin^2{\theta} \right ) \sin{3 \Omega t} \right ]$$
Note that the $3 \Omega$ terms represent the frequency multiplication induced by nonlinear terms.  We will ignore these terms because...(e.g., $\gamma$ is small, etc. etc.).  What we are left with is
$$Y \left [ \left ( \left (\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2\right ) \cos{\theta} - 2 \zeta \Omega \sin{\theta}  \right ) \cos{\Omega t} \\+ \left ( \left (\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2\right ) \sin{\theta} + 2 \zeta \Omega \cos{\theta}  \right ) \sin{\Omega t} \right ]  = F \cos{\Omega t}$$
Now we simply eliminate $\theta$ by setting the coefficient of $\sin{\Omega t}$ to zero:
$$\left (\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2\right ) \sin{\theta} + 2 \zeta \Omega \cos{\theta}  =0$$
or
$$\tan{\theta} = -\frac{ 2 \zeta \Omega}{\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2}$$
which means that, to within a sign,
$$\cos{\theta} = \frac{\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2}{\sqrt{4 \zeta^2 \Omega^2 + \left (\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2 \right )^2}} $$
$$\sin{\theta} = -\frac{2 \zeta \Omega}{\sqrt{4 \zeta^2 \Omega^2 + \left (\alpha-\Omega^2 + \frac{3}{4} \gamma Y^2 \right )^2}} $$
and therefore, plugging these values into the equation for the coefficient of $\cos{\Omega t}$, we get that, within a sign:
$$Y = \frac{F}{\sqrt{4 \zeta^2 \Omega^2 + \left (\Omega^2 -\alpha - \frac{3}{4} \gamma Y^2 \right )^2}} $$
The posted equation for $Y$ follows.
