The derivative of products

Recall

We already know how to take the derivative of a sum of two functions uu and vv. This is the sum rule:

f(x)=u(x)+v(x)f(x)=u(x)+v(x)\begin{array}{lll} f(x) &= &u(x)+v(x)\\ f'(x) & = & u'(x)+v'(x) \end{array}

Here is an example with u(x)=x2u(x)=x^2 and v(x)=sin(x)v(x)=\sin(x):

f(x)=x2+sin(x)f(x)=2x+cos(x)\begin{array}{lll} f(x) &= &x^2+\sin(x)\\ f'(x) & = & 2x+\cos(x) \end{array}

The following rule deals with the case where we want to take the derivative of the product of two functions uu and vv, and the rule is as follows

Theorem 1

Assume the function ff can be written as the product of two other functions uu and vv, that is, f=uvf=u\cdot v. Then we have

Equation 1
f(x)=u(x)v(x)f(x)=u(x)v(x)+u(x)v(x)f(x)=u(x)\cdot v(x) \overset{\prime}{\rightarrow} f'(x)= u'(x)\cdot v(x)+u(x)\cdot v'(x)

Product differential rule

This rule is called the product rule. Basically, the rule says take the derivative of the first function and copy the second one, then copy the first one and take the derivative of the second one. The proof is in one of the exercises below.

Example 1

Here is the rule in action, again with u(x)=x2u(x)=x^2 and v(x)=sin(x)v(x)=\sin(x):

f(x)=x2sin(x)f(x)=2xsin(x)+x2cos(x)\begin{array}{lll} f(x) &= &x^2 \sin(x)\\ f'(x) & = & 2x\sin(x)+x^2\cos(x) \end{array}
Warning
  1. A common mistake is to apply a similar rule as for the sum: f(x)=u(x)v(x)f'(x)=u'(x)\cdot v'(x). It is simpler, yes, but unfortunately this does not work. For example, take the product f(x)=xxf(x)=x\cdot x. According to the false rule, we get f(x)=11=1f'(x)=1\cdot 1=1, but we know that the derivative of xx=x2x\cdot x=x^2 is 2x2x. So, not working!
  2. Sometimes you can avoid applying the product rule, and find the derivative quicker, but this comes with the cost that you have to know the power rules ... . Here is an example: To find the derivative of f(x)=x2x3f(x)=x^2\cdot x^3 we can apply the product rule: f(x)=2xx3+x23x2=2x4+3x4=5x4\begin{array}{lll} f'(x) & = & 2x\cdot x^3+x^2\cdot 3x^2\\ & = & 2x^4+3x^4\\ & = & 5x^4\\ \end{array} or we first use the power rule to eliminate the product: f(x)=x2x3=x5f(x)=5x4\begin{array}{lll} f(x) &= &x^2\cdot x^3\\ & = & x^5\\ f'(x) & = & 5x^4\\ \end{array}
Exercise 1
  1. Find the derivative of the following functions using two different methods. One involves power laws, simplifying, and/or expanding, the other one is the product rule.

    1. f(x)=x2x4f(x)=x^2\cdot x^4
    2. f(x)=(x+1)(x3)f(x)=(x+1)(x-3)
    3. f(x)=x2xf(x)=x^2\sqrt{x}
  2. We already know how to find the derivative of a function that is multiplied by a constant, such as

    f(x)=3sin(x)f(x)=3\cdot \sin(x)

    The derivative is

    f(x)=3cos(x)f'(x)=3\cdot cos(x)

    that is, we simply copy the constant and take the derivative of the sin\sin. Any constant cc number can also be regarded as a function, one whose output is cc, g(x)=cg(x)=c for all xx. In this sense we can regard f(x)=3sin(x)f(x)=3\sin(x) as the product of the two functions

    f(x)=g(x)sin(x)f(x)=g(x)\cdot \sin(x)

    with (x)=3(x)=3 for all xx. Apply the product rule to show that we still get f(x)=3cos(x)f'(x)=3\cos(x).

  3. Determine the following derivatives

    1. f(x)=xcos(x)f(x)=\sqrt{x} \cos(x)
    2. f(x)=2xlog2(x)f(x)=2^x \cdot \log_2(x)
    3. f(x)=2xexf(x)=2x e^{x}
    4. f(x)=ln(x)xf(x)=\frac{\ln(x)}{x}
    5. f(x)=x2exsin(x)f(x)=x^2 \cdot e^x \cdot \sin(x)
    6. f(x)=sin(x)cos(x)f(x)=\sin(x)\cdot \cos(x)
    7. f(x)=(ln(x))2f(x)=(\ln(x))^2
  4. Give a proof of the product rule using the difference quotient.

