classical mechanics problem

A ball is thrown with initial speed $\displaystyle v_0$ up an inclined plane. the plane is at an angle $\displaystyle \phi$ and the ball's initial velocity is at angle $\displaystyle \theta$. Choose an axis with x measured up the slope, y normal, and z across it. Write down Newton's second law using these axes and find the ball's position as a function of time. Show that the ball lands a distance

$\displaystyle R=\dfrac{2v_0^2\sin{\theta}\cos(\theta+\phi)}{\cos ^2(\phi)}$

from it's launch point.

Show that for a given $\displaystyle v_0$ and $\displaystyle \phi$ that the max range is $\displaystyle R_{max}=\dfrac{v_0^2}{g(1+\sin\theta)}$