### Maximizing distance when throwing things

Most people who have gotten as far as high school math and science have been told that to maximize the horizontal distance traveled by a projectile, the projectile should be hurled at an angle of 45 degrees up from horizontal. Proving this is an easy problem in beginner calculus. The problem is usually introduced before calculus, as a motivator in science class, for example. But anyone who has thrown rocks or baseballs around a little, or has thought about it, knows that there are a lot of qualifications to attach to the problem -- no air resistance, no curvature of the Earth, etc. Here is how I dealt with one of those qualifications.

Have you ever thrown rocks into a river or lake, trying to see how far you could throw? You've probably realized that altitude, like being up on a bridge, gives you some advantage. But how best to use this advantage? The 45-degree rule no longer applies, because the rock is going to splash below your level. It's easy to see that you'll get more distance by lowering your release angle a bit, so that the rock has more horizontal velocity to use during its extra falling time. To figure out how much more is a straightforward, but messy-looking, application of calculus.

A | / | / | / . . y | / . . | /. |/ T . +-----------------------> x | . | h | | . |_____________________*__

The diagram shows the situation: from a height h above the water, throw a rock at angle T. Letting g be the acceleration due to gravity, t be time, and v the initial speed, we get the equations of motion for the rock

y = h + v*t*sin(T) - g*t*t/2 x = v*t*cos(T)We want to find T to maximize x when y=0, with v, h, and g constant. Using y=0 we solve the first equation for t using the quadratic formula. We'll want the positive root because time should be positive.

g*t*t/2 - v*t*sin(T) - h = 0 2 2 t = v*sin(T)/g + (1/g)*sqrt( v sin (T) + 2gh )(For brevity, I will drop the multiplication symbols where it seems clearer without them.) Now plug this value of t into the equation we have for x, and we have an equation for x in terms of T.

2 2 2 x = v*t*cos(T) = (1/g)*( v sin(T)cos(T) + v*cos(T)*sqrt(v sin (T) + 2gh) ) 2 2 2 = v sin(2T)/(2g) + (v*cos(T)/g)*sqrt( v sin (T) + 2gh )(I used the double angle formula 2*sin(T)*cos(T) = sin(2T) to simplify a little.) We then differentiate x with respect to T:

2 2 2 dx/dT = v cos(2T)/g - (v*sin(T)/g)*sqrt( v sin (T) + 2gh ) 2 2 2 v*cos(T)*( 2v sin(T)cos(T) )*sqrt( v sin (T) + 2gh ) + ---------------------------------------------------- 2 2 2g( v sin (T) + 2gh ) 2 2 2 2 2 v sin(T)cos (T) = v cos(2T)/g - (v/g)*sqrt(v sin (T) + 2gh)( --------------- - sin(T) ) 2 2 v sin (T) + 2gh 2 2 2 3 v sin(T)cos (T) - v sin (T) - 2gh*sin(T) = (v/g){ v*cos(2T) + ------------------------------------------ } 2 2 sqrt( v sin (T) + 2gh )Setting dx/dT equal to zero to find the T which maximizes x, we get

2 2 2 3 2 2 v*cos(2T)*sqrt( v sin (T) + 2gh ) = v sin (T) + 2gh*sin(T) - v sin(T)cos (T) 2 2 2 2 = sin(T)[ v sin (T) + 2gh - v cos (T) ] 2 = sin(T)[ 2gh - v cos(2T) ]where I used the double angle formula for cos(2T) in the last step. Next, square both sides to get rid of the square root.

2 2 2 2 2 4 2 2 2 2 v cos (2T)*(v sin (T) + 2gh) = sin (T)[ v cos (2T) - 4ghv cos(2T) + 4g h ]The first term on both sides cancels, leaving

2 2 2 2 2 2 2 2ghv cos (2T) = 4g h sin (T) - 4ghv sin (T)cos(2T)Eliminating a factor of 2gh on both sides, we can proceed from here to a solution for T in terms of the given constants.

2 2 2 2 2 v cos (2T) = 2gh*sin (T) - 2v sin (T)cos(2T) 2 2 2 0 = 2gh*sin (T) - v cos(2T)[ 2*sin (T) + cos(2T) ] 2 2 2 2 2 = 2gh*sin (T) - v cos(2T)[ 2*sin (T) + cos (T) - sin (T) ] 2 2 2 2 = 2gh*sin (T) - v cos(2T)[ sin (T) + cos (T) ] 2 2 = 2gh*sin (T) - v cos(2T) 2 2 2 2 2 = 2gh*sin (T) - v cos (T) + v sin (T) 2 2 2 2 = ( 2gh + v )sin (T) - v cos (T) 2 2 2 2 ( 2gh + v )sin (T) = v cos (T) 2 2 v tan (T) = -------- 2 2gh + vIt's always a good idea to check, so I note that for h=0 this solution reduces to the well-known 45 degrees. Also, as h approaches infinity, T heads for zero as it should. Finally, there are solutions for negative h, but only if it isn't too small -- these would be the situations where we are throwing the rock up from down in a well.