How to rearrange a second order differential equation? How would I go about rearranging a second order ODE?
For instance if I wanted to rearrange the below for $\theta$ how would I go about it?
$$\ddot{\theta}+\frac{g}{l}\sin \theta=0$$
 A: I assume by $\ddot\theta=\dfrac{d^2\theta}{dt^2}$. 
I such cases, we introduce a new parameter like $p$ such that $p=\dfrac{d\theta}{dt}$, then
$$\ddot\theta=\frac{d^2\theta}{dt^2}=\frac{d}{dt}(\dfrac{d\theta}{dt})=\frac{dp}{dt}=\frac{dp}{d\theta}\frac{d\theta}{dt}=p\frac{dp}{d\theta}$$
thus your equation turns to
$$p\frac{dp}{d\theta}+\frac{g}{l}\sin\theta=0$$
This is a separable equation:
$$pdp=(-\frac{g}{l}\sin\theta) d\theta$$
which can be solved easily noting that $p=\dot\theta$. 
A: The above equation can be solved in the limit $\theta\to 0$. In taht case we can write $\sin\theta\approx\theta$, and the equation becomes $$\ddot\theta+\frac gl \theta=0$$
A: Of course the equation
$\ddot \theta + \dfrac{g}{l}\sin \theta \tag 1$
gives way to many different rearrangements with many different ends; if the goal is to come as close as possible to finding a solution $\theta(t)$, then the following "rearrangement" may be invoked:
we multiply (1) by $\dot \theta$ to obtain
$\dot \theta \ddot \theta + \dfrac{g}{l}\sin \theta \; \dot \theta;  \tag 2$
next we observe that
$\dot \theta \ddot \theta = \dfrac{1}{2} \dfrac{d}{dt}\dot \theta^2, \tag 3$
and
$\sin \theta \; \dot \theta = -\dfrac{d}{dt}\cos \theta; \tag 4$
thus, (2) may be written
$\dfrac{1}{2}\dfrac{d}{dt}\dot \theta^2 - \dfrac{g}{l}\dfrac{d}{dt}\cos \theta = 0, \tag 5$
that is,
$\dfrac{d}{dt} \left (\dfrac{1}{2}\dot \theta^2 - \dfrac{g}{l} \cos \theta \right ) = 0, \tag 6$
which implies that
$\dfrac{1}{2}\dot \theta^2 - \dfrac{g}{l}\cos \theta = E, \; \text{a constant}; \tag 7$
we may evaluate $E$ in terms of $\dot \theta(t_0)$ and $\cos \theta(t_0)$ for some $t_0$:
$E = \dfrac{1}{2}\dot \theta^2(t_0) - \dfrac{g}{l}\cos \theta(t_0); \tag 8$
then (7) becomes
$\dfrac{1}{2}\dot \theta^2 - \dfrac{g}{l}\cos \theta = \dfrac{1}{2}\dot \theta^2(t_0) - \dfrac{g}{l}\cos \theta(t_0); \tag 9$
further rearrangement yields an expression for $\dot \theta$:
$\dot \theta^2 = \dfrac{2g}{l}\cos \theta - \dfrac{2g}{l}\cos \theta(t_0) + \dot \theta^2(t_0),\tag{10}$
whence
$\dot \theta(t) = \pm \sqrt {\dfrac{2g}{l}\cos \theta(t) - \dfrac{2g}{l}\cos \theta(t_0) + \dot \theta^2(t_0)}; \tag{11}$
this equation (11), or variants thereof, may in fact be integrated to produce an exact solution for $\theta(t)$, though the process is more complicated than merits reproduction here.  The curious and engaged reader may however have a look at
A. Belendez1, C. Pascual, D.I. Mendez, T. Belendez and C. Neipp, Exact solution for the nonlinear pendulum, Revista Brasileira de Ensino de Fisica, v. 29, n. 4, p. 645-648, (2007), www.sb¯sica.org.br
to see the solution presented in detail.
It will be observed that the (partial) solution presented by Qurultay in his/her answer does not in fact take things further than the equivalent of (2), (5), (6) so the assertion made there that the equation may be "easily solved" should perhaps be taken with a grain of salt, especially in light of the results in the paper cited here.
It is well known that the period of the pendulum may be expressed in terms of certain elliptic integrals; see this wikipedia entry.
Finally, a more general second order ODE of the form
$\ddot y = F(y, \dot y, t) \tag{12}$ 
may undergo transformations similar to (2)-(6); we have
$\dot y \ddot y = F(y, \dot y, t) \dot y, \tag{13}$
which leads to
$\dfrac{d}{dt}\dot y^2 = F(y, \dot y, t) \dot y; \tag{14}$
if in fact $F$ depends only on $y$ then we have
$\dfrac{d}{dt}\dot y^2 = F(y) \dot y, \tag{15}$
and defining
$G(y)= \displaystyle \int_{y_0}^y F(s) \; ds \tag{16}$
it follows that
$\dfrac{dG(y)}{dt} = F(y) \dot y, \tag{17}$
and (15) may be written
$\dfrac{d}{dt}\dot y^2 = \dfrac{dG(y)}{dt}; \tag{18}$
or
$\dfrac{d}{dt} (\dot y^2 - G(y)) = 0, \tag{19}$
whence
$\dot y^2 - G(y) = H, \; \text{a constant}, \tag{20}$
and as before
$H = y^2(t_0) - G(y(t_0)), \tag{21}$
so that
$\dot y = \pm \sqrt{G(y) - G(y(t_0)) + y^2(t_0)}.  \tag{22}$
Of course in the more general situation (14) such simplification may not be possible, and one might have to proceed on a case-by-case basis.
