# Thread: Differential Eqn with Trigonometric Functions

1. ## Differential Eqn with Trigonometric Functions

Hi all and thanks for the help. I am so angry at myself for having forgotten everything I learned in college about differential equations . I have the following one but I'm stumped at the first hurdle.

$\frac{d^2\theta}{dt^2} - \sin\theta = 0$

Basically I don't know what to do to integrate the sin term wrt t. Do I have to make some kind of small angle assumption (i'd rather not)? This is the same problem as the simple pendulum equation here but I can't find a really clear solution to it anywhere online.

Any help with this would be fantastic, also if anyone knows of a good undergrad level math book that focuses on differential equations describing physical systems that'd be great.

Thanks all !

mgri

2. As far as I know, it can't be solved exactly.

3. I'm going to put this in notation I prefer (where a dot above a variable signifies differentiation wrt $t$):

$\ddot{\theta} - \sin\theta = 0$.

Multiply by $2 \dot{\theta}$ so

$2 \dot{\theta} \, \ddot{\theta} - 2 \sin \theta \, \dot{\theta} = 0
$

and note that $\frac{d}{dt} \left(\dot{\theta}^2 \right) = 2 \dot{\theta} \ddot{\theta}$ so then if we integrate wrt $t$ we have:

$\dot{\theta}^2 - 2 \int \sin \theta \, \mathrm{d} \theta = 0$,

$\Rightarrow \dot{\theta}^2 + 2 \cos \theta = C$ where $C$ is the constant of integration

so

$\dot{\theta} = \pm \sqrt{C- 2 \cos \theta}$,

Considering only the positive root,

$\Rightarrow \int \frac{1}{\sqrt{C- 2\cos \theta}} \mathrm{d}\theta = t+D$

where $D$ is another constant of integration. This integral falls under the class of 'Elliptic integrals of the first kind'. I.e. it gives you an elliptic function assuming the constant $C$ found from initial conditions does not make it impossible!

So have a look at any good book on Elliptic functions.

4. Thanks Doc! You certainly seem to be onto something there but I'm not sure I follow. Two questions:

(a) could you please explain why:

$\int2 \sin \theta \, \dot{\theta}{d}t = \int \sin \theta \, \mathrm{d} \theta$

(b) in the following equation I understand you're going in the right direction having removed the second order derivative and subsequently taken the square root:

$\dot{\theta}^2+ \cos \theta=C$

$\dot{\theta} = \pm \sqrt{C- \cos \theta}$ (*)

So, where did you get the line below from?

$\int\frac{1}{\sqrt{C- \cos \theta}}{d}\theta = D$

My goal is to use my initial conditions to find theta as a function of time, if I succesfully solve the eliptic integral (*) then I should get there right?

Just as an aside, the reason I've asked this is that I've been using an excel sheet to calculate theta at any given time point by calculating across a small time step and feeding the solution into the next time step etc., but I'd love to get a solution based on dif. eqn theory.

Really appreciate the help.

Thanks Doc.

mgri

5. First please note I made corrections to my last post as I'd written it in a hurry so was a little sloppy!

Now as for your queries:

a)

$\int \sin \theta \, \dot{\theta} \mathrm{d} t = \int \sin \theta \, \frac{d \theta}{d t} \mathrm{d} t$

and the $\mathrm{d}t$s cancel by the integration equivalent of the chain rule. But just in case you don't believe me let

$v = \int \sin \theta \, \dot{\theta} \mathrm{d} t$

then

$\frac{dv}{dt} = \sin \theta \, \frac{d \theta}{d t}
= \frac{d}{d \theta} \left( \int \sin \theta \, \mathrm{d}\theta \right) \frac{d \theta}{d t} = \frac{d}{d t} \left( \int \sin \theta \, \mathrm{d}\theta \right)$
by the chain rule.

So integrating this equation wrt $t$ gives you:

$v = \int \sin \theta \, \mathrm{d}\theta$ . QED.

b)

This equation is now of separable variable type.

So if we have:

$\dot{\theta} = \sqrt{C- 2\cos \theta}$

then dividing through by $\sqrt{C- 2\cos \theta}$ gives

$\frac{1}{\sqrt{C- 2 \cos \theta}} \, \dot{\theta} = 1$

and then integrating wrt $t$:

$\int \frac{1}{\sqrt{C- 2\cos \theta}} \, \dot{\theta} \, \mathrm{d}t = \int \mathrm{d}t$

$\Leftrightarrow \int \frac{1}{\sqrt{C- 2 \cos \theta}} \, \mathrm{d}\theta = \int \mathrm{d}t$ by the chain rule, as before.

Evaluating the RHS is easy as you get $t + D$ where $D$ is the constant of integration.

Mathematically there is a problem here if $C \le 2 \cos \theta$ !

Finally I'll deal with the application you have in mind.

For this application your equation should actually be

$\ddot{\theta} + \sin \theta = 0$.

The simple pendulum you have in mind means that at $t=0$, $\dot{\theta} =0$ and $\theta= \theta_0$ so for this corrected equation you have:

$\dot{\theta}^2 - 2 \cos \theta = C \Rightarrow C= -2 \cos \theta_0$

$\dot{\theta}^2 = 2 (\cos \theta -\cos \theta_0 )$

so the final integral becomes:

$\int \frac{1}{\sqrt{\cos \theta - \cos \theta_0 } } \, \mathrm{d}\theta = \sqrt{2} t + D$ (*).

Now if you look in a book such as "Mathematical methods for physicists" by Arfken and Weber (p. 354 in the fifth edition) they briefly discuss how this is related to the Elliptic integral of the first kind and give a power series in terms of $\sin \theta_0 /2$ for the time period $T$.

But ofcourse what you want is an explicit relation of $\theta$ in terms of $t$. Now no matter how you look at this your solution will involve a power series which you'll have to truncate and so it will still be a numerical solution like the one you found from time stepping.

I should point out that there's no difference here to the situation where the solution is say a sine function as, on a computer, these are also numerically solved for. The only difference is accessibility to sine functions is much more so than to elliptic functions. I doubt whether excel even has an elliptic function!

So before you go ahead this is only useful as a check to your numerical method by what is essentially another numerical method (with a little analysis thrown in at the start). So it is still of value as further proof that you solution is correct.

If you still want to continue down this route then you can either expand the integrand of (*) using a binomial expansion and integrate term by term (find the pattern) to $t$ in terms of a power series in $\theta$ or you can express $\theta$ in terms of a fourier expansion in terms of $t$ and then integrate twice to get $\theta$ in terms of a power series in terms of $t$ (trigonometric functions). Either way there's alot of hard work!

Now, beyond this I'll refer you to the link

http://en.wikipedia.org/wiki/Pendulum_(mathematics)

and the reference therein by Baker & Blackburn (OUP) as it may have more info.

6. Find "Introduction to Nonlinear Differential and Integral Equation" by Harold Davis. He explains in detail, the solution to the non-linear pendulum in terms of elliptic function.

One more: "Perspectives of non-linear Dynamics" by E. Atlee Jackson. This is also a very nice book about non-linear dynamics, catastrophe theory, bifurcations, chaos, critical points . . . makes the world go round but I digress.