# How is this linear 2nd-order ODE solved?

$$\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 .

-

## migrated from physics.stackexchange.comFeb 1 '13 at 22:00

This question came from our site for active researchers, academics and students of physics.

Related question by OP: physics.stackexchange.com/q/52590/2451 – Qmechanic Feb 1 '13 at 13:41
Solving eq (10), get $\phi_1$. Then sub into eq (11), solve for $\phi_2$ – hwlau Feb 1 '13 at 14:18
@hwlau, can you do the math please? – Complex Guy Feb 1 '13 at 14:38
Hint: Equation (5) in the paper is wrong. The subscript for phi should be k, not n. – Mew Feb 1 '13 at 15:48
My solution accidentally solved for equation (11) instead of (14) oops – Mew Feb 1 '13 at 16:30

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).

-
I tried many times, can you do that please. – Complex Guy Feb 1 '13 at 14:45
Sorry mate but at some point you have to figure out stuff by yourself. Otherwise, you will never learn how to do it. In this case you only have to be able to derivate about time ($\tau$). – DaPhil Feb 1 '13 at 15:08
Can you do this solution please – Complex Guy Feb 2 '13 at 17:42
No. You should instead edit your post and write down exactly where you have problems. Write down the steps you did and the extensions you get. Then we are able to help you. So first question: Do you understand how eqn. (13) is obtained? If yes, write down your try of getting eqn. (14) and we can see where the problems arise. – DaPhil Feb 2 '13 at 18:35
okay I'm doing then – Complex Guy Feb 2 '13 at 18:39

This is a pretty standard ODE to solve, because it is just a 2nd order linear differential equation. It is inhomogeneous though. By that I mean we are looking at the equation

\begin{align} \ddot{\phi_2} + \phi_2 = f(\tau). \end{align} Here $f(\tau) = -g_2 \phi_1^2 - \omega_1 \ddot{\phi_1}$, whose dependence on $\tau$ we know explicitly.

Now say that we have a solution $\psi(\tau)$ of this differential equation. Note that because of linearity, a function of the form $\psi(\tau) + \Phi(\tau)$ where $\Phi(\tau)$ satisfies the homogeneous ODE \begin{align} \ddot{\Phi} + \Phi = 0 \end{align} is a solution too. This should be obvious to you.

Now this homogenous ODE is just an ODE of a simple harmonic oscillator. You should know the solution to this. If you don't, then it is time to stop reading these research papers and pick up an introductory book to ODEs....

Next we have to solve for the particular solution of the inhomogeneous ODE $\psi(\tau)$. Look at what $f(\tau)$ is. It has 3 kinds of terms: \begin{align} &\sim \cos(\tau + \alpha) \\ &\sim \cos(2(\tau + \alpha)) \\ & \sim constant. \end{align} The first term comes from the $\ddot{\phi_1}$ term, while the other two terms comes from $\phi_2^2$ (and using a trignometric identity).

So we are led to consider a particular solution of this form: \begin{align} \psi(\tau) = A \cos(\tau + \alpha) + B \sin(\tau + \alpha) + C \cos(2(\tau + \alpha)) + D\sin(2(\tau + \alpha)) + E. \end{align} Plugging that into the ODE will give you what $A, B, C, D, E$ should be. Please try it yourself, otherwise, like DaPhil says, you will never learn how to do it.

Cheers.

-
The solution of the ordinary differential equation is easy to do, but when I try for $\phi^2_1$, it gives $\frac{p_1^2}{2}[1+cox2(\tau+ \alpha)]$, why is this? – Complex Guy Feb 2 '13 at 7:06
So from my calculations, it becomes $g_2 \frac{p_1^2}{2}[1+cox2(\tau+ \alpha)]$ but they did, $g_2 \frac{p_1^2}{6}[cox2(\tau+ \alpha)-3]$. – Complex Guy Feb 2 '13 at 7:08
According to nervexx, what we will guess for $f(\tau)$ ? – Complex Guy Feb 3 '13 at 6:41
er $f(\tau)$ is known. It is $-g_2 \phi_1^2 - \omega_1 \ddot{\phi_1}$ where you told me $\phi_1 = p_1 \cos(\tau + \alpha)$. If you're asking what to guess for the particular solution, I already gave it to you. Just plug it into the ODE and match terms to get $A B C D E$. – nervxxx Feb 3 '13 at 6:49
What do you meant by E ? – Complex Guy Feb 3 '13 at 7:15

Particular solution can be written in the form\begin{align} \phi_2 = p_2 \cos(\tau + \alpha) + q_2 \sin(\tau + \alpha) + C \cos(2(\tau + \alpha)) + D\sin(2(\tau + \alpha)) + E. \end{align} Now after doing derivative, we get, $$\dot{\phi_2}= -p_2 sin(\tau +\alpha)+q_2cos(\tau+ \alpha)-2Csin(2\tau+2\alpha)+2Dcos(2\tau+2\alpha)$$ $$\ddot{\phi_2}= -p_2 cos(\tau +\alpha)-q_2sin(\tau+ \alpha)-4Csin(2\tau+2\alpha)-4Dsin(2\tau+2\alpha)$$ putting these into equation (11), we get, $$E-3Ccos(2\tau+2\alpha)-3Dsin(2\tau+2\alpha)+\frac{1}{2}g_2p_1^2+\frac{1}{2}g_2p_1^2cos(2\tau+2\alpha)-\omega_1p_1cos(\tau+\alpha)=0$$ $$-3Dsin(2\tau+2\alpha)+cos(2\tau+2\alpha)(-3C-\frac{1}{2}g_2p_1^2)+[E+\frac{1}{2}g_2p_1^2-\omega_1p_1cos(\tau+\alpha)]=0$$ Now, we get, $$D=0$$, $$-3C-\frac{1}{2}g_2p_1^2=0$$ $$C=\frac{g_2p_1^2}{6}$$ then E becomes $$E=\omega_1p_1cos(\tau + \alpha)- \frac{1}{2}g_2p_1^2$$ Therefore we get, the require solution, \begin{align} \phi_2 = p_2 \cos(\tau + \alpha) + q_2 \sin(\tau + \alpha) + \frac{g_2p_1^2}{6} \cos(2(\tau + \alpha)) + \omega_1p_1cos(\tau+\alpha)-\frac{1}{2}g_2p_1^2 \end{align} \begin{align} \phi_2 = p_2 \cos(\tau + \alpha) + q_2 \sin(\tau + \alpha) + \frac{g_2p_1^2}{6} [\cos(2(\tau + \alpha)) -3]+ \omega_1p_1cos(\tau+\alpha) \end{align} check the solution of the last term, whats wrong in my calculations?

-
@DaPhil check my solution. – Complex Guy Feb 3 '13 at 17:18
@nervxxx check the mistake – Complex Guy Feb 3 '13 at 17:18