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

Dec 24, 2015

First, see that the two factors here are ${z}^{2}$ and $\cos \left({z}^{2} - z\right)$.
Second, we'll need also the chain rule to derivate the second term.

#### Explanation:

• Product rule states that for $y = f \left(x\right) g \left(x\right)$, $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \frac{\mathrm{du}}{\mathrm{dx}}$
• Chain rule states that $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \frac{\mathrm{du}}{\mathrm{dx}}$

Here, we can rename $u = {z}^{2} - z$ and now apply chain rule when we need to derivate the second term, following the product rule.

So:

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

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

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