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

Feb 7, 2017

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

#### Explanation:

Assuming the function is actually $g \left(x\right)$ and not $g \left(y\right)$, the following is the explanation. Otherwise, differentiating with respect to $y$ means treating $x$ as a constant, so $g ' \left(y\right) = 0$.

The product rule states that for $a , b$ functions of $x$,

$\left(a b\right) ' = a ' b + a b '$

If we let $a \left(x\right) = \left(x - 2 {x}^{2}\right)$ and $b \left(x\right) = {e}^{3 - x}$, then:

We know that $a ' \left(x\right) = 1 - 4 x$ from the power rule.

For $b ' \left(x\right)$, we also need to use the chain rule, which states that if $c , d$ functions of $x$, then

$\left(c \left(d \left(x\right)\right)\right) ' = c ' \left(d \left(x\right)\right) \cdot d ' \left(x\right)$

If we let $c \left(x\right) = {e}^{x}$ and $d \left(x\right) = 3 - x$ then the composition of $c$ with $d$ will be ${e}^{3 - x}$.

The derivative of $c$ with respect to $d \left(x\right)$ is ${e}^{3} - x$ and the derivative of $d$ with respect to $x$ is $\textcolor{red}{- 1}$.

We have to multiply with that $- 1$, which is why we see the minus sign in between the terms in the answer.

So, $g ' \left(x\right) = \left(1 - 4 x\right) {e}^{3 - x} - \left(x - 2 {x}^{2}\right) {e}^{3 - x}$