I recently discovered how to write equations in my Hugo website using Mathjax (credit goes to kunlei for the instructions!). In order to demonstrate the awesomeness of this tool (and also to refresh my memory on basic Physics concepts I have not used in a long time), let me demonstrate why 45 degrees is the ideal angle to throw something at maximum range.

The Problem

Prove that the angle at which an object must be thrown to maximize distance is $45^{o}$, assuming there is no air resistance.

The Solution

Let’s use a referential where the $x$ axis is parallel to the ground and $y$ axis is perpendicular to the ground, what we want to maximize is the function $x(\theta)$, i.e. the distance travelled by our object as a function of the angle at which we throw it. Let’s define $\theta$ as the angle we throw the object with respect to the $y$ axis.

Intuitively, we know that an object thrown with $\theta=0$ wouldn’t travel any distance because it would reach the ground immediately (if thrown from the ground, e.g. by a cannon). Similarly, we know that throwing an object with $\theta=90$ would have the same result: the object would go up in the air, and in the absence of wind, would fall back exactly from where it left the ground initially. Thus, the angle that maximizes the distance ($\theta_m$) is an angle between 0 and 90.

Naively, we can assume the $x(\theta)$ function looks a little something like this:

The travelled distance $x$ as a function of the angle $\theta$. This is not an exact plot, but it roughly matches my experience when throwing things at various angles.

Because the thrown object moves in a fluid motion that follows the laws of kinematics, it is reasonable to expect that $\theta_m$ is found exactly where the derivative of $x(\theta)$ becomes 0, that is to say $\frac{dx}{d\theta}=0$.

So, our game plan is to find the equation of $x(\theta)$ and find which value of $\theta$ makes $\frac{dx}{d\theta}=0$.

A well known equation of kinematics is $d=v_i\Delta t + \frac{1}{2}a\Delta t^2$, where:

  • $d$ is distance
  • $v_i$ is the initial velocity
  • $a$ is the constant acceleration
  • $\Delta t$ is the time elapsed

When applied to the movement of our thrown object over the $x$ axis, this becomes

$$ x=v_{ix}\Delta t + \frac{1}{2} a_x \Delta t^2$$ $$ \Leftrightarrow x= v_{ix}\Delta t \quad \text{because $a_x$ = 0, no air resistance!}$$

By expressing the velocity in terms of $x$ and $y$ components,

we can re-express $x$ as

$$ x = v\cos\theta\Delta t $$

Ah ha! We are starting to unfold how $x$ is dependent of $\theta$ explicitly. However, inside $\Delta t$, there is a hidden dependency on $\theta$. Indeed, you can imagine, if we throw an object at $\theta=0$, its airborne time will be much shorter than if we throw it with the same strength at the sky at $\theta=90^{o}$. Thus, the time of flight is dependent on the angle at which we throw the ball (makes sense).

What is the expression for $\Delta t (\theta)$?

Let’s use the kinematics equation in the $y$ axis to get some insight.

$$ \Delta y = v_{iy}\Delta t+\frac{1}{2}a_y\Delta t^2$$

Because we throw the object from a flat plane and we suppose it falls at the same height from which it was launched (i.e. $\Delta y = 0$), we get

$$ 0 = v_{iy}\Delta t + \frac{1}{2}a_y\Delta t^2$$ $$ 0 = v\sin\theta\Delta t+\frac{a_y}{2}\Delta t^2 $$ $$ 0 = \Delta t(v\sin\theta + \frac{a_y}{2}\Delta t) \quad \text{(here we divide by $\Delta t \neq 0$)}$$ $$ 0 = v\sin\theta + \frac{a_y}{2}\Delta t $$ $$ \Leftrightarrow \Delta t = \frac{-2v\sin\theta}{a_y}$$

Hurray, we found our equation for $\Delta t (\theta)$, it is $\Delta t(\theta) = \frac{-2v\sin\theta}{a_y}$

We can thus substitute this value in the earlier equation we found for $x(\theta)$:

$$ x(\theta)=v\cos\theta\Delta t(\theta) = v\cos\theta\left(\frac{-2v\sin\theta}{a_y}\right) = \frac{-2v^2\cos\theta\sin\theta}{a_y}$$

Let us derivate this equation (here is a cheatsheet for derivation rules if this step seems unclear ):

$$ \frac{dx}{d\theta} = \frac{-2v^2}{a_y}\left(-\sin^2\theta+\cos^2\theta\right) = \frac{2v^2}{a_y}\left(\sin^2\theta-\cos^2\theta\right) $$

We are interested in finding $\theta_m$ for which $\frac{dx}{d\theta}=0$. In other words,

$$ \frac{dx}{d\theta} = 0 = \frac{2v^2}{a_y}\left(\sin^2\theta_m-\cos^2\theta_m\right)$$ $$ \Leftrightarrow \sin^2\theta_m = \cos^2\theta_m $$ $$ \Leftrightarrow \frac{\sin^2\theta_m}{\cos^2\theta_m} = 1 $$ $$ \Leftrightarrow \frac{\sin\theta_m}{\cos\theta_m} = \tan\theta_m = 1 $$ $$ \Leftrightarrow \theta_m = \arctan(1) = \frac{\pi}{4} = 45^o \quad\blacksquare$$

And there we have it, proof that the angle that maximizes the distance travelled by a thrown object is $\theta_m = 45^o$.


This was a fun trip down memory lane for me. I might do this again sometime! As you can see, Mathjax is very good at rendering equations in HTML. Let me know if you found this interesting (maybe you’re a LaTeX user, or maybe you’re learning physics/maths). 😃