1 Differentiating a product

In previous Sections we have examined the process of differentiating functions. We found how to obtain the derivative of many commonly occurring functions. These are recorded in the following table (remember, arguments of trigonometric functions are assumed to be in radians ).

Table 2

 $y$ $\frac{dy}{dx}$ ${x}^{n}$ $n{x}^{n-1}$ $sinax$ $acosax$ $cosax$ $-asinax$ $tanax$ $a{sec}^{2}ax$ $secax$ $asecxtanx$ $lnax$ $\frac{1}{x}$ ${e}^{ax}$ $a{e}^{ax}$ $coshax$ $asinhax$ $sinhax$ $acoshax$

In this Section we consider how to differentiate non-standard functions - in particular those which can be written as the product of standard functions. Being able to differentiate such functions depends upon the following Key Point.

Key Point 9

Product Rule

If $y=f\left(x\right)g\left(x\right)$ then $\frac{dy}{dx}=\frac{df}{dx}g\left(x\right)+f\left(x\right)\frac{dg}{dx}\phantom{\rule{2em}{0ex}}\left(\text{or}\phantom{\rule{1em}{0ex}}{y}^{\prime }={f}^{\prime }g+f{g}^{\prime }\right)$

If $\phantom{\rule{1em}{0ex}}y=u.v$ then $\phantom{\rule{1em}{0ex}}\frac{dy}{dx}=u\frac{dv}{dx}+v\frac{du}{dx}\phantom{\rule{2em}{0ex}}\left(\text{or}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{y}^{\prime }=u{v}^{\prime }+v{u}^{\prime }\right)$

These versions are equivalent, and called the product rule .

We shall not prove this result, instead we shall concentrate on its use.

Example 8

Differentiate

1. $y={x}^{2}sinx$
2. $y=xlnx$
Solution
1. Here $f\left(x\right)={x}^{2}$ , $g\left(x\right)=sinx$ $\therefore \phantom{\rule{1em}{0ex}}\frac{df}{dx}=2x\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dg}{dx}=cosx$

and so $\frac{dy}{dx}=2x\left(sinx\right)+{x}^{2}\left(cosx\right)=x\left(2sinx+xcosx\right)$

2. Here $f\left(x\right)=x$ , $g\left(x\right)=lnx$ $\therefore \phantom{\rule{1em}{0ex}}\frac{df}{dx}=1\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dg}{dx}=\frac{1}{x}$

and so $\frac{dy}{dx}=1.\left(lnx\right)+x.\left(\frac{1}{x}\right)=lnx+1$

Determine the derivatives of the following functions

1. $y={e}^{x}lnx,$
2. $y=\frac{{e}^{2x}}{{x}^{2}}$
1. Use the product rule:

$\frac{dy}{dx}={e}^{x}lnx+\frac{{e}^{x}}{x}$

2. Write $y=\left({x}^{-2}\right){e}^{2x}$ and then differentiate:

$\frac{dy}{dx}=\left(-2{x}^{-3}\right){e}^{2x}+{x}^{-2}\left(2{e}^{2x}\right)=\frac{2{e}^{2x}}{{x}^{3}}\left(-1+x\right)$

The rule for differentiating a product can be extended to any number of products. If, for example, $y=f\left(x\right)g\left(x\right)h\left(x\right)$ then

$\begin{array}{rcll}\frac{dy}{dx}& =& \frac{df}{dx}\left[g\left(x\right)h\left(x\right)\right]+f\left(x\right)\frac{d}{dx}\left[g\left(x\right)h\left(x\right)\right]& \text{}\\ & =& \frac{df}{dx}g\left(x\right)h\left(x\right)+f\left(x\right)\left\{\frac{dg}{dx}h\left(x\right)+g\left(x\right)\frac{dh}{dx}\right\}& \text{}\\ & =& \frac{df}{dx}g\left(x\right)h\left(x\right)+f\left(x\right)\frac{dg}{dx}h\left(x\right)+f\left(x\right)g\left(x\right)\frac{dh}{dx}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\end{array}$

That is, each function in the product is differentiated in turn and the three results added together.

Example 9

If $y=x{e}^{2x}sinx$ then find $\frac{dy}{dx}$ .

