# 7.6. Calculation Rules for Differentiable Functions

It is a routine meanwhile to check if properties of real valued functions are compatible with basic arithmetics. 'Good' properties often allow to establish a set of rules that could effectively minimise - or even automatise - our work.

According to the next proposition differentiability proves to be a 'very good' property.

Proposition (derivation rules, local version):  Let $a\in A\cap B$ be an accumulation point of $A\cap B$. If  $f:A\to ℝ$ and $g:B\to ℝ$ are differentiable at a, so are  $f+g,\text{\hspace{0.28em}}f-g,\text{\hspace{0.28em}}f\cdot g$ and - in case $g\left(a\right)\ne 0$ - $\frac{f}{g}$ as well. In addition we have the

 sum rule$\left(f+g{\right)}^{\prime }\left(a\right)={f}^{\prime }\left(a\right)+{g}^{\prime }\left(a\right)$ [7.6.1] difference rule$\left(f-g{\right)}^{\prime }\left(a\right)={f}^{\prime }\left(a\right)-{g}^{\prime }\left(a\right)$ [7.6.2] product rule$\left(f\cdot g{\right)}^{\prime }\left(a\right)={f}^{\prime }\left(a\right)\cdot g\left(a\right)+f\left(a\right)\cdot {g}^{\prime }\left(a\right)$ [7.6.3] quotient rule$\left(\frac{f}{g}{\right)}^{\prime }\left(a\right)=\frac{{f}^{\prime }\left(a\right)\cdot g\left(a\right)-f\left(a\right)\cdot {g}^{\prime }\left(a\right)}{{g}^{2}\left(a\right)}$ [7.6.4]

Proof:  All the rules follow directly from the limit theorems [6.9.5] - [6.9.8] using the respective calculation of the difference quotient function in [7.2.7] - [7.2.10]. Note that, as  f and g are differentiable at a, they are as well continuous thus their own value at a coincides with their limit.

With the quotient rule it is important to know that a is still an accumulation point of the domain of the quotient function (see the proof of [6.9.8] for details).

Consider:

• Each derivation rule is only valid in the stated direction. The differentiability of the result has no impact on the differentiability of the partner functions involved. Thus an implication like for example

f or g not differentiable at a$\text{ }⇒\text{ }f\cdot g$ not differentiable at a

is not valid. The differentiability of  $f\cdot g$ has to be decided individually. The absolute value function $|\mathrm{X}|$ e.g. is not differentiable at 0, but we have different results for products:

• $1\cdot |\mathrm{X}|=|\mathrm{X}|$ is not differentiable at 0.

• $|\mathrm{X}|\cdot |\mathrm{X}|={\mathrm{X}}^{2}$ is differentiable at 0.

Having in mind that the derivative of a constant function equals zero everywhere (${c}^{\prime }\left(a\right)=0$) we get some special cases of our derivation rules. We benefit from noting them separately.

 $\left(f+c{\right)}^{\prime }\left(a\right)={f}^{\prime }\left(a\right)$ Constant addends get lost when derivated. [7.6.5] factor rule$\left(c\cdot f{\right)}^{\prime }\left(a\right)=c\cdot {f}^{\prime }\left(a\right)$ Constant factors remain when derivated. [7.6.6] reciprocal rule$\left(\frac{1}{g}{\right)}^{\prime }\left(a\right)=-\frac{{g}^{\prime }\left(a\right)}{{g}^{2}\left(a\right)}$ [7.6.7]
 Example:  As ${\mathrm{X}}^{n}$, $\sqrt{\mathrm{X}}$ as well as sin and exp are differentiable functions due to [7.3.3/5] and [7.5.8/9] the derivation rules guarantee the following functions to be differentiable at the respectively chosen points. Their derivate numbers are calculated according to 1. to 7. $\left({\mathrm{X}}^{2}+\mathrm{sin}{\right)}^{\prime }\left(\mathrm{\pi }\right)=\left({\mathrm{X}}^{2}{\right)}^{\prime }\left(\mathrm{\pi }\right)+{\mathrm{sin}}^{\prime }\left(\mathrm{\pi }\right)=2\mathrm{\pi }+\mathrm{cos}\mathrm{\pi }=2\mathrm{\pi }-1$ $\left({\mathrm{X}}^{3}\sqrt{\mathrm{X}}{\right)}^{\prime }\left(4\right)=\left({\mathrm{X}}^{3}{\right)}^{\prime }\left(4\right)\cdot \sqrt{\mathrm{X}}\left(4\right)+{\mathrm{X}}^{3}\left(4\right)\cdot {\sqrt{\mathrm{X}}\phantom{\rule{0.1em}{0ex}}}^{\prime }\left(4\right)=3\cdot {4}^{2}\cdot \sqrt{4}+{4}^{3}\frac{1}{2\sqrt{4}}=112$ $\left(\frac{7}{\mathrm{exp}}{\right)}^{\prime }\left(0\right)=7\cdot \left(\frac{1}{\mathrm{exp}}{\right)}^{\prime }\left(0\right)=7\cdot \left(-\frac{{\mathrm{exp}}^{\prime }\left(0\right)}{{\mathrm{exp}}^{2}\left(0\right)}\right)=7\cdot \left(-\frac{\mathrm{exp}0}{{\mathrm{exp}}^{2}\left(0\right)}\right)=-7$ $\left(\frac{\mathrm{X}}{\mathrm{X}-1}{\right)}^{\prime }\left(5\right)=\frac{{\mathrm{X}}^{\prime }\left(5\right)\cdot \left(\mathrm{X}-1\right)\left(5\right)-\mathrm{X}\left(5\right)\cdot \left(\mathrm{X}-1{\right)}^{\prime }\left(5\right)}{{\left(\mathrm{X}-1\right)}^{2}\left(5\right)}=\frac{1\cdot 4-5\cdot 1}{16}=-\frac{1}{16}$

