# Differentiation Rules: Product, Quotient and Chain Rule

At higher levels of mathematics, you may need one of the differentiation rules to find the derivative of a function. At the basic level, we looked at differentiating a polynomial function. However, at higher levels, a question may ask you to differentiate a trigonometric function or more complex functions. This could include products, quotient or chains. In these cases, we require one of the differentiation rules below. In addition, a question may require you to differentiate a reciprocal function. If so, we may use the fact that $\frac{dy}{dx}=\frac{1}{\frac{dx}{dy}}$. See Example 1. We can show each of the differentiation rules below using differentiation from first principles.

## The Product Rule

The first of the differentiation rules we discuss here is the **product rule**. Evidently, this is for differentiating products, that is, when two functions of the same variable are multiplied together. Hence, suppose that we want to differentiate a function that we can write as $y=f(x)g(x)$. The derivative is given by:

$\frac{dy}{dx}=\frac{df(x)}{dx}g(x)+f(x)\frac{dg(x)}{dx}$

For example, suppose $y=x^2\sin(x)$. Then we let $f(x)=x^2$ and $g(x)=\sin(x)$ and using the formula above for the product rule we obtain $\frac{dy}{dx}=2x\sin(x)+x^2\cos(x)$. Also see Example 2. This formula is NOT given in the A-Level Maths Differentiation section of the Edexcel Formula Booklet.

## The Quotient Rule

The second of the differentiation rules we discuss here is the **quotient rule**. As suggested, this is for differentiating quotients, that is, when one function of a given variable is divided by another function of the same variable. Hence, suppose that we want to differentiate a function that we can write as $y=\frac{f(x)}{g(x)}$. The derivative is given by:

$\frac{dy}{dx}=\frac{\frac{df(x)}{dx}g(x)-f(x)\frac{dg(x)}{dx}}{g(x)^2}$

For example, suppose $y=\frac{x^2}{\sin(x)}$. Then we let $f(x)=x^2$ and $g(x)=\sin(x)$ and using the formula above for the quotient rule we obtain $\frac{dy}{dx}=\frac{2x\sin(x)-x^2\cos(x)}{\sin^2(x)}$. We can also write this as $\frac{dy}{dx}=2x\text{ cosec}(x)-x^2\cot(x)\text{cosec}(x)=x\text{ cosec}(x)\left(2-x\cot(x)\right)$. See more on reciprocal trigonometric functions. Also see Example 3.

Note that it is possible to avoid using the quotient rule if you prefer using the product rule and chain rule. This is because every function that can be written as $y=\frac{f(x)}{g(x)}$ we can also write as $y=f(x)g(x)^{-1}$. Hence, the quotient can be written as a product but where $g(x)^{-1}$ is a chain. Again, see Example 3. Note that this formula IS given in the A-Level Maths Differentiation section of the Edexcel Formula Booklet.

## The Chain Rule

The final differentiation rule we discuss here is the **chain rule**. Of course, this is for differentiating chains, also known as a function of a function or composite functions. This is when one function is applied on top of another (see more on composite functions). Suppose that we want to differentiate a function that we can write as $y=f(g(x))$ (or $y=f\circ g(x)$). The derivative is given by:

$\frac{dy}{dx}=\frac{df(g)}{dg}\frac{dg(x)}{dx}$

For example, suppose $y=\sin\left(x^2\right)$. Then we let $f(g)=\sin(g)$ where $g(x)=x^2$ and using the formula above for the chain rule we obtain $\frac{dy}{dx}=\cos(g)\times 2x=2x\cos\left(x^2\right)$. Note that choosing the functions the other way round, that is, $f(g)=g^2$ and $g(x)=\sin(x)$, then we are effectively differentiating $y=\sin^2(x)$. It follows that $\frac{d}{dx}\left(\sin^2(x)\right)=2g\cos(x)=2\sin(x)\cos(x)=\sin(2x)$. Also see Example 4. It can be easier, in some examples, to identify $g(x)$, the first function that is applied to $x$ first. Note that this formula is. NOT given in the A-Level Maths Differentiation section of the Edexcel Formula Booklet.

## Examples of the Differentiation Rules

### Example 1

