Angle Maximizing the Distance of a Projectile

Consider what path is traced out by the projectile in the 2d velocity space (horizontal velocity x-axis; horizontal is "after rotating up so the ground is flat, gravity no longer vertical"). It starts somewhere on a circular arc, and thereafter follows a path 'down and to the right' at an angle $\phi$ to the vertical, at constant speed (corresponding to strength of g). Trace the line until it reaches the horizontal. This forms a triangle along with the origin.

The total distance travelled is just (total time in air)x(speed at max height), which is just proportional to the area of the triangle for fixed $\phi$. Possible initial angles give a family of triangles, with one side of fixed length and the opposite angle also fixed ($\pi/2 - \phi$); thus they fit in a circle and the maximum is clearly when the triangle is isosceles.

Added 11/24/2012

Here is a slightly more detailed solution along with a picture. This was written up by Davidac897 with the aid of Barry Cipra's writeup of ChrisJB's solution. (source)

If you rotate the system so the ground is flat, you'll be firing at angle $\theta' = \theta + \phi$ into a medium where gravity points down and to the right at angle $\phi$. Therefore

In the velocity plane, the trajectory starts at $P$ and follows a straight line at angle $\pi/2 - \phi$ to the $v_x$ axis, through a point $Q$ on the $v_x$ axis, down to a point $P'$ with $v_y$ coordinate the negative of that of $P$ (this is true if we fire in a non-rotated frame, and the only difference here is that there is an extra force component in the $x$-direction).

In particular $\angle QOP = \theta' = \theta+\phi$, $\angle PQO = \frac{\pi}{2}-\phi$, and the segments intersect at $R$ in a right angle, where $\overline{QR}$ is the horizontal in the non-rotated frame. Then $OQ$ is the average horizontal speed of the projectile, and $OA$ is proportional to the total time in the area because it is half the total change in vertical velocity. Therefore, the area of the triangle, which is $\frac{(OQ)(OA)}{2}$, is proportional to the total distance traveled.

As remarked above, $OP$ is fixed, as is $\angle PQO$, and the area is maximized when $Q$ is the apex of an isosceles triangle, so $2 \angle QOP + \angle PQO = 2\theta + 2 \phi + \frac{\pi}{2}-\phi = \pi$, or $$\theta = \frac{\pi}{4}-\frac{\phi}{2}.$$


Added 11/23/12: ChrisJB has given a really wonderful answer that avoids both derivatives and trigonemetric identities by considering geometry not in the (rotated) $xy$ plane but in the (rotated) $v_xv_y$ plane. It took me a while to understand why, in that answer, the distance traveled is proportional to the area of a triangle rather than a trapezoid, so I'm appending below my own original answer a slightly longwinded version of ChrisJB's, for the benefit of others who are as slow as I am. Credit (and upvotes) for it, however, should go entirely to ChrisJB. (You can skip now straight to the bottom.)

Here's something that at least avoids taking derivatives.

Let's start with a warm-up on flat ground. If you fire a projectile with vertical velocity $v_y$ and horizontal velocity $v_x$, the amount of time it spends in the air is $T=2v_y/g$ and the distance it travels is $D=v_xT$. As a function of firing angle $\theta$, we have $v_y=v_0\sin\theta$ and $v_x=v_0\cos\theta$. Setting $v_0=g=1$ to clean out the clutter, we have

$$D=2\sin\theta\cos\theta = \sin(2\theta),$$

which is clearly maximized, taking the value $1$, when $\theta = \pi/4$.

Now suppose the ground slopes down at angle $\phi$. Let's rotate it up flat, and imagine firing at angle $\theta' = \theta + \phi$. (We're not taking derivatives, so there should be no confusion in using the notation $\theta'$.) The obvious problem is, gravity no longer points straight down. Instead it has a vertical component $g_y = g\cos\phi$, pointing down, and a horizontal component $g_x = g\sin\phi$, pointing to the right. In terms of their effect, the vertical component $g_y$ is a new (and reduced) gravity, while the horizontal component $g_x$ acts as a kind of additional magnetic force on the projectile, accelerating it in the $x$ direction. Thus the amount of time a projectile fired with vertical velocity $v_y$ spends in the air is $T=2v_y/g_y$, much as before, while the horizontal (actually downhill) distance it travels is now

$$D = v_xT + {1\over2}g_xT^2 = 2v_y(v_xg_y + v_yg_x)/g_y^2.$$

We have $v_y = v_0\cos\theta'$ and $v_x = v_0\sin\theta'$. In this case it's convenient to adopt the clutter-cleaning convention $v_0 = \cos\phi$, which leaves us with

