Angle of Inclination if Range is at Maximum If the horizontal range of a projectile launched, without air resistance is given by: $$R = \frac{v_0\cos\theta}{g}\left(v_0\sin\theta +\sqrt{v_{0}^{2}\sin^{2}\theta + 2S_0g}\right)$$ where $S_0$ is the initial height of the projectile, $v_0$ is the initial velocity, and $g$ is the acceleration due to gravity. Consider the range as a function of $\theta$. Show that the projectile launched is a maximum for the angle of inclination $$\theta = \cos^{-1}\sqrt{\frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}}.$$
This problem is from the book "Advanced Engineering Mathematics" (6th ed.) by Dennis Zill. After taking the derivative of the Range with respect to $\theta$, and equating it to zero, I'm stuck with $$\sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^2}}\cos2\theta + \cos2\theta\sin\theta -\frac{2S_0g\sin\theta}{v_{0}^{2}} = 0.$$
 A: All it needs is patience with algebra after applying the Quotient and Chain Rules.
Let $$ s= \sin\theta, c= \cos\theta , k =\dfrac{2 S_0 g }{v_0^2}, Q= s^2 + k; \,\; $$
Maximize $c ( s+ \sqrt{s^2+k} ) $ or its square for convenience
$$ c^2 ( s+\sqrt Q)^2 $$
Quotient Rule
$$ \dfrac{c^2}{( s+\sqrt Q)^2 }= -\dfrac{2c\cdot -s}{2( s+\sqrt Q)*(c +\dfrac{sc}{\sqrt Q})} $$
Simplifying steps are:
$$ \dfrac{c}{( s+\sqrt Q)}= \dfrac{s}{c(1+s/\sqrt{Q})}  $$
$$ c^2= s \sqrt{Q}$$
Squaring both sides
$$ c^4= s^2(s^2+k)\rightarrow c^4-s^4 = c^2-s^2 =s^2 k $$
Plug in $ s^2= 1-c^2 $ and collect $c^2$ terms..
$$ c^2 (2+k)= (1+k) $$
$$ c= \sqrt{ \dfrac{1+k}{2+k} }$$
$$\cos \theta = \sqrt{\frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}}.$$
A: I tried to change my approach in finding the derivative of the Range. Since the Range is a maximum, it implies that $\frac{\partial R}{\partial \theta} = 0$.
\begin{eqnarray*}
\ln{R} &=& \ln{v_0} - \ln{g} + \ln{\cos\theta} + \ln{\left(v_0\sin\theta + \sqrt{v_{0}^{2}\sin^2\theta + 2S_0g}\right)}\\
\frac{\partial R}{\partial \theta} &=& \frac{\partial}{\partial \theta}\left[\ln{v_0} - \ln{g} + \ln{\cos\theta} + \ln{\left(v_0\sin\theta + \sqrt{v_{0}^{2}\sin^2\theta + 2S_0g}\right)}\right]\\
\frac{R'}{R}&=& \frac{-\sin\theta}{\cos\theta} + \frac{v_0\cos\theta + \frac{v_{0}^{2}\sin\theta\cos\theta}{\sqrt{v_{0}^{2}\sin^2\theta + 2S_0g}}}{v_0\sin\theta + \sqrt{v_{0}^{2}\sin^2\theta + 2S_0g}}\\
\end{eqnarray*}
Since Range is a maximum, therefore $R' = 0$.
\begin{eqnarray*}
0 &=& -\tan\theta + \frac{\cos\theta + \frac{\sin\theta\cos\theta}{\sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^{2}}}}}{\sin\theta + \sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^{2}}}}\\
\sin\theta\left(\sin\theta + \sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^{2}}}\right)&=& \cos^2\theta \left(1 + \frac{\sin\theta}{\sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^{2}}}}\right)\\
\sin\theta\sqrt{\sin^2\theta + \frac{2S_0g}{v_{0}^{2}}} &=& \cos^2\theta
\end{eqnarray*}
Squaring both sides will yield,
\begin{eqnarray*}
\cos^4\theta &=& \sin^4\theta + \frac{2S_0g}{v_{0}^{2}}\sin^2\theta\\
\cos^4 - (1 - \cos^2\theta)^2 &=& \frac{2S_0g}{v_{0}^{2}} - \frac{2S_0g}{v_{0}^{2}}\cos^2\theta \\
2\cos^2\theta + \frac{2S_0g}{v_{0}^{2}}\cos^2\theta &=& \frac{2S_0g}{v_{0}^{2}} + 1 \\
\cos^2\theta &=& \frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}
\end{eqnarray*}
Taking the root,
\begin{eqnarray*}
\cos\theta &=& \sqrt{\frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}}\\
\therefore \theta &=& \cos^{-1} \sqrt{\frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}}.
\end{eqnarray*}
A: Rewrite $R = \frac{v_0\cos\theta}{g}\left(v_0\sin\theta +\sqrt{v_{0}^{2}\sin^{2}\theta + 2S_0g}\right)$ in the more manageable form 
$$w^2-v_0\sin\theta w-\frac12S_0g=0,\>\>\> w=\frac{gR}{2v\cos\theta}\tag1$$
and, correspondingly,
$$w’(\theta)=\frac{v_0\cos\theta w}{2w-v_0\sin\theta } 
=\frac{g(\cos\theta R’(\theta)+R\sin\theta)}{2v_0\cos^2\theta}\tag2$$
Then, set the maximum condition $R’(\theta) =0$ in (2) to get 
$R=\frac{v_0^2\cos\theta}{g\sin\theta}$ and plug into (1) to get
$$\frac{v_0^2}{4\sin^2\theta}- \frac12v_0^2- \frac12 S_0g=0$$
As a result
$$\theta = \cos^{-1}\sqrt{\frac{2S_0g + v_{0}^{2}}{2S_0g + 2v_{0}^{2}}}$$
