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

Mar 5, 2018

$g ' \left(x\right) = x \left(4 {x}^{2} - 9 x + 4\right)$

#### Explanation:

The chain rule: $\frac{\mathrm{dg} \left(h \left(x\right)\right)}{\mathrm{dx}} = \frac{\mathrm{dg} \left(h \left(x\right)\right)}{\mathrm{dh} \left(x\right)} \cdot \frac{\mathrm{dh} \left(x\right)}{\mathrm{dx}}$

Applying it to this problem: take the derivative of one term at a time, treating the other two terms as constant.

$g \left(x\right) = \left(x - 1\right) \left(x - 2\right) \left({x}^{2}\right)$

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

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

$g ' \left(x\right) = x \left(\left(x - 2\right) x + \left(x - 1\right) x + 2 \left(x - 1\right) \left(x - 2\right)\right)$

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

$g ' \left(x\right) = x \left(4 {x}^{2} - 9 x + 4\right)$