Maximum Range of a Potato Gun

One of the middle schoolers built a potato gun for his math class. He was looking a the mathematical relationship between the amount of fuel (hair spray) and the hang-time of the potato. To augment this work, I had my Numerical Methods class do the math and create analytical and numerical models of the projectile motion.

One of the things my students had to figure out was what angle would give the maximum range of the projectile? You can figure this out analytically by finding the function for how the horizontal distance (x) changes as the angle (theta) changes (i.e. x(theta)) and then finding the maximum of the function.

Initial velocity vector (v) and its component vectors in the x and y directions.
Initial velocity vector (v) and its component vectors in the x and y directions for a given angle.

Distance as a function of the angle

In a nutshell, to find the distance traveled by the potato we break its initial velocity into its x and y components (vx and vy), use the y component to find the flight time of the projectile (tf), and then use the vx component to find the distance traveled over the flight time.

Starting with the diagram above we can separate the initial velocity of the potato into its two components using basic trigonometry:

 \cos{\theta} = \frac{v_x}{v}
 \sin{\theta} = \frac{v_y}{v} ,

so,

 v_x = v \cos{\theta} ,
 v_y = v \sin{\theta}

Now we know that the height of a projectile (y) is given by the function:

! y(t) = \frac{a t^2}{2} + v_0 t + y_0

(you can figure this out by assuming that the acceleration due to gravity (a) is constant and acceleration is the second differential of position with respect to time.)

To find the flight time we assume we’re starting with an initial height of zero (y0 = 0), and that the flight ends when the potato hits the ground which is also at zero ((yt = 0), so:

! 0 = \frac{a t^2}{2} + v_0 t + 0

! 0 = \frac{a t^2}{2} + v_0 t

Factoring out t gives:

! 0 = t ( \frac{a t}{2} + v_0)

Looking at the two factors, we can now see that there are two solutions to this problem, which should not be too much of a surprise since the height equation is parabolic (a second order polynomial). The solutions are when:

! t = 0

!  \frac{a t}{2} + v_0 = 0

The first solution is obviously the initial launch time, while the second is going to be the flight time (tf).

!  \frac{a t_f}{2} + v_0 = 0

!  t_f = - \frac{2 v_0}{a}

You might think it’s odd to have a negative in the equation, but remember, the acceleration is negative so it’ll cancel out.

Now since we’re working with the y component of the velocity vector, the initial velocity in this equation (v0) is really just vy:

!   v_0 = v_y

so we can substitute in the trig function for vy to get:

!  t_f = - \frac{2 v  \sin{\theta}}{a}

Our horizontal distance is simply given by the velocity in the x direction (vx) times the flight time:

!  x = v_x t_f

which becomes:

!  x = v_x  \left(- \frac{2 v  \sin{\theta}}{a}\right)

and substituting in the trig function for vx (just to make things look more complicated):

!  x = \left(  v \cos{\theta} \right)  \left(- \frac{2 v  \sin{\theta}}{a}\right)

and factoring out some of the constants gives:

!  x = -\frac{v^2}{a} 2 \sin{\theta}\cos{theta}

Now we have distance as a function of the launch angle.

We can simplify this a little by using the double-angle formula:

!  \sin{2\theta} = 2 \sin{\theta}\cos{theta}

to get:

!  x = -\frac{v^2}{a} \sin{2\theta}

Finding the maximum distance

How do we find the maxima for this function. Sketching the curve should be easy enough, but because we know a little calculus we know that the maximum will occur when the first differential is equal to zero. So we differentiate with respect to the angle to get:

!  \frac{dx}{d\theta} = -\frac{v^2}{a} 2 \cos{2\theta}

and set the differential equal to zero:

!  0 = -\frac{v^2}{a} 2 \cos{2\theta}

and solve to get:

!  \cos{2\theta}  = 0

!  2\theta  = \cos^{-1}{(0)}

Since we remember that the arccosine of 0 is 90 degrees:

!  2\theta  = 90^{\circ}

!  \theta  = 45^{\circ}

And thus we’ve found the angle that gives the maximum launch distance for a potato gun.