# When to jump off a swing?

First draft, July 5th, 2015

It turns out that this problem has already been considered, and a paper (containing pretty-pretty graphs) was published on the arXiv, by Hiroyuki Shima, on August 21st, 2012. Better luck for me next time.

## Introduction

Alice an Bob are having a competition: they both swing on identical swings, and at some point in swings' swing, the two swingers swing themselves off. The winner is the one who landed farther on the ground. The obvious question is what is the optimal point to jump off, so as to reach farthest.

The trivial answer is to increase the swing's amplitude to a right angle, $$A = ⦜ \approx 1.5708$$, and then jump when $$\alpha = \frac{1}{2} ⦜ = \frac{1}{8} \tau = 45°$$. This answer is based on the intuition that at this angle, we have a good balance between the horizontal velocity, which takes the competitors farther, and the vertical velocity, which increases their airborne time. It is the same answer as in the case of shooting a cannon ball to the largest possible distance.

This answer is, in fact, wrong. It ignores two basic facts in which this question differs from the cannon ball question: first, the initial velocity is dependent on the angle at which you jump (so you should jump at a lower angle, where your speed is higher). Second, the initial position is also dependent on the angle (so you should jump at a higher angle, for more head-start). Consequently, a more detailed analysis of the mechanics of the problem is in order.

## The basic parameters

The swing is suspended at height $$h$$ above ground, by a rope of length $$L$$. This puts the axis at height $$\ell = L + h$$ above ground. We assume a uniform gravitational field, pulling downward at constant force $$g$$. The swing's amplitude is some angle $$0 \lt A \le ⦜$$, and the swinger jumps off at angle $$-A \le \alpha \le A$$, measured relative to the vertical (rest) position. We will soon see that $$0 \lt \alpha \lt A = ⦜$$.

We denote by $$v$$ the initial velocity at the time of jump, and by $$v_v, v_h$$ the vertical and horizontal components, respectively. We also denote by $$t_e$$ the time elapsed from jumping off the swing until the landing. It is clear that the location of the landing is (taking into account the headstart) $\Delta = L \sin \alpha + v_h \cdot t_e$

We now compute the velocity: at the highest point of the oscillation, all the energy of the system is potential: $E = mg (h + L - L \cos A)$ and by conservation of energy, this is equal to the energy at take-off, $E = mg (h + L - L \cos \alpha) + \frac{1}{2} m v^2$ which gives $v^2 = 2gL(\cos \alpha - \cos A)$

