I have found the equation 2\cos \theta \sin \theta \tan \phi +2\sin \theta ^2 -1=0 and want to solve out \theta as a function of \phi .

The history of this equation is from a physics problem where a ball is thrown at angle \theta down a slope of angle \phi . The question is what angle \theta to throw the ball so that it has the greatest range. I have checked the equation numerically but cannot solve it.