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

Mar 7, 2017

$= 3 x {e}^{x} + {x}^{2} {e}^{x} + {e}^{x} - 6 {x}^{2} - 4 x$

#### Explanation:

The product rule states that:

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

Then it is:

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

$= 2 x {e}^{x} - 4 {x}^{2} + {e}^{x} - 2 x + {x}^{2} {e}^{x} - 2 {x}^{2} + x {e}^{x} - 2 x$

Let's sum the like terms:

$= 3 x {e}^{x} + {x}^{2} {e}^{x} + {e}^{x} - 6 {x}^{2} - 4 x$