# Ball thrown off the top of a hill, ball hits hill

## Homework Statement

Alice and Bob are having a competition to see who can throw a baseball the farthest from the top of a hill which slopes downward uniformly at an angle ϕ. Alice plays softball, and Bob doesn't have a particularly good arm, so he knows that he's probably gonna lose. Fortunately, Bob has taken mechanics, and he realizes that there is an optimal angle θ at which he should throw the ball so that it has greatest range; what is that optimal angle?

Assume that Bob's initial velocity is fixed and the hill is infinitely tall and infinitely long, so that the ball always hits the hill.

2. The attempt at a solution
You don't have to look at my attempt to solve the equation, because it is fairly long.

My initial equations were:

x = v0cos(θ)t
y = (v0cos(θ)t)/tan(ϕ) + v0sin(θ)t - .5gt2
tan(ϕ) = x/y

I solved for t in the x equation, and got:
t = x/(v0cos(θ)

Then I substituted this value for t into the equation for y:
y = (v0cos(θ)x)/tan(ϕ)v0cos(θ) + (v0sin(θ)x)/(v0cos(θ) - .5g(x/(v0cos(θ))2

Then I substituted this value for y into the equation for tan(ϕ).

tan(ϕ) = x/(v0cos(θ)x)/tan(ϕ)v0cos(θ) + (v0sin(θ)x)/(v0cos(θ) - .5g(x/(v0cos(θ))2

Then I solved for x. After some rigorous simplification, x came out to be:
x = (2v02(cos2(θ) + sin(θ)cos(θ)tan(ϕ))/(g)tan(ϕ)

After that, I made a function of θ.
f(θ) = cos2(θ) + (a)sin(θ)cos(θ), where a = tan(ϕ)

x = (2v02f(θ))/tan(ϕ)

x is maximized when f(θ) is maximized. So I tried to find the derivative of f(θ), set it equal to 0, and all that stuff, but I'm having trouble finding a value of θ that maximizes f(θ). Here is the derivative, just so you know:

f'(θ) = -2sin(θ)cos(θ) +2(a)cos2(θ) - a