# How do you differentiate  f(x)=e^((lnx-2)^2  using the chain rule.?

Jul 11, 2016

This will require two applications of the chain rule.

Let $y = {u}^{2}$ and $u = \ln x - 2$

The derivative of $y$ is $2 u$ and the derivative of $u$ is $\frac{1}{x} - 0 = \frac{1}{x}$.

Hence, $\frac{\mathrm{dy}}{\mathrm{dx}} = 2 u \times \frac{1}{x} = \frac{2 u}{x} = \frac{2 \left(\ln x - 2\right)}{x}$

Now, let $y = {e}^{u}$ and $u = \frac{2 \left(\ln x - 2\right)}{x}$.

We already know the derivative of $u$. As for $y$, the derivative of ${e}^{u}$ is ${e}^{u}$.

So, $f ' \left(x\right) = {e}^{\frac{2 \left(\ln x - 2\right)}{x}}$.

Hopefully this helps!