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

Nov 1, 2016

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

#### Explanation:

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

Use product rule and chain rule

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

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

$f ' \left(x\right) = f g ' + g f '$

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