# inhomogeneous ordinary differential equation

How to solve the inhomogeneous ordinary differential equation

$$\ddot{\phi}_2 + \phi_2 + g_2\phi_1^2 + \omega_1\ddot{\phi}_1 = 0,$$

where

$$\phi_1 = p_1 \cos(\tau + \alpha),$$

solution is given by

$$\phi_2 = p_2\cos(\tau + \alpha) + q_2\sin(\tau + \alpha) + \frac{g_2}{6}p_1^2[\cos(2\tau + 2\alpha) - 3]$$ $$+ \frac{\omega_1}{4}p_1[2\tau\sin(\tau + \alpha) + \cos(\tau + \alpha)].$$

-
Related question math.stackexchange.com/questions/292406/… – Complex Guy Feb 2 '13 at 18:08

How much do you know about solving 2nd order constant coefficient linear differential equations? You can use trig identities and Calculus to rewrite it in the form $$\ddot\phi_2+\phi_2=A\cos(\tau+\alpha)+B\cos(2\tau+2\alpha)$$ for some $A$ and $B$. Do you know how to solve $y''+y=\cos2x$? Do you know how to solve $y''+y=\cos x$? Do you know how to put together the solutions of $y''+y=\cos2x$ and $y''+y=\cos x$ to get the solution to $y''+y=A\cos x+B\cos2x$?
EDIT: I take it from the comment that OP does not know how to get particular solutions for $$y''+y=\cos2x\tag1$$ and $$y''+y=\cos x\tag2$$ so here goes.
The first one is guaranteed to have a solution of the form $$y=A\sin2x+B\cos2x\tag3$$ for some numbers $A$ and $B$; substitute (3) into (1), and work out what $A$ and $B$ have to be.
Now, (2) does not have a solution of the form $$y=A\sin x+B\cos x\tag4$$ because any such function is a solution of $$y''+y=0\tag5$$ Instead, (2) has a solution of the form $$y=Ax\sin x+Bx\cos x\tag6$$ Substitute (6) into (2) to find $A$ and $B$.
The problem I faced to get $\frac{g_2}{6}p_1^2[\cos(2\tau + 2\alpha) - 3] + \frac{\omega_1}{4}p_1[2\tau\sin(\tau + \alpha) + \cos(\tau + \alpha)]$. How to do? – Complex Guy Feb 3 '13 at 4:15