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

Jan 18, 2017

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

#### Explanation:

Expand:

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

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

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

We now use the chain rule to differentiate. Let $y = {e}^{u}$ and $u = - {x}^{2} + 5 x - 4$. Then $y ' = {e}^{u}$ and $u ' = - 2 x + 5$.

$f ' \left(x\right) = u ' \cdot y '$

$f ' \left(x\right) = {e}^{u} \cdot 2 x + 5$

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

Hopefully this helps!