I have to draw the graph of the period of the simple pendulum as a function of the energy $e$.
The equation of motion is $\ddot x= \sin(x)$. So I wrote the integral relating the energy with the period, which is
$T(e)=\int_{x_-}^{x^+} \frac{dx}{\sqrt{2(e-V(x))}}$
where the extrema are the inversion points of the periodic orbits and $V(x)=\cos(x)$ is the potential of the system.
I can see that $T(e)$ tends to zero as $e$ goes to infinity, but I don't know how to manage the singularities at the critical points of the potential energy
From
$$ \ddot x = \sin x\Rightarrow \ddot x \dot x = \sin x\dot x\Rightarrow \frac 12 \dot x^2 = -\cos x + E $$
$$ dt = \frac{dx}{\sqrt{2(E-\cos x)}}\Rightarrow t(E) = \int_{\arccos E}^{2\pi-\arccos E}\frac{dx}{\sqrt{2(E-\cos x)}}-\pi $$
So the graphics for $E \times t$ is something like