# How do you differentiate g(x) = (2 -e^x) ( 2x-x^2) using the product rule?

Jul 14, 2018

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

#### Explanation:

Using the product rule

$\left(u v\right) ' = u ' v + u v '$
we get

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

expanding we get

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

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