$$D=2\sin\theta'(\cos\theta'\cos\phi + \sin\theta'\sin\phi)=2\sin\theta'\cos(\theta'-\phi),$$

using the angle addition formula $\cos(x-y) = \cos x \cos y + \sin x \sin y$. The formula $2\sin x\cos y = \sin(x+y)+\sin(x-y)$ turns this into

$$D = \sin(2\theta'-\phi) + \sin\phi = \sin(2\theta + \phi) + \sin\phi,$$

which this time is maximized, taking the value $1+\sin\phi$, when $2\theta+\phi = \pi/2$, which is to say, when $\theta = \pi/4 - \phi/2$.

Added 11/15/12: Oops, I just fixed a minor mistake: the correct clutter-cleaning convention is $v_0 = \cos\phi$, not $\sin\phi$. I should have realized this right away from the fact that it needs to agree with the flat-ground convention, $v_0=1$, when $\phi=0$. (I had elsewhere kept my sines and cosines straight using, for example, the fact that $g_x$ should be negligible for $\phi\approx0$.) The full factor in $D$ that begs to be set equal to $1$ is $v_0^2/g\cos^2\phi$. If you stick with the convention $v_0=g=1$, you find that the maximum downhill distance, as a function of $\phi$ is

$$D_\max = \sec^2\phi+\sec\phi\tan\phi,$$

whose horizontal component is

$$H_\max = D_\max \cos\phi = \sec\phi + \tan\phi.$$

Added 11/23/12: This is my longwinded version of ChrisJB's answer.

If you rotate the system so the ground is flat, you'll be firing at angle $\theta' = \theta + \phi$ into a medium where gravity points down and to the right at angle $\phi$. In the velocity plane, the trajectory starts at $P=(v_0\cos\theta', v_0\sin\theta')$ and follows a straight line at angle $\pi/2 - \phi$ to the $v_x$ axis, through a point $Q$ on the $v_x$ axis, down to a point $P'$ with $v_y$ coordinate $-v_0\sin\theta'$. (It's easy enough to work out the $v_x$ coordinates of $Q$ and $P'$, but it's unnecessary to do so.) Denoting points $A=(0,v_0\sin\theta')$ and $A'=(0,-v_0\sin\theta')$ on the $v_y$ axis, we find that the total (downhill) distance traveled by the projectile is proportional to the area of the trapezoid $APP'A'$. (This is because, for a given $\phi$, changes in velocity are proportional to changes in time.) If you draw the trapezoid, it's easy to see that its area is 4 times the area of the triangle $\triangle OPQ$, $O=(0,0)$ being the origin. (This is the "easy to see" point that took me a while to see. If someone with the wherewithal to do so could insert an actual picture here, I would very much appreciate it.) The angle at $Q$ is fixed at $\pi/2 - \phi$ and the length of the side opposite $Q$ is fixed at $OP=v_0$. It doesn't require calculus to conclude that the triangle's area is maximized when $Q$ is the apex of an isosceles triangle, i.e., when $\theta' = \pi/4 + \phi/2$, which translates back to $\theta = \pi/4 - \phi/2$.


Here's another solution, which is certainly simpler than the first one I gave, and may also be simpler than ChrisJB's. It would again benefit from a drawing, but I hope the verbal description will suffice.

Let $V$ denote the (initial) velocity vector (of length $v_0$), and write $V=U+W$, where $U$ points in the "up" direction and $W$ points in the "downhill" direction. Together with the origin $O$, we have a parallelogram $OUVW$, with angle $\pi/2 + \phi$ at $O$. Let $u$ and $w$ be the lengths of $U$ and $W$.

The trick is to realize that the amount of time the projectile spends in the air is simply $T=2u/g$. Consequently, the downhill distance it travels is $D=wT=2uw/g$. The variable quantity here, $uw$, is proportional to the area of the parallelogram $OUVW$, which has fixed angles and a diagonal ($OV$) of fixed length. This area, and hence the distance $D$, is maximized when the parallogram is a rhombus, which is to say when $OV$ bisects the angle of $\pi/2 + \phi$ at $O$.


           Rhombus
                        (Figure added by J.O'Rourke)

Added later: At the risk of complicating things, let me explain why $T=2u/g$.

Decompose the downhill vector $W$ into its horizontal and vertical components, writing $W=X-Y$, with components of (positive) length $x$ and $y$, respectively. (Note: the variables here denote velocities and speeds, not positions!) From the (absent, but easily drawn) picture, we have $\tan\phi = y/x$. Now, in addition to the projectile $P$ fired with initial velocity $V=U+W = U+X-Y$, imagine we fire two virtual projectiles: projectile $A$ straight up with velocity $U$ and projectile $B$ up and out with velocity $U+X$.

Because they have the same vertical component of velocity, $A$ and $B$ will always be at the same height; they simply separate horizontally with speed $x$. Similarly, $B$ and $P$, which have the same horizontal component of velocity, will always be vertically aligned, separating vertically at speed $y$. Gravity plays no role in the size, shape, or orientation of the triangle $\triangle ABP$; at any time $t$, it is a right triangle with a horizontal leg of length $|AB| = xt$ and vertical leg of length $|BP|=yt$. Hence the angle at $A$ is $\phi$, since the tangent is $yt/xt = y/x = \tan\phi$. This means that $AP$ is always parallel to the downhill slope, which means that projectiles $A$ and $P$ will hit the ground simultaneously.

But it's quite clear that $A$, being fired straight up with initial speed $u$, will land after time $T=2u/g$: It takes gravity time $u/g$ to bring the projectile to rest, and the same amount of time to bring it back down.