Another, general example comes from the sum and factor rule alone:

• Each polynomial $p={a}_{n}{\mathrm{X}}^{n}+{a}_{n-1}{\mathrm{X}}^{n-1}+\dots +{a}_{1}\mathrm{X}+{a}_{0}$ is differentiable at every a (a fact also known from [7.5.6]). Its derivative is in fact merely the derivative of the monomials involved:

${p}^{\prime }\left(a\right)={a}_{n}n{a}^{n-1}+{a}_{n-1}\left(n-1\right){a}^{n-2}+\dots {a}_{2}2a+{a}_{1}$[7.6.8]

We found out the values for ${\mathrm{sin}}^{\prime }\left(a\right)$ and ${\mathrm{cos}}^{\prime }\left(a\right)$ in [7.5.9/10] (click for a calculation without power series methods). The quotient rule now enables us to easily differentiate the remaining trigonometric functions tan and cot.

Proposition:  tan is differentiable at each $a\ne \left(2k-1\right)\frac{\mathrm{\pi }}{2}$ and cot at each $a\ne k\mathrm{\pi }$. Their derivative numbers calculate to

 ${\mathrm{tan}}^{\prime }\left(a\right)=\frac{1}{{\mathrm{cos}}^{2}\left(a\right)}$ [7.6.9] ${\mathrm{cot}}^{\prime }\left(a\right)=-\frac{1}{{\mathrm{sin}}^{2}\left(a\right)}$ [7.6.10]

Proof:  The quotient rules guarantees the differentiability of tan and cot. We use Pythagoras' theorem (${\mathrm{sin}}^{2}+{\mathrm{cos}}^{2}=1$) to calculate

1.  ${\mathrm{tan}}^{\prime }\left(a\right)=\left(\frac{\mathrm{sin}}{\mathrm{cos}}{\right)}^{\prime }\left(a\right)=\frac{{\mathrm{sin}}^{\prime }\left(a\right)\cdot \mathrm{cos}a-\mathrm{sin}a\cdot {\mathrm{cos}}^{\prime }\left(a\right)}{{\mathrm{cos}}^{2}\left(a\right)}=\frac{{\mathrm{cos}}^{2}\left(a\right)+{\mathrm{sin}}^{2}\left(a\right)}{{\mathrm{cos}}^{2}\left(a\right)}=\frac{1}{{\mathrm{cos}}^{2}\left(a\right)}$

2.  ${\mathrm{cot}}^{\prime }\left(a\right)=\left(\frac{\mathrm{cos}}{\mathrm{sin}}{\right)}^{\prime }\left(a\right)=\frac{{\mathrm{cos}}^{\prime }\left(a\right)\cdot \mathrm{sin}a-\mathrm{cos}a\cdot {\mathrm{sin}}^{\prime }\left(a\right)}{{\mathrm{sin}}^{2}\left(a\right)}=\frac{-{\mathrm{sin}}^{2}\left(a\right)-{\mathrm{cos}}^{2}\left(a\right)}{{\mathrm{sin}}^{2}\left(a\right)}=\frac{-1}{{\mathrm{sin}}^{2}\left(a\right)}$

With functions it is not the basic arithmetics alone that are worth checking for compatibility but testing the composition is often rewarding as well. In our case this results in a further, and actually comfortable derivation rule.

Proposition:  Let  $f:B\to ℝ$ and $g:A\to ℝ$ be any two functions, $a\in A$ an accumulation point of A such that $g\left(a\right)$ is a member and an accumulation point of B. If g is differentiable at a and  f differentiable at $g\left(a\right)$ then  $f\circ g$ is differentiable at a due to the

 chain rule$\left(f\circ g{\right)}^{\prime }\left(a\right)={f}^{\prime }\left(g\left(a\right)\right)\cdot {g}^{\prime }\left(a\right)$ [7.6.11]

