<s>[INST] Help finding the derivative of $f(x) = \cos{\left(\sqrt{e^{x^5} \sin{x}}\right)}$ I am trying to find the derivative of  $f(x) = \cos(\sqrt{(e^{x^5} \sin(x)})$.
I keep getting the wrong answer, and I'm not sure what I'm doing wrong.
$$\frac{d}{dx} e^{x^5} = e^{x^5} \cdot 5x^4$$
$$\frac{d}{dx} \sin(x) = \cos(x)$$
$$\frac{d}{dx} (e^{x ^5} \cdot \sin(x)) = [(e^{x^5} \cdot 5x^4) \cdot \sin(x)] + [\cos(x) \cdot e^{x^5}]$$
$$\frac{d}{dx} \sqrt{x} = \frac{1}{2\sqrt{x}}$$
$$\frac{d}{dx} \sqrt{(e^{x^5} \sin(x))} = \frac{[(e^{x^5} \cdot 5x^4) \cdot \sin(x)] + [\cos(x) \cdot e^{x^5}]}{2 \sqrt{e^{x^5} \sin(x)}}$$
Therefore, since $\frac{d}{dx} \cos(x) = -\sin(x)$, I have
$$ f'(x) = -\sin(\sqrt{e^{x^5} \sin(x)}) \cdot \frac{[(e^{x^5} \cdot 5x^4) \cdot \sin(x)] + [\cos(x) \cdot e^{x^5}]}{2 \sqrt{e^{x^5} \sin(x)}}$$
However, the website I'm using, "WeBWorK", says this is incorrect.
 [/INST] Use the Chain Rule:
$\dfrac{\mathrm d}{\mathrm dx}\cos(\sqrt{e^{x^5}\sin x})$
$=\dfrac{\mathrm d}{\mathrm d(\sqrt{e^{x^5}\sin x})}\cos(\sqrt{e^{x^5}\sin x})\cdot \dfrac{\mathrm d}{\mathrm d(e^{x^5}\sin x)}(\sqrt{e^{x^5}\sin x})\cdot \dfrac{\mathrm d}{\mathrm dx}(e^{x^5}\sin x)$
$=\dfrac{\mathrm d}{\mathrm d(\sqrt{e^{x^5}\sin x})}\cos(\sqrt{e^{x^5}\sin x})\cdot \dfrac{\mathrm d}{\mathrm d(e^{x^5}\sin x)}(\sqrt{e^{x^5}\sin x})\cdot \left(\sin x\dfrac{\mathrm d}{\mathrm dx}e^{x^5}+e^{x^5}\dfrac{\mathrm d}{\mathrm dx}\sin x\right)$
$=\dfrac{\mathrm d}{\mathrm d(\sqrt{e^{x^5}\sin x})}\cos(\sqrt{e^{x^5}\sin x})\cdot \dfrac{\mathrm d}{\mathrm d(e^{x^5}\sin x)}(\sqrt{e^{x^5}\sin x})\cdot \left[\sin x\left(\dfrac{\mathrm d}{\mathrm d(x^5)}e^{x^5}\cdot\dfrac{\mathrm d}{\mathrm dx}x^5\right)+e^{x^5}\dfrac{\mathrm d}{\mathrm dx}\sin x\right]$
$=-\sin(\sqrt{e^{x^5}\sin x})\cdot\dfrac{1}{2\sqrt{e^{x^5}\sin x}}\cdot \left[\sin x\cdot  e^{x^5}\cdot 5x^4+e^{x^5}\cdot\cos x\right]$
</s>