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

Apr 7, 2016

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

Explanation:

$f \left(x\right) = {x}^{2} {e}^{{x}^{2} - x}$

Differentiating both sides w.r.t 'x'

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

Taking ${x}^{2}$ as first function and ${e}^{{x}^{2} - x}$ as second function

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

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

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

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

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

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

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