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

Jul 7, 2018

f'(x) = -2x^3(lnx - 2)e^(-((ln x)^2+4)

or
f'(x) = -2x^3(lnx - 2)/e^((ln x)^2+4

#### Explanation:

Given: f(x) = 1/(e^((ln x - 2)^2)

Move everything to the numerator by changing signs on the $e$:

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

Use the derivative rule: $\left({e}^{u}\right) ' = u ' {e}^{u}$

Let u = -(ln x - 2)^2; " "w = ln x - 2; " "k = -1

$w ' = \frac{1}{x} - 0 = \frac{1}{x} \text{ and } n = 2$

Using the chain rule: $\left({u}^{n}\right) ' = n k {w}^{n - 1} w '$

$u ' = - 2 {\left(\ln x - 2\right)}^{1} \left(\frac{1}{x}\right) = \frac{- 2 \left(\ln x - 2\right)}{x}$

Since $\left({e}^{u}\right) ' = u ' {e}^{u} , \text{ }$then

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

To simplify, ${e}^{- {\left(\ln x - 2\right)}^{2}} = {e}^{- {\left(\ln\right)}^{2} + \ln {x}^{4} - 4}$

$= {e}^{- {\left(\ln\right)}^{2} - 4} {e}^{\ln {x}^{4}}$

$= {e}^{- {\left(\ln\right)}^{2} - 4} {x}^{4}$

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

$f ' \left(x\right) = - 2 \left(\ln x - 2\right) {e}^{- {\left(\ln\right)}^{2} - 4} {x}^{3}$

Rearranging:

$f ' \left(x\right) = - 2 {x}^{3} \left(\ln x - 2\right) {e}^{- {\left(\ln x\right)}^{2} - 4}$

f'(x) = -2x^3(lnx - 2)e^(-((ln x)^2+4)

f'(x) = -2x^3(lnx - 2)/e^((ln x)^2+4