Anyone who can help me with this one I have an home assignment where I am supposed to differentiate 
$$\sqrt{\frac{\cos(f(x))}{\sin(g(x))}}$$
The other expression (I had more than this one) gave me no trouble, but this one is hard. I have tried to do it with first chainrule and quotient rule. I mean there is both an outer and inner function and then there is an outer and inner function within that one. And also I guess the quotient rule would be applied here?
I got something like:
$$\frac{1}{2} \left( \frac{\cos(f(x))}{\sin(g(x))} \right)^{-0.5} \left(-\tan\frac{f(x)}{g(x)} \right) \frac{f'(x)}{g'(x)}$$
so this would be the chain rule perhaps. The quotient rule would be: 
$$\frac{\cos(g(x))g'(x)\cos(f(x))+\sin(f(x))f'(x)\sin(g(x)}{\sin^2(g(x))}$$
This is a total mess right? How do I even combine this? Pleeease guidance wanted so bad :) And apologizes for my not that nice writingstyle in this forum ! Hope you can read what I'm asking for.
 A: It seems like you did some typos in your quotient rule solution. No matter which way you go to find a solution, the result should be the same of course. So here comes the inner derivative of$\sqrt{\left(\frac{u(x)}{v(x)}\right)}$:
In general we have
$$
\left(\frac{u(x)}{v(x)}\right)^{'}=\left(\frac{u(x)^{'}v(x)-v(x)^{'}u(x)}{u(x)^2}\right)\tag 1
$$
which means in the case of $u(x)=\cos(f(x))$ and $v(x)=\sin(g(x))$ we get
\begin{align}
u(x)^{'}&=f(x)^{'}(-\sin(f(x)))=-f(x)^{'}\sin(f(x))\\
v(x)^{'}&=g(x)^{'}\cos(g(x))
\end{align}
where we used twice the chain rule and which gives us using $(1)$
$$
\left(\frac{u(x)}{v(x)}\right)^{'}=\left(\frac{\cos(f(x))}{\sin(g(x))}\right)^{'}=\frac{-f(x)^{'}\sin(f(x))\sin(g(x))-g(x)^{'}\cos(g(x))\cos(f(x))}{\sin(g(x))^2}
$$
Now we need to apply the chain rule again for the outer function, so 
$$
\sqrt{u(x)}^{'}={u(x)}^{'}\frac{1}{2\sqrt{u(x)}}
$$
which means altogether we have
\begin{align}
\sqrt{\left(\frac{\cos(f(x))}{\sin(g(x))}\right)}^{'}&=\left(\frac{\cos(f(x))}{\sin(g(x))}\right)^{'}\frac{1}{2\sqrt{\left(\frac{\cos(f(x))}{\sin(g(x))}\right)}}\\
&=\frac{-f(x)^{'}\sin(f(x))\sin(g(x))-g(x)^{'}\cos(g(x))\cos(f(x))}{\sin(g(x))^2}\frac{1}{2\sqrt{\left(\frac{\cos(f(x))}{\sin(g(x))}\right)}}
\end{align}
given that everything is well defined. I am not quite sure what you did in your first attempt chain rule but in your second attempt it definitely looks like you somehow forgot to take the root-function into consideration.
A: Try looking at the individual steps one at a time instead of trying to do the whole thing at once:
$\frac{d}{dx} \sqrt{\frac{N}{D}} = \frac{1}{2*\sqrt{\frac{N}{D}}}* \frac{d}{dx}\frac{N}{D} = \frac{1}{2*\sqrt{\frac{N}{D}}}*\frac{N'*D - D'*N}{D^2}$
$N = cos(f(x)), D = sin(g(x))$
A: Let's abbreviate with the notation $c_f, s_f\cdots$ which should have an obvious meaning.
$$\left(\left(\frac{c_f}{s_g}\right)^{1/2}\right)'=
\frac12\left(\frac{c_f}{s_g}\right)^{-1/2}\left(\frac{c_f}{s_g}\right)'
=\frac12\left(\frac{c_f}{s_g}\right)^{-1/2}\frac{c_f's_g-c_fs_g'}{s_g^2}
=\frac12\left(\frac{c_f}{s_g}\right)^{-1/2}\frac{-s_ff's_g-c_fc_gg'}{s_g^2}.$$