Show that the derivative of $y=\arccos(x)$ is given by $\frac{dy}{dx}=-\frac{1}{\sqrt{1-x^2}}$.

We start by writing $x=\cos(y)$ and differentiate with respect to $y$: $\frac{dx}{dy}=-\sin(y)$. Hence, it follows that $\frac{dy}{dx}=\frac{1}{-\sin(y)}$. To write this as a function of $x$, we note that $\sin(y)=\pm\sqrt{1-\cos^2(y)}=\pm\sqrt{1-x^2}$. Recall that $\cos(y)$ is one-to-one on the default interval $0\leq y\leq\pi$. It follows that $\sin(y)$ is positive on this interval. Hence $\frac{d}{dx}\left(\arccos(x)\right)=-\frac{1}{\sqrt{1-x^2}}$

### Example 2

Find an expression for $f'(x)$ given that $f(x)=3e^{5x}\cos(2x)$.

As we can see, $f(x)$ is a product that we can write as $f(x)=u(x)v(x)$ where $u(x)=3e^{5x}$ and $v(x)=\cos(2x)$. It follows that $u'(x)=15e^{5x}$ (see differentiating exponential functions) and $v'(x)=-2\sin(2x)$ (see differentiating trigonometric functions). We can then use the product rule:

$\begin{array}{l}f'(x)&=&u'(x)v(x)+u(x)v'(x)\\&=&15e^{5x}\cos(2x)-6e^{5x}\sin(2x)\\&=&3e^{5x}\left(5\cos(2x)-2\sin(2x)\right)\end{array}$

### Example 3

Find the derivative of $y=\frac{2^{3x}}{\ln(4x)}$.

As we can see $y$ is a quotient and we can write $y=\frac{f(x)}{g(x)}$ where $f(x)=2^{3x}$ and $g(x)=\ln(4x)$. It follows that $\frac{df}{dx}=3\times 2^{3x}\ln(2)$ and $\frac{dg}{dx}=\frac{1}{x}$ (see differentiating exp/log functions). It follows, using the quotient rule that

$\begin{array}{l}\frac{dy}{dx}&=&\frac{\frac{df}{dx}g-f\frac{dg}{dx}}{g^2}\\&=&\frac{3\times 2^{3x}\ln(2)\times\ln(4x)-2^{3x}\times\frac{1}{x}}{\ln(4x)^2}\\&=&2^{3x}\left(3\ln(2)\ln(4x)^{-1}-x^{-1}\ln(4x)^{-2}\right)\end{array}$.

Alternatively, we could write $y=2^{3x}\ln(4x)^{-1}$ and use the product and chain rule. Let $f(x)=2^{3x}$ and $g(x)=\ln(4x)^{-1}$. It follows that $f'(x)=3\times 2^{3x}\ln(2)$ and $g'(x)=-\ln(4x)^{-2}\times x^{-1}$ (via the chain rule). Hence, by the product rule, $\frac{dy}{dx}=3\times 2^{3x}\ln(2)\times \ln(4x)^{-1}+2^{3x}\times-x^{-1}\ln(4x)^{-2}$. This is equivalent to the expression found using the quotient rule.

### Example 4

Show that $\frac{d}{dx}\left(\arctan(\sec(x)\right)=\frac{\sin(x)}{\cos^2(x)+1}$.

The function that we must differentiate is a chain. This is because we apply arctan on top of sec of $x$. It follows that we can write $y=\arctan(g)$ where $g(x)=\sec(x)$. We then use the chain rule:

$\begin{array}{l}\frac{dy}{dx}&=&\frac{dy}{dg}\times \frac{dg}{dx}\\&=&\frac{1}{1+g^2}\times \text{sec}(x)\tan(x)\\&=&\frac{1}{1+\sec^2(x)}\times\sec(x)\tan(x)\\&=&\frac{1}{1+\frac{1}{\cos^2(x)}}\times\frac{1}{\cos(x)}\frac{\sin(x)}{\cos(x)}\\&=&\frac{\cos^2(x)}{\cos^2(x)+1}\times\frac{1}{\cos(x)}\frac{\sin(x)}{\cos(x)}\\&=&\frac{\sin(x)}{\cos^2(x)+1}\end{array}$

as required. See more on differentiating trigonometric functions.