Solution
  1. We have
    1. Power rule: f(x)=x2x4=x6f(x)=6x5\begin{array}{lll} f(x)&=&x^2\cdot x^4\\ &=&x^6\\ f^\prime(x)&=&6x^5 \end{array} Product rule: f(x)=2xx4+x24x3=2x5+4x5=6x5\begin{array}{lll} f^\prime(x)&=& 2x\cdot x^4+x^2\cdot 4x^3\\ &=&2x^5+4x^5\\ &=&6x^5 \end{array}
    2. Expand: f(x)=(x+1)(x3)=x22x3f(x)=2x2\begin{array}{lll} f(x)&=&(x+1)(x-3)\\ &=&x^2-2x-3\\ f^\prime(x)&=&2x-2 \end{array} Product rule: f(x)=1(x3)+(x+1)1=x3+x+1=2x2\begin{array}{lll} f^\prime(x)&=&1\cdot (x-3)+(x+1)\cdot 1\\ &=&x-3+x+1\\ &=&2x-2 \end{array}
    3. Power rule: f(x)=x2x=x2x1/2=x2.5f(x)=2.5x1.5\begin{array}{lll} f(x)&=&x^2\sqrt{x}\\ &=&x^2 x^{1/2}\\ &=&x^{2.5}\\ f^\prime(x)&=&2.5 x^{1.5} \end{array} Product rule: f(x)=x2x0.5f(x)=2xx0.5+x20.5x0.5=2x1.5+0.5x1.5=2.5x1.5\begin{array}{lll} f(x)&=&x^2\cdot x^{0.5}\\ f^\prime(x)&=&2x\cdot x^{0.5} + x^2\cdot 0.5 x^{-0.5}\\ &=&2x^{1.5}+0.5x^{1.5}\\ &=&2.5x^{1.5} \end{array}
  2. It is f(x)=0sin(x)+3cos(x)=3cos(x)\begin{array}{lll}f^\prime(x)&=&0\cdot \sin(x)+3\cdot \cos(x)\\ &=&3\cos(x)\end{array}
  3. We have the following:
    1. It is f(x)=x1/2cos(x)f(x)=12x1/2cos(x)+x1/2(sin(x))=12xcos(x)xsin(x)\begin{array}{lll} f(x) &= & x^{1/2} \cos(x)\\ f^\prime(x) &= & \frac{1}{2}x^{-1/2}\cos(x)+x^{1/2}\cdot (-\sin(x))\\ &= & \frac{1}{2\sqrt{x}} \cos(x)-\sqrt{x}\sin(x)\\ \end{array}
    2. It is f(x)=2xlog2(x)f(x)=ln(2)2xlog2(x)+2x1ln(2)x=2x(ln(2)log2(x)+1ln(2)x)\begin{array}{lll} f(x)&=&2^x \cdot \log_2(x)\\ f'(x)&=&\ln(2)\cdot 2^x\cdot \log_2(x)+2^x\cdot \frac{1}{\ln(2)\cdot x} \\ &=& 2^x (\ln(2)\log_2(x)+ \frac{1}{\ln(2)\cdot x})\end{array}
    3. Well, f(x)=2xexf(x)=2ex+2xex=2ex(1+x)\begin{array}{lll} f(x)&=&2x \cdot e^{x}\\ f^\prime(x)&=&2\cdot e^{x} + 2x\cdot e^{x}\\ &=&2e^{x}(1+x) \end{array}
    4. Let's see ... f(x)=x1ln(x)f(x)=x2ln(x)+x11x=1x2ln(x)+1x1x=1x21x2ln(x)=1x211x2ln(x)=1x2(1ln(x))\begin{array}{lll} f(x)&=&x^{-1} \cdot \ln(x)\\ f^\prime(x)&=&-x^{-2}\ln(x)+x^{-1}\cdot \frac{1}{x}\\ &=& -\frac{1}{x^2}\ln(x)+\frac{1}{x}\frac{1}{x}\\ &=& \frac{1}{x^2}-\frac{1}{x^2}\ln(x)\\ &=& \frac{1}{x^2}\cdot 1-\frac{1}{x^2}\cdot \ln(x)\\ &=&\frac{1}{x^2}(1-\ln(x))\\ \end{array}
    5. Apply the product rule twice: f(x)=x2u(x)exsin(x)v(x)f(x)=2xu(x)exsin(x)v(x)+x2u(x)(exsin(x)+excos(x)v(x))\begin{array}{lll} f(x)&=&\underbrace{x^2}_{u(x)} \cdot \underbrace{e^x \cdot \sin(x)}_{v(x)}\\ f^\prime(x)&=&\underbrace{2x}_{u^\prime(x)}\cdot \underbrace{e^x \cdot \sin(x)}_{v(x)} \\ &+& \underbrace{x^2}_{u(x)} \cdot (\underbrace{e^x \cdot \sin(x)+e^x \cdot \cos(x)}_{v^\prime(x)}) \end{array}
    6. We have f(x)=sin(x)cos(x)f(x)=cos(x)cos(x)+sin(x)(sin(x)=cos2(x)sin2(x)\begin{array}{lll} f(x)&=&\sin(x)\cdot \cos(x)\\ f^\prime(x)&=&\cos(x)\cdot\cos(x)+\sin(x)\cdot(-\sin(x)\\ &=&\cos^2(x)-\sin^2(x)\end{array}
    7. And finally, f(x)=ln(x)ln(x)f(x)=1xln(x)+ln(x)1x=2ln(x)x\begin{array}{lll} f(x)&=&\ln(x)\cdot\ln(x)\\ f^\prime(x)&=&\frac{1}{x}\cdot \ln(x)+\ln(x)\cdot\frac{1}{x}\\ &=&\frac{2\ln(x)}{x} \end{array}
  4. With f(x)=u(x)v(x)f(x)=u(x)\cdot v(x) and a small hh close to zero it follows: f(x)f(x+h)f(x)h=u(x+h)v(x+h)u(x)v(x)h\begin{array}{lll} f'(x) &\approx& \frac{f(x+h)-f(x)}{h}\\ &=& \frac{u(x+h)v(x+h)-u(x)v(x)}{h}\\ \end{array} Next we use a little bit of magic. We write the expression u(x+h)v(x+h)u(x)v(x)u(x+h)v(x+h)-u(x)v(x) in a more complicated way, like so (u(x+h)u(x))v(x)+(v(x+h)v(x))u(x+h)(u(x+h)-u(x))\cdot v(x)+ (v(x+h)-v(x))\cdot u(x+h) Why? Because in the end we want to have the expression v(x)u(x)+u(x)v(x)v(x)\cdot u'(x) + u(x)\cdot v'(x) and by writing it in this complicated way, you will see that we will get exactly this: (u(x+h)u(x))v(x)+(v(x+h)v(x))u(x+h)=u(x+h)v(x)u(x)v(x)+v(x+h)u(x+h)v(x)u(x+h)=u(x)v(x)+v(x+h)u(x+h)=u(x+h)v(x+h)u(x)v(x)\begin{array}{l} (u(x+h)-u(x))\cdot v(x)+ (v(x+h)-v(x))\cdot u(x+h) \\ = u(x+h)v(x)-u(x)v(x)+v(x+h)u(x+h)-v(x)u(x+h)\\ = -u(x)v(x)+v(x+h)u(x+h)\\ = u(x+h)v(x+h)-u(x)v(x) \end{array} So, what we have now is f(x)f(x+h)f(x)h=u(x+h)v(x+h)u(x)v(x)h=(u(x+h)u(x))v(x)+(v(x+h)v(x))u(x+h)h=v(x)u(x+h)u(x)h+u(x+h)v(x+h)v(x)hv(x)u(x)+u(x)v(x)\begin{array}{lll} f'(x) &\approx& \frac{f(x+h)-f(x)}{h}\\ &=& \frac{u(x+h)v(x+h)-u(x)v(x)}{h}\\ &=& \frac{(u(x+h)-u(x))\cdot v(x)+ (v(x+h)-v(x))\cdot u(x+h) }{h}\\ &=& v(x)\cdot \frac{u(x+h)-u(x)}{h}+u(x+h)\cdot \frac{v(x+h)-v(x)}{h}\\ &\approx& v(x)\cdot u'(x) + u(x)\cdot v'(x) \end{array} q.e.d