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

I found: $f ' \left(x\right) = - 2 {e}^{x} \left(1 - {e}^{x}\right)$
$f ' \left(x\right) = \textcolor{red}{2} {\left(1 - {e}^{x}\right)}^{\textcolor{red}{2 - 1}} \cdot \textcolor{b l u e}{\left[0 - {e}^{x}\right]} =$
$= - 2 {e}^{x} \left(1 - {e}^{x}\right)$