Help verifying a the correct partial differentiation of $v_0=R\sqrt{\frac{g}{2h}}$ I have to use partial differentiation to solve the below equation:
$v_0=R\sqrt{\frac{g}{2h}}$
Where $g$, $R$, and $h$, are defined as follows:
$g=9.80 \frac{m}{s^2}$
$R=155 cm$
$h=116.2 cm$
Solving for $v_0$ I got that equals $31.8293$
\begin{align}
\frac{\partial v_0}{\partial R} &= R\left(0\right)+\sqrt{\frac{g}{2h}}\left( 1 \right) = .20535\\
\frac{\partial v_0}{\partial h} &= R\left(\frac{1}{2}\left(\frac{g}{2h}\right)^{-\frac{1}{2}}-\frac{2}{g}\right)+\sqrt{\frac{g}{2h}}\left( 0 \right) = 345.772
\end{align}
Did I calculate the above partial derivatives properly?
 A: Answer.
\begin{align}
\frac{\partial v_0}{\partial R} &= \sqrt{\frac{g}{2h}}\\
\frac{\partial v_0}{\partial h} &= -\frac{1}{2}R\left(\frac{g}{2h^3}\right)^{1/2}
\end{align}
For the second one $v_0(h)=\left(R\sqrt{\frac{g}{2}}\right)h^{-1/2}$, and hence
$$
\frac{\partial v_0}{\partial h}=\left(R\sqrt{\frac{g}{2}}\right)\frac{\partial h^{-1/2}}{\partial h}=\left(R\sqrt{\frac{g}{2}}\right) \left(-\frac{1}{2}h^{-3/2}\right).
$$
A: The key thing to remember with partial differentiation w.r.t. $x$ is that is that you treat all the other variables like constants and then differentiate as normal w.r.t. $x$ (this is by definition). You can think of it as in this simple example with variables $x,y,z$:
$$ \frac{\partial}{\partial x}(xyz) = \frac{d}{x}kx = k$$
where the "constant" $k=yz$. So
$$ \frac{\partial}{\partial x}(xyz) = k = yz$$
In your first case, therefore, you don't need to use the product rule. You can just take $k=\sqrt{g/2h}$ and differentiate $kR$ directly w.r.t. $R$. You got the right answer but by a longer-than-necessary method.
In the second case you got the wrong answer. You need to take $$k=R\sqrt{g/2}$$ and differentiate $$kh^{-1/2}$$ w.r.t $h$, giving $$-\frac12kh^{-3/2} = -\frac12R\sqrt{\frac{g}{2}}h^{-3/2}$$