It is easy to check that the vertical and horizontal components are \left\{ \begin{aligned} v_v &= |v| \sin \alpha \\ v_h &= |v| \cos \alpha \end{aligned} \right. so both increase as $$|v|$$ increases, which happens as $$\cos A$$ decreases, and therefore it is optimal to take $$A = ⦜, \cos A = 0$$. Now \left\{ \begin{aligned} v_v &= |v| \sin \alpha = \sqrt{2gL} \sqrt{\cos \alpha} \sin \alpha \\ v_h &= |v| \cos \alpha = \sqrt{2gL} \sqrt{\cos \alpha} \cos \alpha \end{aligned} \right.

How long until the landing? The initial height is $$H_0 = h + L - L \cos \alpha$$, and using the initial vertical velocity and constant gravity, the height at time $$t$$ is $H(t) = -\frac{1}{2} g t^2 + v_v \cdot t + H_0$ so \begin{align*} t_e &= \frac{-v_v \pm \sqrt{v_v^2 + 2g H_0}}{-g} = \frac{v_v \mp \sqrt{v_v^2 + 2g H_0}}{g} \overset{t_e \gt 0}{=} \frac{v_v + \sqrt{v_v^2 + 2g H_0}}{g} = \\ &= \frac{\sqrt{2gL} \sqrt{\cos \alpha} \sin \alpha + \sqrt{2gL \cos \alpha (\sin \alpha)^2 + 2g(h + L - L \cos \alpha)}}{g} = \\ &= \sqrt{\frac{2L}{g}} \left(\sqrt{\cos \alpha} \sin \alpha + \sqrt{\cos \alpha (\sin \alpha)^2 + 1 - \cos \alpha + \frac{h}{L}}\right) \end{align*} and therefore the swinger lands at \begin{align*} \Delta &= L \sin \alpha + v_h \cdot t_e = \\ &= L \sin \alpha + 2L \sqrt{\cos \alpha} \cos \alpha \cdot \left(\sqrt{\cos \alpha} \sin \alpha + \sqrt{\cos \alpha (\sin \alpha)^2 + 1 - \cos \alpha + \frac{h}{L}}\right) = \\ &= L \left( \sin \alpha + 2 (\cos \alpha)^2 \sin \alpha + 2 \cdot \sqrt{(\cos \alpha)^4 (\sin \alpha)^2 + (\cos \alpha)^3 - (\cos \alpha)^4 + \frac{h}{L} (\cos \alpha)^3} \right) = \\ &= L \left( \sin \alpha + 2 (\cos \alpha)^2 \sin \alpha + 2 \cdot \sqrt{\frac{\ell}{L} \cdot (\cos \alpha)^3 - (\cos \alpha)^6} \right) \end{align*}

It is worthwhile to pause here, and point out that neither the mass $$m$$ nor the gravitational constant $$g$$ have any effect on the problem. This is not too surprising for the mass, but is not a trivial fact for the gravitational acceleration. In addition, although the distance $$\Delta$$ is affected by $$L$$, the length of the rope, its critical points, and in particular the angle at which it is maximized, are only affected by the ratio $$\frac{\ell}{L}$$, i.e. this problem is homogeneous — it will have the same solution if we scale everything up by some factor. This can be interpreted to mean that we can select units of measurement in which $$g = m = L = 1$$, which we will do, so $\Delta = \sin \alpha + 2 (\cos \alpha)^2 \sin \alpha + 2 \cdot \sqrt{\ell \cdot (\cos \alpha)^3 - (\cos \alpha)^6}$

## Deriving the critical points

We now look for the critical points of $$\Delta$$: \begin{align*} 0 = \frac{\partial \Delta}{\partial \alpha} &= \cos \alpha - 4 \cos \alpha (\sin \alpha)^2 + 2 (\cos \alpha)^3 + 2 \frac{-3\ell (\cos \alpha)^2 \sin \alpha + 6 (\cos \alpha)^5 \sin \alpha}{2 \cdot \sqrt{\ell \cdot (\cos \alpha)^3 - (\cos \alpha)^6}} = \\ &= \cos \alpha - 4 \cos \alpha (\sin \alpha)^2 + 2 (\cos \alpha)^3 - \frac{3\ell (\cos \alpha)^2 \sin \alpha - 6 (\cos \alpha)^5 \sin \alpha}{\sqrt{\ell \cdot (\cos \alpha)^3 - (\cos \alpha)^6}} = \\ &= \cos \alpha \cdot \left( 1 - 4 (\sin \alpha)^2 + 2 (\cos \alpha)^2 - \frac{3\ell \cos \alpha \sin \alpha - 6 (\cos \alpha)^4 \sin \alpha}{\sqrt{\ell \cdot (\cos \alpha)^3 - (\cos \alpha)^6}} \right) = \\ &= \cos \alpha \cdot \left( 3 (\cos \alpha)^2 - 3 (\sin \alpha)^2 - \frac{3\ell \sin \alpha - 6 (\cos \alpha)^3 \sin \alpha}{\sqrt{\ell \cdot \cos \alpha - (\cos \alpha)^4}} \right) = \\ &= 3 \cos \alpha \cdot \left( (\cos \alpha)^2 - (\sin \alpha)^2 - \frac{\sin \alpha}{\sqrt{\cos \alpha}} \cdot \frac{\ell - 2 (\cos \alpha)^3}{\sqrt{\ell - (\cos \alpha)^3}} \right) = \\ &= 3 \cos \alpha \cdot \left( 2(\cos \alpha)^2 - 1 - \frac{\sin \alpha}{\sqrt{\cos \alpha}} \cdot \frac{\ell - 2 (\cos \alpha)^3}{\sqrt{\ell - (\cos \alpha)^3}} \right) \end{align*}

Since $$|\alpha| \lt ⦜$$, we have $$\cos \alpha \neq 0$$, so we can ignore the factor of $$3 \cos \alpha$$, and write $2(\cos \alpha)^2 - 1 = \frac{\sin \alpha}{\sqrt{\cos \alpha}} \cdot \frac{\ell - 2 (\cos \alpha)^3}{\sqrt{\ell - (\cos \alpha)^3}}$ taking the square of this identity, and denoting $$y = \cos \alpha$$, we get \begin{align*} 4 y^4 - 4 y^2 + 1 &= \frac{1-y^2}{y} \cdot \frac{\ell^2 - 4\ell y^3 + 4 y^6}{\ell - y^3} \\ y (\ell - y^3) (4 y^4 - 4 y^2 + 1) &= (1 - y^2) (\ell^2 - 4\ell y^3 + 4 y^6) \\ 4\ell y^5 - 4\ell y^3 + \ell y - 4 y^8 + 4 y^6 - y^4 &= \ell^2 - 4\ell y^3 + 4 y^6 - \ell^2 y^2 + 4\ell y^5 - 4 y^8 \\ y^4 - \ell^2 y^2 - \ell y + \ell^2 &= 0 \end{align*}

It is easy to see that this equation has the root $$y = \ell$$. This, however, is not a physical solution, as we denoted $$y = \cos \alpha \lt 1 \lt 1 + h = \ell$$. Assuming that $$y \neq \ell$$, we get $y^3 + \ell y^2 - \ell = 0 \qquad (\star)$ The discriminant of this cubic equation is $D = 18abcd - 4 b^3 d + b^2 c^2 - 4a c^3 - 27 a^2 d^2 = 4 \ell^4 - 27 \ell^2 = \ell^2 (4\ell^2 - 27)$ which is negative (and the equation has exactly one real root) when $$\ell \lt \frac{3}{2} \sqrt{3} \approx 2.6$$. This holds for most swings, and we assume this to be the case here as well.

To find the solution, we substitute $$y = z - \frac{\ell}{3}$$, so \begin{align*} 0 = y^3 + \ell y^2 - \ell & = \left(z - \frac{\ell}{3}\right)^3 + \ell \left(z - \frac{\ell}{3}\right)^2 - \ell = \\ &= z^3 - \ell z^2 + \frac{\ell^2}{3} z - \frac{\ell^3}{27} + \ell z^2 - \frac{2 \ell^2}{3} z + \frac{\ell^3}{9} - \ell = \\ &= z^3 - \frac{\ell^2}{3} z + \frac{2 \ell^3}{27} - \ell \end{align*} Using the standard notation, this is $p = -\frac{\ell^2}{3}, q = \frac{2 \ell^3}{27} - \ell$ so $\sqrt{\frac{q^2}{4} + \frac{p^3}{27}} = \sqrt{\frac{\ell^6}{27 \cdot 27} - \frac{\ell^4}{27} + \frac{\ell^2}{4} - \frac{\ell^6}{27 \cdot 27}} = \ell \sqrt{\frac{1}{4} - \frac{\ell^2}{27}}$ and the solution is \begin{align*} z &= \sqrt[3]{-\frac{q}{2} + \sqrt{\frac{q^2}{4} + \frac{p^3}{27}}} + \sqrt[3]{-\frac{q}{2} - \sqrt{\frac{q^2}{4} + \frac{p^3}{27}}} = \\ &= \sqrt[3]{\ell \left(\frac{1}{2} - \frac{\ell^2}{27} + \sqrt{\frac{1}{4} - \frac{\ell^2}{27}}\right)} + \sqrt[3]{\ell \left(\frac{1}{2} - \frac{\ell^2}{27} - \sqrt{\frac{1}{4} - \frac{\ell^2}{27}}\right)} \\ y = z - \frac{\ell}{3} &= \sqrt[3]{\ell \left(\frac{1}{2} - \frac{\ell^2}{27} + \sqrt{\frac{1}{4} - \frac{\ell^2}{27}}\right)} + \sqrt[3]{\ell \left(\frac{1}{2} - \frac{\ell^2}{27} - \sqrt{\frac{1}{4} - \frac{\ell^2}{27}}\right)} - \frac{\ell}{3} \end{align*}

## Special solutions

### Swing low

We take the minimal $$\ell = 1$$, or $$h = 0$$, for a swing just touching the ground. The solution in this case is \begin{align*} \cos \alpha = y &= \frac{1}{3} \left(\sqrt[3]{\frac{25 + 3 \sqrt{69}}{2}} + \sqrt[3]{\frac{25 - 3 \sqrt{69}}{2}} - 1\right) \approx 0.755 \\ \alpha = \cos^{-1} y &\approx 0.715 \approx 0.455 \cdot ⦜ \approx 41° \end{align*}

### The critical $$\ell$$

Consider the case $$\ell = \frac{3}{2} \sqrt{3}$$, then in the equation $$z^3 - \frac{9}{4} z - \frac{3}{4} \sqrt{3} = 0$$ the discriminant is $$D = 0$$, i.e. $$\frac{q^2}{4} + \frac{p^3}{27} = 0$$. We have the simple solution $$z = \sqrt{3}$$ and the double solution $$z = -\frac{\sqrt{3}}{2}$$. These correspond to the simple solution \begin{align*} \cos \alpha = y &= \frac{\sqrt{3}}{2} \\ \alpha = \cos^{-1} y &= \frac{1}{6} \tau = \frac{2}{3} ⦜ = 30° \end{align*} and the double solution $$y = -\sqrt{3} \lt (-1)$$ which is again non-physical. At this point it should be clear that the trivial answer $$\alpha = 45°$$ was wrong.

### An experimentally obtained $$\ell$$

Measurements of a swing in its natural habitat (a playground) yield the quantities $$h \approx 60\,\text{cm}, L \approx 157\,\text{cm}$$, which translate to a value of $$\ell \approx 1.382$$ in equation $$(\star)$$. This gives the solution \begin{align*} \cos \alpha = y &\approx 0.7965 \\ \alpha = \cos^{-1} y &\approx 0.649 \approx 0.413 \cdot ⦜ \approx 37.2° \end{align*}

## Further research

There are still some questions left unanswered:
1. A more detailed analysis of the other real roots when $$\ell \gt \frac{3}{2} \sqrt{3}$$.
2. When $$\ell \gg 1$$, does the optimal $$\alpha$$ tend to $$0$$?
3. Who won? The author hereby proposes establishing an annual international competition, to apply the results obtained above. The author also proposes adding such an event in robotics competitions, in order to illustrate the capabilities of robots in swinging, kinetic perception and real-time optimizations.