In this article, the authors present the inhomogeneous equation
$$\ddot{\phi}_2 + \phi_2 + g_2\phi_1^2 + \omega_1\ddot{\phi}_1 = 0,\tag{11}$$
where
$$ \phi_1 = p_1 \cos(\tau + \alpha), \tag{13}$$
followed by its solution
$$\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)]. \tag{14}$$
Check my solution .
For the sake of convenience, let's say we have guessed the solution of eqn. (11). Now just put your guess into eqn. (11) (together with eqn. (13)) and voila, you see that it is indeed a correct guess! There are ways to derive that the solution has to look like this, but this is a bit more complex. Really, just think of it that you guess a solution (a smart guess though) and you can proof it by inserting.
EDIT: Full solution for eqn. (11)
I will not try and explain how to obtain the solution since I think you have to learn the basics first. I will show you how to do it the easy way. But I think the mistake in nervxxx's description is the missing $\tau$ dependence in one of the prefactors.
Anyway, let's start with the given $\phi_2$.
$\phi_2=p_2\cos x +q_2 \sin x + \frac{g_2}{6}p_1^2\cos 2x - \frac{g_2}{2}p_1^2+\frac{\omega_1}{2}p_1\tau\sin x + \frac{\omega_1}{4}p_1\cos x\\ x=\tau+\alpha$
Doing the first and second derivation about $\tau$ gives:
$\ddot\phi_2=-p_2\cos x -q_2 \sin x - \frac{2g_2}{3}p_1^2\cos 2x+\omega_1p_1\cos x - \frac{\omega_1}{4}p_1\cos x - \frac{\omega_1}{2}p_1\tau\sin x$
Now we calculate $\ddot\phi_2+\phi_2$:
$\ddot\phi_2+\phi_2=\omega_1p_1 \cos x+\frac{1}{2}g_2p_1^2\cos 2x - \frac{g_2}{2}p_1^2$
In eqn. (11) there are two more terms we need to calculate.
$\omega_1 \ddot\phi_1=-\omega_1 p_1 \cos x \\ g_2\phi_1^2 = g_2p_1^2\cos^2 x $
We now need to do something with the $\cos^2 x$. Looking at the addition theorem (hope this is the correct term in english):
$\cos(x+x)=\cos 2x = \cos^2 x - \sin^2 x \\ \sin^2 x = 1 - \cos^2 x \\ \Rightarrow \cos 2x = 2 \cos^2 x - 1 \\ \Rightarrow \cos^2 x = \frac{1}{2} + \frac{1}{2}\cos 2x $
So we get:
$g_2\phi_1^2=\frac{g_2}{2}p_1^2+\frac{g_2}{2}p_1^2\cos 2x$
If you now calculate $\ddot\phi_2 + \phi_2 + g_2\phi_q^2 + \omega_1\ddot\phi_1$
it will indeed yield zero! So we have shown that the given ansatz is a solution for eqn. (11).