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

Jan 5, 2016

We'll need to resort also to chain rule to differentiate the second term $\cos \left(2 - z\right)$

#### Explanation:

• Product rule: $\left(a b\right) ' = a ' b + a b '$

• Chain rule: $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \frac{\mathrm{du}}{\mathrm{dx}}$

Renaming $u = 2 - z$ for the second term we can now proceed

$\frac{\mathrm{dg} \left(z\right)}{\mathrm{dz}} = 2 z \cos \left(2 - z\right) + {z}^{2} \sin \left(2 - z\right) \left(- 1\right)$

$\frac{\mathrm{dg} \left(z\right)}{\mathrm{dz}} = z \left(2 \cos \left(2 - z\right) - z \sin \left(2 - z\right)\right)$