Having trouble understanding the end result of this, so if someone could explain it to me that would be great :).
So I have the function $f(x)=\frac{\sqrt{x}}{\sin(x)}$
My steps after taking the derivative of $\frac{\sqrt{x}}{\sin(x)}$:
$$\frac{\sin(x)-\cos(x)\sqrt {x}}{2\sqrt x*\sin^2(x)}$$
Now I do not understand what I did wrong here, for some reason the correct result is $$\frac{\sin(x)-2x*\cos(x)}{2\sqrt{x}*\sin^2(x)}$$
Would appreciate any input.
Using the formula $$\left(\frac{u}{v}\right)'=\frac{vu'-uv'}{v^2}$$ we get \begin{align*} \left(\frac{\sqrt{x}}{\sin(x)}\right)' &=\frac{\sin(x)\left(\frac{1}{2\sqrt{x}}\right)-\sqrt{x}\cos(x)}{\sin^2(x)}\\[4pt] &=\frac{\sin(x)\left(\frac{1}{2\sqrt{x}}\right)-\sqrt{x}\cos(x)}{\sin^2(x)} \cdot \frac{2\sqrt{x}}{2\sqrt{x}} \\[4pt] &=\frac{\sin(x)-2x\cos(x)}{2\sqrt{x}\sin^2(x)} \\[4pt] \end{align*}