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?
 A: 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 .
A: 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.
A: 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)
$$
