# Solve $\theta''+g\sin(\theta)=0$

I encountered the following differential equation when I tried to derive the equation of motion of a simple pendulum:

$\frac{\mathrm d^2 \theta}{\mathrm dt^2}+g\sin\theta=0$

How can I solve the above equation?

-
The solution involves Jacobi's elliptic function "sn". There is a (very sketchy) description of how to integrate the equation at mai.liu.se/~halun/complex/elliptic. –  Hans Lundmark Feb 1 '12 at 15:22
you can solve a small angle approximation by assuming $\sin\theta\approx\theta$ –  yoyo Feb 1 '12 at 15:24
@yoyo Can't it be done without the small angle approximation? I wanted to derive a general equation for all cases. Anyways I don't know how to solve even with the approximation, so it'll be helpful even if you explain that method. –  Green Noob Feb 1 '12 at 15:31

Use substitution : $\theta' =v$ ,therefore we have that :

$$\theta''=\frac{dv}{dt}\cdot \frac{dt}{d\theta}\cdot \frac{d\theta}{dt} \Rightarrow \theta''=\frac{dv}{d\theta}\cdot v \Rightarrow \theta''=v'\cdot v$$

where $v$ is function in terms of variable $\theta$ .So differential equation becomes :

$v' \cdot v +g \cdot \sin \theta=0$

which is separable differential equation .

-
Can you explain how it is in separable form? I'm a beginner so please bear with me.. –  Green Noob Feb 1 '12 at 15:45
$\int v\,dv=-g\cdot \int \sin \theta \,d\theta$ –  pedja Feb 1 '12 at 15:48
Thanks. Seems obvious now that you have shown it. –  Green Noob Feb 1 '12 at 15:54
then you have to integrate something like $$\frac{\theta'}{\sqrt{2g\cos\theta+C}}?$$ –  yoyo Feb 1 '12 at 16:07
@GreenNoob: Writing $\cos\theta=1-2\sin^2(\theta/2)$ reveals that it's an elliptic integral, so it can't be done with elementary functions. When you integrate, $t$ will be an elliptic integral of $\theta$, and inverting that relation gives $\theta$ as an elliptic function of $t$. (Elliptic functions are by definition inverses of elliptic integrals, similar to how one can define the sine function as the inverse of the arcsin integral $\int_0^x \frac{ds}{\sqrt{1-s^2}}$.) –  Hans Lundmark Feb 2 '12 at 7:19

Start with $$\frac{1}{2}\frac{\mathrm{d}\dot{\theta}^{2}}{\mathrm{d}\theta} = \dot{\theta}\frac{\mathrm{d}\dot{\theta}}{\mathrm{d}\theta} = \frac{\mathrm{d}\theta}{\mathrm{d}t}\frac{\mathrm{d}\dot{\theta}}{\mathrm{d}\theta} = \frac{\mathrm{d}\dot{\theta}}{\mathrm{d}t} = \ddot{\theta}$$ Then your equation becomes $$\frac{1}{2}\frac{\mathrm{d}\dot{\theta}^{2}}{\mathrm{d}\theta} = -\frac{g}{\ell}\sin(\theta)$$ or $$\mathrm{d}\dot{\theta}^{2} = -\frac{2g}{\ell}\mathrm{d}\sin(\theta) \implies \dot{\theta}^{2} = \frac{2g}{\ell}\cos(\theta) + c_{1}$$ It's a bit easier if we assume initial conditions, say $\dot{\theta}(t_{0}) = \dot{\theta}_{0}$ and $\theta(t_{0}) = \theta_{0}$, so that $$\dot{\theta}^{2} = \frac{2g}{\ell}\left[\cos(\theta)- \cos(\theta_{0}) + \frac{\ell\dot{\theta}_{0}^{2}}{2g} \right]$$ Then $$\frac{\mathrm{d}\theta}{\mathrm{d}t} = \sqrt{ \frac{2g}{\ell}}\sqrt{\cos(\theta) - \cos(\theta_{0}) + \frac{\ell\dot{\theta}_{0}^{2}}{2g} }$$ so that $$\mathrm{d}t = \sqrt{\frac{\ell}{2g}}\frac{\mathrm{d}\theta}{ \sqrt{\cos(\theta) - \cos(\theta_{0}) + \frac{\ell\dot{\theta}_{0}^{2}}{2g}}}$$ or $$t_{f} - t_{0} = \sqrt{\frac{\ell}{2g}}\int_{\theta_{0}}^{\theta_{f}}\frac{\mathrm{d}\theta}{ \sqrt{\cos(\theta) - \cos(\theta_{0}) + \frac{\ell\dot{\theta}_{0}^{2}}{2g}}}$$ This equation is of the form $t = f(\theta)$. Your solution is given by $\theta = f^{-1}(t)$. That's about as much as you need to know, since it's more efficient to just solve the original equation numerically.

If you really need a closed form for $f$, Mathematica will give you one, in terms of the function EllipticF.

-

replacing $\sin\theta$ by $\theta$ (physically assuming small angle deflection) gives you a homogeneous second order linear differential equation with constant coefficients, whose general solution can be found in most introductory diff eq texts (or a google search). this new equation represents a simple harmonic oscillator (acceleration proportional to displacement, like a spring force). $$\theta''+g\theta=0$$ has solutions $A\cos(\sqrt{g}t)+B\sin(\sqrt{g}t)$. so, for example, if the initial displacement is $\theta_0$ and initial angular velocity is $0$ then the solution is $$\theta_0\cos(\sqrt{g}t)$$

-
This doesn't exactly answer the question since this is just for an approximation to the original differential equation. –  Garrett Jun 8 '14 at 23:49