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

Feb 10, 2016

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

#### Explanation:

The product rule shows us that

$g ' \left(x\right) = \ln \left(3 - x\right) \frac{d}{\mathrm{dx}} \left({e}^{x - {x}^{2}}\right) + {e}^{x - {x}^{2}} \frac{d}{\mathrm{dx}} \left(\ln \left(3 - x\right)\right)$

Both of these derivatives require use of the chain rule. We will make use of the following chain rule "identities":

$\frac{d}{\mathrm{dx}} \left({e}^{x}\right) = {e}^{x} \text{ "=>" } \frac{d}{\mathrm{dx}} \left({e}^{f \left(x\right)}\right) = {e}^{f \left(x\right)} \cdot f ' \left(x\right)$

$\frac{d}{\mathrm{dx}} \left(\ln \left(x\right)\right) = \frac{1}{x} \text{ "=>" } \frac{d}{\mathrm{dx}} \left(\ln \left(f \left(x\right)\right)\right) = \frac{1}{f \left(x\right)} \cdot f ' \left(x\right)$

So, we see that

$\frac{d}{\mathrm{dx}} \left({e}^{x - {x}^{2}}\right) = {e}^{x - {x}^{2}} \frac{d}{\mathrm{dx}} \left(x - {x}^{2}\right) = \left(1 - 2 x\right) {e}^{x - {x}^{2}}$

and

$\frac{d}{\mathrm{dx}} \left(\ln \left(3 - x\right)\right) = \frac{1}{3 - x} \frac{d}{\mathrm{dx}} \left(3 - x\right) = \frac{1}{3 - x} \left(- 1\right) = \frac{1}{x - 3}$

Plug these both back in to find the function's derivative:

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