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

Jan 4, 2018

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

#### Explanation:

The product rule tells us:

$f \left(x\right) = g \left(x\right) h \left(x\right)$ then

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

We have the two products and there derivatives:

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

and

$h \left(x\right) = 2 x - {x}^{2}$
$h ' \left(x\right) = 2 - 2 x$

So on substitution into the chain rule formula we get:

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