# How do you differentiate  y =-sqrt(e^(x-sin^2x) using the chain rule?

Mar 19, 2017

$\frac{\mathrm{df}}{\mathrm{dx}} = - \frac{1}{2} \left(1 - \sin 2 x\right) \sqrt{{e}^{\left(x - {\sin}^{2} x\right)}}$

#### Explanation:

Chain Rule - In order to differentiate a function of a function, say $y , = f \left(g \left(x\right)\right)$, where we have to find $\frac{\mathrm{dy}}{\mathrm{dx}}$, we need to do (a) substitute $u = g \left(x\right)$, which gives us $y = f \left(u\right)$. Then we need to use a formula called Chain Rule, which states that $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \times \frac{\mathrm{du}}{\mathrm{dx}}$.

Here for example, we have $y = - \sqrt{{e}^{x - {\sin}^{2} x}}$

We can also write this as $y = - {e}^{\frac{x - {\sin}^{2} x}{2}}$

and we can say $y = f \left(x\right) = - {e}^{g \left(x\right)}$, where $g \left(x\right) = \frac{x - {\sin}^{2} x}{2}$

and $\frac{\mathrm{df}}{\mathrm{dx}} = - {e}^{g \left(x\right)} \times \frac{\mathrm{dg}}{\mathrm{dx}}$

= $- {e}^{g \left(x\right)} \times \left(\frac{1}{2} - \frac{1}{2} \times 2 \sin x \times \cos x\right)$

Observe that to differentiate ${\sin}^{2} x$ we have again used chain rule as differential of ${\sin}^{2} x$ w.r.t $\sin x$ is $2 \sin x$ and then multiplied it by $\frac{d}{\mathrm{dx}} \sin x = \cos x$

Hence $\frac{\mathrm{df}}{\mathrm{dx}} = - {e}^{\frac{x - {\sin}^{2} x}{2}} \times \frac{1}{2} \left(1 - \sin 2 x\right)$

= $- \frac{1}{2} \left(1 - \sin 2 x\right) \sqrt{{e}^{\left(x - {\sin}^{2} x\right)}}$