Angle of a pendulum as an explicit function of time What would be the solution for the angle $\varphi(t)$ and angular speed $\omega(t)$ on pendulum without the small angle approximation - not as differential, but as an explicit function of time?

The pendulum starts at angle $\theta_i$ with the arbitraty initial angular velocity $\omega_i$. What is the speed after time $t$ in the form of
$$\varphi(t) = f(t, \theta_0, \omega_0)$$
when the angle is arbitrarily high, or even at a looping pendulum?
 A: The differential equation to start with is
$$\ddot{\varphi}(t) = -\frac{g}{r}\sin(\varphi(t)) ~ , ~ \dot{\varphi}(0) = -\omega_0  ~ , ~ \varphi(0) = \theta_0 $$
where $\varphi$ is the angle of the pendulum, $\omega_0$ the initial angular velocity and $\theta_0$ the initial angle. The angles are aligned to have 0° on the bottom, 90° at the right, 180° at the top at -90° al the left.
The function for the angular velocity $\omega$ as a function of the angle $\varphi$ is then
$$\omega(\varphi, \theta_0, \omega_0) = \sqrt{\frac{2 g\cdot (\cos (\varphi )-\cos (\theta_0))}{r} +\omega_0^2}$$
and the integral of the inverse is then the time elapsed as a function of the angle:
$$t(\varphi, \theta_0,\omega_0)= \int_{\varphi }^{\theta_0} \frac{ \text{ d}\theta}{\omega(\theta, \theta_0, \omega_0)}$$
To get a stable integral we have to set $\theta_0$ to $\pi$, so we assume that the pendulum in question will have enough energy to make a whole revolution and $\pi$ will be covered on the path. The solution we get in the end will also be valid for smaller and zero initial velocities, as we will see later.
Because we still want to start from an arbitrary position and with an arbitrary velocity we define our true initial velocity as $\omega_i$ and the $\omega_0$ at amplitude $\pi$ as a function of $\omega_i$:
$$\omega_0 = \sqrt{\frac{-2 g\cdot \cos (\theta_i )-2 g+r \cdot \omega_i^2}{r}}$$
Now we expand the equation to get the time as a function of angle $\varphi$, initial angle $\theta_i$ and intial velocity $\omega_i$:
$$t(\varphi, \theta_i,\omega_i)= \int_{\varphi }^{\theta_i} \sqrt[-2]{\frac{2 g\cdot (\cos (\theta )+1)}{r} +\frac{-2 g\cdot \cos (\theta_i )-2 g+r \cdot \omega_i^2}{r}} \text{ d}\theta$$
To get the angle as a function of time instead the time as a function of the angle we first define
$$\kappa = 2 g\cdot \cos (\varphi )+r\cdot \omega_i^2-2 g\cdot \cos (\theta_i) ~ \text{ , } ~ \xi = 2 g+r\cdot \omega_i^2-2 g\cdot \cos (\theta_i)$$
and transform the integral to the elliptic form (which gives us a division by zero at $\omega_i=0$):
$$t(\varphi , \theta_i, \omega_i)=\frac{2 \sqrt{\frac{r\cdot \omega_i^2}{\xi}} \cdot \text{F}(\frac{\theta_i}{2}|\frac{4 g}{\xi} )}{\omega_i}-\frac{2 \sqrt{\frac{\kappa}{\xi}}\cdot \text{F}(\frac{\varphi }{2}|\frac{4 g}{\xi} )}{\sqrt{\frac{\kappa}{r}}}$$
which can now be inverted, and the division by zero at $\omega_i=0$ disappears:
$$\varphi(t, \theta_i,\omega_i)= 2 \text{ Am}(\frac{2 r \cdot \text{F}(\frac{\theta_i}{2}|\frac{4 g}{\xi})-\sqrt{r} \cdot t \cdot \sqrt{\xi}}{2 r}|\frac{4 g}{\xi})$$
Now we have an explicit formula for the angle as a function of time and the arbitrary initial angle and initial velocity. The first time derivative of the angle, the angular velocity as a function of time is then
$$\omega(t, \theta_i,\omega_i) = \frac{\sqrt{\xi}\cdot \text{Dn}(\frac{2 r \cdot \text{F}(\frac{\theta_i}{2}|\frac{4 g}{\xi})-\sqrt{r}\cdot t\cdot \sqrt{\xi}}{2 r}|\frac{4 g}{\xi})}{\sqrt{r}}$$
which also holds for zero and greater than zero initial velocities and all starting angles.
$\text{Am}()$ is the Jacobi Amplitude, $\text{Dn}()$ the Jacobi Elliptic Function and $\text{F}()$ the Elliptic Integral of the 1. kind.
This needs about 1/6th of the computing time a regular differential would take.
If the inital velocity should be negative (counterclockwise) one would need to flip the x-axis, since situation A and B are in principle equivalent:

The result is the same as with the brute force differential, but can be achieved with less CPU time with the same precision goal:
Brute force differential:

Explicit function:

Plot 1

Plot 2

more details
A: You can predict that as the initial angle of deflection increases so does the period: Look at the special case for a bob held by a stiff wire, when the angle is exactly $180^0$ then the bob will remain in the upright position for ever (ignoring any small perturbations). Continuity suggests that as the initial angle of deflection increases so does the period.