Proof:  We use the representation theorem [7.5.1] to find two functions $r:A\to ℝ$ and $s:B\to ℝ$, r continuous at a, s continuous at $g\left(a\right)$, such that $r\left(a\right)={g}^{\prime }\left(a\right),\text{\hspace{0.17em}}s\left(g\left(a\right)\right)={f}^{\prime }\left(g\left(a\right)\right)$ and

$\begin{array}{l}g=g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\hfill \\ f=f\left(g\left(a\right)\right)+\left(\mathrm{X}-g\left(a\right)\right)\cdot s\hfill \end{array}$

Thus the composit  $f\circ g$ could be calculated like this (note that $\circ$ is distributive from the right in respect to the first rules of arithmetic, X is the identity element and a constant function reproduces itself if it is the left input for $\circ$ ):

$\begin{array}{ll}f\circ g\phantom{\rule{0.2em}{0ex}}\hfill & =\left(f\left(g\left(a\right)\right)+\left(\mathrm{X}-g\left(a\right)\right)\cdot s\right)\circ \left(g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\right)\hfill \\ \hfill & =f\left(g\left(a\right)\right)+\left(g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r-g\left(a\right)\right)\cdot s\circ \left(g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\right)\hfill \\ \hfill & =f\circ g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\cdot s\circ \left(g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\right)\hfill \end{array}$

As r and s are continuous at the points mentioned above we see that $t≔r\cdot s\circ \left(g\left(a\right)+\left(\mathrm{X}-a\right)\cdot r\right)$ is continuous at a due to the calculation rules for continuous functions.  $f\circ g$ is thus differentiable at a according to the representation theorem with

$\left(f\circ g{\right)}^{\prime }\left(a\right)=t\left(a\right)=r\left(a\right)\cdot s\left(g\left(a\right)\right)={g}^{\prime }\left(a\right)\cdot {f}^{\prime }\left(g\left(a\right)\right)$

Consider:

• The chain rule is easy to apply. We only need to multiply two derivatives which are specially named in this context:

${f}^{\prime }\left(g\left(a\right)\right)$ is called the outer derivative of  $f\circ g$

(which actually means: the derivative of the outer function  f at the inner point $g\left(a\right)$)

${g}^{\prime }\left(a\right)$ is called the inner derivative of  $f\circ g$

(which means: the derivative of the inner function g at the original point a)

• The inner derivative is likely to be forgotten, so it is essential to memorise:

Having derivated the outer function one has to derivate further, that means to multiply times the inner derivative.

• In most examples the chain rule is applied to functions that do not show the symbol $\circ$ in their names! So it is useful to know the following identities:

The last example leads to a derivation rule for generalised power functions:

Proposition:  For any $n\in {ℕ}^{\ast }$ we have: If  $f:A\to ℝ$ is differentiable at a, so is  ${f}^{n}$ with

 $\left({f}^{n}{\right)}^{\prime }\left(a\right)=n{f}^{n-1}\left(a\right)\cdot {f}^{\prime }\left(a\right)$ [7.6.12]

Proof:  ${\mathrm{X}}^{n}$ is differentiable anywhere, especially at  $f\left(a\right)$, so that  ${f}^{n}={\mathrm{X}}^{n}\circ f$ is differentiable at a due to the chain rule. The derivative calculates as follows:

$\left({f}^{n}{\right)}^{\prime }\left(a\right)=\left({\mathrm{X}}^{n}{\right)}^{\prime }\left(f\left(a\right)\right)\cdot {f}^{\prime }\left(a\right)=n{f}^{n-1}\left(a\right)\cdot {f}^{\prime }\left(a\right)$

 Example:  All functions involved are differentiable at the respective points. Thus their composits can be derivated using 8. and 9. $\left({\mathrm{sin}}^{8}{\right)}^{\prime }\left(0\right)=8\cdot {\mathrm{sin}}^{7}\left(0\right)\cdot {\mathrm{sin}}^{\prime }\left(0\right)=8\cdot 0\cdot 1=0$ $\left(\left({\mathrm{X}}^{3}-3\mathrm{X}{\right)}^{5}{\right)}^{\prime }\left(2\right)=5\left({2}^{3}-3\cdot 2{\right)}^{4}\cdot \left({\mathrm{X}}^{3}-3\mathrm{X}{\right)}^{\prime }\left(2\right)=5\cdot {2}^{4}\cdot \left(3\cdot {2}^{2}-3\right)=720$ $|{\mathrm{X}}^{2}-5{|}^{\prime }\left(1\right)=|\mathrm{X}{|}^{\prime }\left(-4\right)\cdot \left({\mathrm{X}}^{2}-5{\right)}^{\prime }\left(1\right)=-2$ ${\sqrt{|{\mathrm{X}}^{2}-5|}\phantom{\rule{0.1em}{0ex}}}^{\prime }$

 7.5. 7.7.