Solution

Here $f\left(x\right)=x$ , $g\left(x\right)={e}^{2x}$ , $h\left(x\right)=sinx$

$\phantom{\rule{2em}{0ex}}\frac{df}{dx}=1,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dg}{dx}=2{e}^{2x},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dh}{dx}=cosx$

$\begin{array}{rcll}\therefore \phantom{\rule{2em}{0ex}}\frac{dy}{dx}& =& 1\left({e}^{2x}sinx\right)+x\left(2{e}^{2x}\right)sinx+x{e}^{2x}\left(cosx\right)& \text{}\\ & =& {e}^{2x}\left(sinx+2xsinx+xcosx\right)& \text{}\end{array}$

Obtain the first derivative of $y={x}^{2}\left(lnx\right)sinhx$ .

Firstly identify the three functions:

$f\left(x\right)={x}^{2},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}g\left(x\right)=lnx,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}h\left(x\right)=sinhx$

Now find the derivative of each of these functions:

$\frac{df}{dx}=2x,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dg}{dx}=\frac{1}{x},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{dh}{dx}=coshx$

Finally obtain $\frac{dy}{dx}$ :

$\begin{array}{rcll}\frac{dy}{dx}& =& 2x\left(lnx\right)sinhx+{x}^{2}\left(\frac{1}{x}\right)sinhx+{x}^{2}lnx\left(coshx\right)\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\\ & =& 2xlnxsinhx+xsinhx+{x}^{2}lnxcoshx& \text{}\end{array}$

Find the second derivative of $y={x}^{2}\left(lnx\right)sinhx$ by differentiating each of the three terms making up $\frac{dy}{dx}$ found in the previous Task ( $2xlnxsinhx$ , $xsinhx,$ ${x}^{2}lnxcoshx$ ), and finally, simplify your answer by collecting like terms together:

$\frac{{d}^{2}y}{d{x}^{2}}=\left(2+{x}^{2}\right)lnxsinhx+3sinhx+2xcoshx+4xlnxcoshx$

Exercises
1. In each case find the derivative of the function
1. $y=xtanx$
2. $y={x}^{4}ln\left(2x\right)$
3. $y={sin}^{2}x$
4. $y={e}^{2x}cos3x$
2. Find the derivatives of:
1. $y=\frac{x}{cosx}$
2. $y={e}^{x}sinx$
3. Obtain the derivative of $y=x{e}^{x}tanx$ using the results of parts (a) and (b).
1. $\frac{dy}{dx}=tanx+x{sec}^{2}x$
2. $\frac{dy}{dx}=4{x}^{3}ln\left(2x\right)+\frac{{x}^{4}}{x}={x}^{3}\left(4ln\left(2x\right)+1\right)$
3. $y=sinx.sinx$

$\therefore \phantom{\rule{2em}{0ex}}\frac{dy}{dx}=cosxsinx+sinxcosx=2sinxcosx=sin2x$

4. $\frac{dy}{dx}=\left(2{e}^{2x}\right)cos3x+{e}^{2x}\left(-3sin3x\right)={e}^{2x}\left(2cos3x-3sin3x\right)$
1. $y=xsecx\phantom{\rule{2em}{0ex}}\therefore \phantom{\rule{1em}{0ex}}\frac{dy}{dx}=secx+xsecxtanx$
2. $\frac{dy}{dx}={e}^{x}sinx+{e}^{x}cosx={e}^{x}\left(sinx+cosx\right)$
3. The derivative of $y=x{e}^{x}tanx=\left(xsecx\right)\left({e}^{x}sinx\right)$ is found by applying the product rule to the results of (a) and (b): $\begin{array}{rcll}\frac{dy}{dx}& =& \frac{d}{dx}\left(xsecx\right).{e}^{x}sinx+\left(xsecx\right)\frac{d}{dx}\left({e}^{x}sinx\right)& \text{}\\ & =& \left(secx+xsecxtanx\right){e}^{x}sinx+xsecx\left({e}^{x}\right)\left(sinx+cosx\right)& \text{}\\ & =& {e}^{x}\left(x+tanx+xtanx+x{tan}^{2}x\right)& \text{}\end{array}$