Derivative of $\cos^{-1} (1-\tfrac{h}{r})$ with respect to time I'm trying to solve a calculus problem involving the change in water level of a half-cylinder-shaped water trough. I've worked through and understood most of the solution (I was unable to solve it on my own), but when the solution got to this point, it totally lost me:
$$\theta = \cos^{-1}\left(1-\frac{h}{r}\right)$$
The solution was given to me as:
$$\frac{\text{d}\theta}{\text{d}t} = \frac{1}{\sqrt{-h(h-2r)}}$$
I'm very confused as to how that can be the derivative of $\theta = \cos^{-1}(1-h/r)$. When I tried to take the derivative myself, I got the following, so apparently I am missing something here:
$$\frac{\text{d}\theta}{\text{d}t} = -\sin^{-1}\left(1-\frac{h}{r}\right) \cdot \left(-\frac1r\cdot\frac{\text{d}h}{\text{d}t} + \frac{h}{r^2}\cdot\frac{\text{d}r}{\text{d}t}\right)$$
This, of course, is not what was given in the solutions manual.
Thoughts?
 A: $$
\theta =\cos^{-1}\left(1-\frac{h}{r}\right)\implies \cos \theta = 1-\frac{h}{r}
$$
thus we have
$$
-\sin \theta \dot{\theta} = -\dfrac{d}{dt}\frac{h}{r}
$$
using the first equation we have
$$
\cos^2 \theta = \left(1-\frac{h}{r}\right)^2 = 1-\frac{2h}{r}+\frac{h^2}{r^2}
$$
using $\sin^2 \theta + \cos^2\theta = 1$ we have
$$
\sin \theta = \sqrt{1-\left(1-\frac{2h}{r}+\frac{h^2}{r^2}\right)} = \sqrt{\frac{2h}{r}-\frac{h^2}{r^2}}= \frac{1}{r}\sqrt{h\left(2hr-h\right)}
$$
so we have
$$
\dot{\theta} = \frac{1}{\sin \theta}\dfrac{d}{dt}\frac{h}{r}= \frac{1}{\frac{1}{r}\sqrt{h\left(2hr-h\right)}}\dfrac{d}{dt}\frac{h}{r}
$$
so the closest we can get with your information is assuming the cylinder radius $r$ (assuming that it is fact radius) is constant we can get
$$
\dot{\theta} = \frac{1}{\sqrt{h\left(2hr-h\right)}}\dfrac{dh}{dt}
$$
which looks close to your answer (missing $dh/dt$). So confirm you have it correctly written the solution.
A: As I understand your question you are curious about the derivative of the inverse cosine, so here goes:
Let $y = \cos^{-1}(x)$ and note that $y$ takes values between $0$ and $\pi/2$. Now,
$$
x = \cos{y}
$$
so
$$
\frac{\text{d}x}{\text{d}y} = -\sin{y}.
$$
By the inverse function theorem we thus have
$$
\frac{\text{d}y}{\text{d}x} = -\frac{1}{\sin{y}}.
$$
Now recall that $\cos^2{y} + \sin^2{y} = 1$ so
$$
\sin{y} = \sqrt{1 - \cos^2{y}}.
$$
Note that only the positive root applies since $y$ is necessarily nonnegative. We thus have
$$
\frac{\text{d}y}{\text{d}x} = -\frac{1}{\sqrt{1 - \cos^2{y}}} = -\frac{1}{\sqrt{1-x^2}}.
$$
The remainder of your question follows by standard calculus.
