6 Differentiation
One of the most important concepts in analysis is differentiability of a function or its derivative. It plays an essential role for many applications in physics or engineering where one considers the rate in which a quantity changes. In mathematical terms this corresponds to determining the slope of a function at a certain point.
Here, “linear” has to be understood as “affine linear”. While in linear algebra, a linear function always has the property that its graph contains the point \((0,0),\) here we allow arbitrary lines as graphs.
If we proceed analogously for nonlinear functions, we will however, only obtain the average slope in the interval between \(x_0\) and \(x.\) This average slope can be interpreted as the slope of the secant \(s\) that connects the two points \((x_0,f(x_0))\) and \((x,f(x))\) on the graph of \(f.\) To obtain the derivative of \(f\) in the point \(x_0\) one considers the limit case \(x \to x_0.\) In this case, the secant becomes a tangent to the graph of \(f\) in the point \((x_0,f(x_0))\) whose slope is interpreted as the slope of \(f\) in \(x_0.\) For a graphical depiction, see Figure 6.2. As the figure illustrates, the slopes of a secant and an associated tangent can differ vastly.
6.1 Differentiability
Now we want to define when a function is actually differentiable at some point of its domain. For this we are going to make use of the limit of the difference quotient as follows.
Let \(D \subseteq {\mathbb{R}}\) and \(f:D \to {\mathbb{R}}.\)
The function \(f\) is called differentiable in \(x_0 \in D\), if \(x_0\) is an accumulation point of \(D\) and if the limit \[f'(x_0) := \lim_{x \to x_0} \frac{f(x)-f(x_0)}{x-x_0}\] exists. In this case, \(f'(x_0)\) is called the derivative of \(f\) in \(x_0\).
The function \(f\) is called differentiable, if \(f\) is differentiable in all \(x_0 \in D.\) In this case, the function \(f':D \to {\mathbb{R}},\) \(x \mapsto f'(x)\) is called the derivative of \(f\).
A notation often used for the difference quotient makes use of the abbreviation \(\Delta x := x - x_0.\) Then we can eliminate \(x_0\) in the difference quotient and obtain \[\frac{f(x+\Delta x) - f(x)}{\Delta x}\] instead. Since the symbol \(\Delta\) is often used for differences, we can also write the numerator as \(\Delta f(x) = f(x+ \Delta x) - f(x).\) Thus, for the derivative we obtain \[\tag{6.1} f'(x) = \lim_{\Delta x \to 0} \frac{\Delta f(x)}{\Delta x} =: \frac{\mathrm{d}f}{\mathrm{d}x}(x).\]
The notation defined on the right-hand side of (6.1) goes back to the German mathematician Gottfried Wilhelm Leibniz from the late 17th century who introduced differential calculus without the availability of limits. The idea behind this was to imagine \(\mathrm{d}f(x)\) and \(\mathrm{d}x\) as “infinitesimal” (i. e., infinitely small) changes of \(f(x)\) and \(x\) in contrast to the finite but small differences \(\Delta f(x)\) and \(\Delta x.\) The notations \(\frac{\mathrm{d}}{\mathrm{d}x}f\) or \(\frac{\mathrm{d}f}{\mathrm{d}x}\) are still very common notations for the derivative \(f'\) of \(f\) up to now.
Let \(f: {\mathbb{R}}\to {\mathbb{R}}\) be constant, i. e., \(f(x) = c\) with \(c \in {\mathbb{R}}\) for all \(x \in {\mathbb{R}}.\) Then \(f\) is differentiable and \(f' = 0,\) since for arbitrary \(x_0 \in {\mathbb{R}}\) it holds that \[f'(x_0) = \lim_{x \to x_0}\frac{f(x)-f(x_0)}{x-x_0} = \lim_{x \to x_0}\frac{c-c}{x-x_0} = 0.\] This result is also clear from intuition, since any constant function has a slope \(f'(x_0) = 0.\)
The identity function \(\operatorname{id}_{\mathbb{R}}: {\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto x\) is differentiable and \(\operatorname{id}_{\mathbb{R}}' = 1\) (where with “\(1\)” we mean the constant function \(1:{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto 1\)). This is because for every \(x_0 \in {\mathbb{R}}\) we obtain \[\operatorname{id}_{\mathbb{R}}'(x_0) = \lim_{x \to x_0}\frac{\operatorname{id}_{\mathbb{R}}(x)-\operatorname{id}_{\mathbb{R}}(x_0)}{x-x_0} = \lim_{x \to x_0}\frac{x-x_0}{x-x_0} = 1.\]
The exponential function \(\exp:{\mathbb{R}}\to {\mathbb{R}}\) is differentiable. We will prove this with the alternative notation of the difference quotients, where for simplicity we write \(h:=\Delta x.\) As in the proof of continuity we consider two cases:
Case 1: The exponential function is differentiable in \(x=0.\) It holds that \[\exp'(0) = \lim_{h \to 0} \frac{\exp(h) - \exp(0)}{h} = \lim_{h \to 0} \frac{\exp(h)-1}{h}.\] For calculating the limit we make use of the series representation of the exponential function. Because of \(\exp(h) = 1 + h + R_1(h)\) with \(R_1(h) = \sum_{k=2}^\infty \frac{h^k}{k!}\) we obtain with the help of the remainder term estimate in Remark 3.6 that \[\left| \frac{\exp(h)-1}{h} -1 \right| = \frac{\left|\exp(h)-1-h\right|}{|h|} = \frac{\left|R_1(h)\right|}{|h|} \le \frac{2|h|^2}{2|h|} = |h|\] for \(1 \ge 2\left(|h|-1\right),\) i. e., for \(|h| \le \frac{3}{2}.\) From that we obtain \[\lim_{h \to 0} \left( \frac{\exp(h)-1}{h}-1 \right) = 0,\] or in other words, \[\exp'(0) = \lim_{h \to 0} \frac{\exp(h)-1}{h} = 1 = \exp(0).\]
Case 2: The exponential function is differentiable in all \(x \in {\mathbb{R}}.\) For arbitrary \(x \in {\mathbb{R}}\) we have \[\begin{aligned} \lim_{h \to 0} \frac{\exp(x+h) - \exp(x)}{h} &= \lim_{h \to 0} \frac{\exp(x)\exp(h) - \exp(x)}{h} \\ &= \exp(x) \cdot \frac{\exp(h)-1}{h} \stackrel{\text{Case 1}}{=} \exp(x). \end{aligned}\] Hence, \(\exp'(x) = \exp(x)\) for all \(x \in {\mathbb{R}}.\) Thus, the exponential function is identical with its derivative.
The derivative \(f'(x_0)\) does not only provide us with information about the slope of the function \(f\) at the point \(x_0,\) but also with a description of the tangent \(t\) touching the graph of \(f\) at \(x_0.\) It is given by \[t: {\mathbb{R}}\to {\mathbb{R}}, \quad t(x) = f(x_0) + f'(x_0)(x-x_0)\] and can be interpreted as the best linear approximation of \(f\) at \(x_0.\)
Let us analyze the error that we make when approximating \(f\) by its tangent \(t\) at \(x_0,\) i. e., we consider the error or remainder function \[R: D \to {\mathbb{R}}, \quad x \mapsto R(x) := f(x) - t(x) = f(x) - f(x_0) - f'(x_0)(x-x_0).\] The error becomes “arbitrarily small” when “\(x\) is near \(x_0\)”, i. e., \(\lim_{x \to x_0} R(x) = 0.\) The latter condition can however also be fulfilled by a “bad” linear approximation of \(f,\) see Figure 6.3 for an illustration. Therefore, it is more interesting to consider the relative error \[\frac{R(x)}{x-x_0}\] as a measure for the quality of a linear approximation and to call a linear approximation “good”, if \(\lim_{x \to x_0} \frac{R(x)}{x-x_0} = 0.\)
The following theorem states that a function can be well-approximated by a linear function at \(x_0,\) if and only if it is differentiable in \(x_0.\)
Let \(D \subseteq {\mathbb{R}},\) \(f: D \to {\mathbb{R}},\) and let \(x_0 \in D\) be an accumulation point of \(D.\) Then the following statements are equivalent:
The function \(f\) is differentiable in \(x_0.\)
There exists an \(m \in {\mathbb{R}}\) and a function \(R:D \to {\mathbb{R}}\) such that for all \(x \in D\) it holds that \[f(x) = f(x_0) + m\cdot(x-x_0) + R(x), \quad \text{where } \lim_{x \to x_0} \frac{R(x)}{x-x_0} = 0.\]
If one of these conditions is fulfilled (and hence both of them), then the parameter \(m\) in ii is uniquely determined and we have \(m = f'(x_0).\)
Proof. “i \(\Longrightarrow\) ii”: Let \(f\) be differentiable in \(x_0.\) Then we set \[m:= f'(x_0) = \lim_{x \to x_0} \frac{f(x)-f(x_0)}{x-x_0}\] and for \(R(x) := f(x)-f(x_0) - m\cdot(x-x_0)\) we obtain \[\lim_{x \to x_0} \frac{R(x)}{x-x_0} = \lim_{x \to x_0} \left(\frac{f(x)-f(x_0)}{x-x_0} - \frac{m\cdot(x-x_0)}{x-x_0} \right) = m - m = 0,\] hence ii is satisfied.
“ii \(\Longrightarrow\) i”: Let \(m\) and \(R\) be as in ii. Then we have \[\frac{f(x)-f(x_0)}{x-x_0} = \frac{f(x_0) + m\cdot(x-x_0) + R(x) - f(x_0)}{x-x_0} = m + \frac{R(x)}{x-x_0}.\] With this we obtain \[\lim_{x \to x_0} \frac{f(x)-f(x_0)}{x-x_0} = m + \lim_{x \to x_0} \frac{R(x)}{x-x_0} = m.\] Hence, \(f\) is differentiable in \(x_0\) and it holds that \(f'(x_0) = m.\)
Video 6.1. Derivatives and linear approximation.
The fact that differentiable functions have a unique best linear approximation in every point \(x_0\) of their domain is often exploited in applied mathematics, for example to compute approximate solutions to the original nonlinear problem. The nonlinear problem is then approximated by a linear one which is solved instead. Usually, for linear problems, there is a much richer theory that allows us to analyze and solve the surrogate problem easily. We will illustrate this linearization principle for the problem of finding a root of a differentiable function \(f: {\mathbb{R}}\to {\mathbb{R}}.\) For that, we choose an initial point \(x_0\) close to the root we wish to compute. The function \(f\) can be approximated by a tangent \(t_0\) touching \(f\) at \(x_0.\) Thus, for \(x\) near \(x_0\) it holds that \[f(x) \approx t_0(x) = f(x_0)+f'(x_0)(x-x_0).\] The zero of the tangent \(t_0\) can be easily determined. Solving \(t_0(x_1) = 0\) for \(x_1\) gives \[x_1 = x_0 - \frac{f(x_0)}{f'(x_0)}\] under the assumption that \(f'(x_0) \neq 0.\) Of course, the value \(x_1\) is just an approximation of the root of \(f\) but often, it is much better than the initial guess \(x_0.\) Repeating the procedure explained above for the initial guess \(x_1\) instead of \(x_0\) leads to the iterative scheme \[\tag{6.2} x_{n+1} := x_n - \frac{f(x_n)}{f'(x_n)},\] that is well-known as Newton’s method, see Figure 6.4 for a depiction. Note that the scheme is only well-defined, if \(f'(x_n) \neq 0\) for all \(n \in {\mathbb{N}}.\) In later modules, this method will be analyzed in more detail, for example it is clarified under which assumptions and how fast the method converges.
Let us apply Newton’s method to \(f:{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto x^2-2\) to find its positive root \(x_* = \sqrt{2}.\) From high-school you probably remember that \(f': {\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto 2x.\) After choosing an initial value \(x_0,\) the iteration scheme (6.2) reduces to \[x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} = x_n - \frac{x_n^2-2}{2x_n} = \frac{2x_n^2 - x_n^2 + 2}{2x_n} = \frac{1}{2}\left( x_n + \frac{2}{x_n} \right).\] This is exactly the scheme we have already seen in Example 2.1 v or Theorem 2.9 for \(c=2.\) In the latter result we have shown that the sequence \({(x_n)}_{n \in {\mathbb{N}}}\) converges towards \(\sqrt{c} = \sqrt{2}\) for an arbitrary initial value \(x_0.\) Moreover, typically Newton’s methods returns an accurate result much faster compared to the method of nested intervals (cf. Theorem 2.15). To convince the reader, the first ten elements of the “root sequence” \({(x_n)}_{n \in {\mathbb{N}}}\) for \(x_0 = 2\) as well as those of the sequences of interval bounds \({(a_n)}_{n \in {\mathbb{N}}}\) and \({(b_n)}_{n \in {\mathbb{N}}}\) from Theorem 2.15 with \(a_0=0\) and \(b_0=2\) are listed in the table in Figure 6.5. We know that all sequences converge towards \(\sqrt{2}.\) However, the first eight digits of the elements of the “root sequence” are correct after the fourth iteration, while the the sequences associated with the method of nested intervals have only two or three correct digits after ten iterations.
| Newton’s method | nested intervals | ||
| \(n\) | \(x_n\) | \(a_n\) | \(b_n\) |
| \(0\) | \(2.00000000\) | \(0.00000000\) | \(2.00000000\) |
| \(1\) | \(\underline{1}.50000000\) | \(\underline{1}.00000000\) | \(2.00000000\) |
| \(2\) | \(\underline{1.41}666667\) | \(\underline{1}.00000000\) | \(\underline{1}.50000000\) |
| \(3\) | \(\underline{1.41421}569\) | \(\underline{1}.25000000\) | \(\underline{1}.50000000\) |
| \(4\) | \(\underline{1.41421356}\) | \(\underline{1}.37500000\) | \(\underline{1}.50000000\) |
| \(5\) | \(\underline{1.41421356}\) | \(\underline{1}.37500000\) | \(\underline{1.4}3750000\) |
| \(6\) | \(\underline{1.41421356}\) | \(\underline{1.4}0625000\) | \(\underline{1.4}3750000\) |
| \(7\) | \(\underline{1.41421356}\) | \(\underline{1.4}0625000\) | \(\underline{1.4}2187500\) |
| \(8\) | \(\underline{1.41421356}\) | \(\underline{1.414}06250\) | \(\underline{1.4}2187500\) |
| \(9\) | \(\underline{1.41421356}\) | \(\underline{1.414}06250\) | \(\underline{1.41}796875\) |
| \(10\) | \(\underline{1.41421356}\) | \(\underline{1.414}06250\) | \(\underline{1.41}601563\) |
In Chapter 4 we have discussed continuity of functions in detail. A question may be how continuity and differentiability are related with each other. This is clarified in the next theorem.
Let \(D \subseteq {\mathbb{R}}\) and let \(f:D \to {\mathbb{R}}\) be differentiable in \(x_0 \in D.\) Then \(f\) is continuous in \(x_0.\)
Proof. Let \(f\) be differentiable in \(x_0.\) Then by Theorem 6.1, the function \(R:D \to {\mathbb{R}},\) \(x \mapsto f(x) - f(x_0) - f'(x_0)(x-x_0)\) satisfies \(\lim_{x \to x_0} \frac{R(x)}{x-x_0} = 0.\) Since \[f(x) = f(x_0) + f'(x_0)(x-x_0) + R(x) = f(x_0) + f'(x_0)(x-x_0) + \frac{R(x)}{x-x_0}\cdot(x-x_0),\] we obtain \(\lim_{x \to x_0} f(x) = f(x_0),\) i. e., \(f\) is continuous in \(x_0.\)
The converse of Theorem 6.2 is not true! A simple counter-example is the absolute value function \(f:{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto |x|\) that is continuous by Example 4.3 ii. However, it is not differentiable since \[\frac{f(x)-f(0)}{x-0} = \frac{|x|}{x}\] and \[\lim_{x\searrow 0}\frac{f(x)-f(0)}{x-0} = 1 \quad \text{and} \quad \lim_{x\nearrow 0}\frac{f(x)-f(0)}{x-0} = -1.\] Thus, the limit \(\lim_{x \to 0} \frac{f(x)-f(0)}{x-0}\) does not exist. Hence, the absolute value function is not differentiable in \(x=0.\) However, it is differentiable in \({\mathbb{R}}\setminus\{0\}\) and it holds that \[f'(x) = \begin{cases} 1, & \text{if } x>0, \\ -1, & \text{if } x<0. \end{cases}\]
For a long time, mathematicians conjectured that continuous functions are differentiable almost everywhere in the sense that there exists at most a countable set of points in which the function is not differentiable. An example for this is the absolute value function that is differentiable in entire \({\mathbb{R}}\) except the point \(x=0.\) However, one can construct continuous functions that are nowhere differentiable! Such a construction is not easy, hence we will not present the details here.
6.2 Differentiation Rules
In this section we will derive the differentiation rules that you may remember from high-school.
Let \(D \subseteq {\mathbb{R}}\) and let \(f,\,g: D \to {\mathbb{R}}\) be differentiable in \(x \in D\) and let \(c \in {\mathbb{R}}.\) Then \(f+g,\) \(cf,\) and \(f \cdot g\) are differentiable in \(x \in D\) and the following rules hold:
linearity: \((f+g)'(x) = f'(x)+g'(x)\) and \((cf)'(x) = c\cdot f'(x),\)
product rule: \((f\cdot g)'(x) = f'(x) \cdot g(x) + f(x) \cdot g'(x).\)
Proof. We recall the definition of the limit of a function in Definition 4.5. In case we want to show that \(f'(x) = \alpha\) for some \(\alpha \in {\mathbb{R}}\) we can do this by showing that for every sequence \({(x_n)}_{n \in {\mathbb{N}}}\) in \(D \setminus \{x\}\) with \(\lim_{n \to \infty} x_n = x\) it holds that \[\lim_{n \to \infty} \frac{f(x_n)-f(x)}{x_n-x} = \alpha.\]
Let \({(x_n)}_{n \in {\mathbb{N}}}\) be an arbitrary sequence in \(D \setminus \{x\}\) with \(\lim_{n \to \infty} x_n = x.\) Then \[\frac{\left(f(x_n)+g(x_n)\right)-\left(f(x)+g(x)\right)}{x_n-x} = \frac{f(x_n)-f(x)}{x_n-x} + \frac{g(x_n)-g(x)}{x_n-x}.\] Hence we have shown the first identity in i by taking the limit for \(n \to \infty.\) The second one can be shown analogously.
For ii we observe that \[\begin{aligned} \frac{f(x_n)g(x_n) - f(x)g(x)}{x_n-x} &= \frac{f(x_n)g(x_n) -f(x)g(x_n) + f(x)g(x_n) - f(x)g(x)}{x_n-x} \\ &=\frac{f(x_n)-f(x)}{x_n-x}g(x_n) + \frac{g(x_n)-g(x)}{x_n-x} f(x). \end{aligned}\] Since by Theorem 6.2, \(g\) is continuous in \(x,\) we have \(\lim_{n \to \infty}g(x_n) = g(x).\) Hence, \[\lim_{n \to \infty}\frac{f(x_n)g(x_n) - f(x)g(x)}{x_n-x} = f'(x)g(x) + g'(x)f(x).\]
Video 6.2. Linearity and product rule.
The “linearity” of the differentiation in Theorem 6.3 i refers to the fact the set \({\mathcal{D}}(D,{\mathbb{R}})\) of differentiable functions \(D \to {\mathbb{R}}\) forms a subspace of the set \(\operatorname{Map}(D,{\mathbb{R}})\) of all functions \(D \to {\mathbb{R}}.\) Then the differentiation \[\frac{\mathrm{d}}{\mathrm{d}x}:{\mathcal{D}}(D,{\mathbb{R}}) \to \operatorname{Map}(D,{\mathbb{R}}), \quad f \mapsto f'\] is a linear mapping in the sense of linear algebra.
The function \(f_n: {\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto x^n\) is differentiable for each \(n \in {\mathbb{N}}\setminus\{0\}\) and its derivative is \(f_n':{\mathbb{R}}\to {\mathbb{R}},\) \(x\mapsto n\cdot x^{n-1}.\) We show this by induction.
Induction base: The statement is true for \(n=1,\) since \(f_1 = \operatorname{id}_{\mathbb{R}}\) with \(f_1' = 1,\) cf. Example 6.1 ii.
Induction hypothesis (IH): We assume that the statement is true for \(n = k.\)
Induction step: We show that the statement is also true for \(n = k+1.\) We have \(f_{k+1}(x) = x\cdot x^k = f_1(x)\cdot f_k(x)\) and by the induction hypothesis, \(f_k\) is differentiable. Then by the product rule we obtain \[f_{k+1}'(x) = 1\cdot x^k + x\cdot kx^{k-1} = (k+1)x^k.\] This completes the proof.
For the special case \(n=2\) we obtain \[f_2:{\mathbb{R}}\to {\mathbb{R}}, \quad x\mapsto x^2 \quad \text{and} \quad f_2':{\mathbb{R}}\to {\mathbb{R}}, \quad x \mapsto 2x,\] which we we have already used in Example 6.2.Using i we immediately obtain the differentiability of every polynomial function. Let \(p:{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto \sum_{k=0}^n a_k x^k,\) then we have \[p':{\mathbb{R}}\to {\mathbb{R}}, \quad x \mapsto \sum_{k=1}^n k a_k x^{k-1}.\] (Note that the first summand in \(p\) for \(k=0\) is constant, hence its derivative is zero and the sum in \(p'\) starts at \(k=1.\))
Let \(D,\,\widetilde{D} \subseteq {\mathbb{R}},\) \(f:D \to {\mathbb{R}}\) be differentiable in \(x \in D.\) Let further \(f(D) \subseteq \widetilde{D}\) and \(g:\widetilde{D} \to {\mathbb{R}}\) be differentiable in \(f(x).\) Then \(g \circ f\) is differentiable in \(x\) and it holds that \[(g \circ f)'(x) = g'(f(x)) \cdot f'(x).\]
Proof. Let \({(x_n)}_{n \in {\mathbb{N}}}\) be an arbitrary sequence in \(D\setminus\{x\}\) and \(\lim_{n \to \infty} x_n = x.\) If \(f(x_n) \neq f(x)\) for all \(n \in {\mathbb{N}},\) then we get \[\tag{6.3} \frac{g\left(f(x_n)\right) - g(f(x))}{x_n-x} = \frac{g\left(f(x_n)\right) - g(f(x))}{f(x_n)-f(x)} \cdot \frac{f(x_n) - f(x)}{x_n-x}.\] When taking the limit for \(n \to \infty\) then we get \((g \circ f)'(x) = g'(f(x)) \cdot f'(x),\) since \(f\) is differentiable in \(x,\) \(g\) is differentiable in \(f(x),\) and \({(f(x_n))}_{n \in {\mathbb{N}}}\) is a sequence in \(\widetilde{D}\setminus\{f(x)\}\) that converges towards \(f(x)\) because of the continuity of \(f\) in \(x\) (cf. Theorem 6.2).
However, we cannot exclude the case that \(f(x_n) = f(x)\) for some \(n \in {\mathbb{N}}.\) So more generally, we consider the function \[g^*:\widetilde{D} \to {\mathbb{R}}, \quad y \mapsto \begin{cases} \frac{g(y)-g(f(x))}{y-f(x)}, & \text{if } y \neq f(x), \\ g'(f(x)), & \text{if } y = f(x). \end{cases}\] Since \(g\) is differentiable in \(f(x),\) it holds that \(\lim_{n \to \infty} g^*(f(x_n)) = g'(f(x)).\) Moreover, for all \(x \in D\) it holds that \[\frac{g(f(x_n))-g(f(x))}{x_n-x} = g^*\left(f(x_n)\right) \cdot \frac{f(x_n)-f(x)}{x_n-x},\] since for \(f(x_n) \neq f(x)\) this is exactly (6.3) and for \(f(x_n) = f(x),\) both sides of the equation are zero. With this we finally obtain \[\lim_{n \to \infty} \frac{g\left(f(x_n)\right) - g(f(x))}{x_n-x} = \lim_{n \to \infty} \left(g^*\left(f(x_n)\right) \cdot \frac{f(x_n)-f(x)}{x_n-x} \right) = g'(f(x)) \cdot f'(x).\]
Video 6.3. Chain rule.
The function \(f:{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto \mathrm{e}^{\lambda x}\) is differentiable for each \(\lambda \in {\mathbb{R}}\) and it holds that \(f':{\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto \lambda\mathrm{e}^{\lambda x}.\) This is due to \(f = \exp \circ \left( \lambda\cdot\operatorname{id}_{\mathbb{R}}\right)\) and hence, for all \(x \in {\mathbb{R}}\) we have \[f'(x) = \exp'\left( \left(\lambda\cdot\operatorname{id}_{\mathbb{R}}\right)(x) \right) \cdot \left(\lambda\cdot\operatorname{id}_{\mathbb{R}}\right)'(x) = \exp(\lambda x)\cdot\lambda = \lambda\mathrm{e}^{\lambda x}.\]
As a special case of i we obtain the derivatives of general exponential functions. Let \(a > 0\) and \(f: {\mathbb{R}}\to {\mathbb{R}},\) \(x \mapsto a^x = \mathrm{e}^{(\ln a)\cdot x}.\) Then we obtain \(f'(x) = (\ln a) \cdot a^x\) for all \(x \in {\mathbb{R}}.\)
All we have said up to now about differentiation can be extended without problems to functions of the form \(f: D \to {\mathbb{C}}\) or \(f:{\mathbb{C}}\to {\mathbb{R}}.\) Differentiability of functions with general complex domains has some special features that we will not discuss in detail here. This will be topic of module M07: “Analysis III”.
Now another special case of Example 6.4 i is the function \(f:{\mathbb{R}}\to {\mathbb{C}},\) \(x \mapsto \mathrm{e}^{\mathrm{i}x}\) which is differentiable with \(f':{\mathbb{R}}\to {\mathbb{C}},\) \(x \mapsto \mathrm{i}\mathrm{e}^{\mathrm{i}x}.\) This will be of use the next example.
Recall that by Remark 5.6 ii for all \(x\in{\mathbb{R}}\) we have that \[\cos(x) = \mathop{\mathrm{Re}}\left(\mathrm{e}^{\mathrm{i}x}\right) = \frac{\mathrm{e}^{\mathrm{i}x} + \mathrm{e}^{-\mathrm{i}x}}{2} \quad\text{and}\quad \sin(x) = \mathop{\mathrm{Im}}\left(\mathrm{e}^{\mathrm{i}x}\right) = \frac{\mathrm{e}^{\mathrm{i}x}- \mathrm{e}^{-\mathrm{i}x}}{2\mathrm{i}}.\] By exploiting Theorem 6.3, both sine and cosine are differentiable and for all \(x \in {\mathbb{R}}\) we obtain the derivatives \[\begin{aligned} \cos'(x) &= \frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\mathrm{e}^{\mathrm{i}x} + \mathrm{e}^{-\mathrm{i}x}}{2}\right) = \frac{\mathrm{i}\mathrm{e}^{\mathrm{i}x}-\mathrm{i}\mathrm{e}^{-\mathrm{i}x}}{2} = \frac{-\mathrm{e}^{\mathrm{i}x} + \mathrm{e}^{-\mathrm{i}x}}{2\mathrm{i}} = -\sin(x), \\ \sin'(x) &= \frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\mathrm{e}^{\mathrm{i}x} - \mathrm{e}^{-\mathrm{i}x}}{2\mathrm{i}}\right) = \frac{\mathrm{i}\mathrm{e}^{\mathrm{i}x}+\mathrm{i}\mathrm{e}^{-\mathrm{i}x}}{2\mathrm{i}} = \frac{\mathrm{e}^{\mathrm{i}x} + \mathrm{e}^{-\mathrm{i}x}}{2} = \cos(x). \end{aligned}\]
The function \(\mathop{\mathrm{inv}}:{\mathbb{R}}\setminus\{0\} \to {\mathbb{R}},\) \(x \mapsto \frac{1}{x}\) is differentiable with derivative \(\mathop{\mathrm{inv}}':{\mathbb{R}}\setminus\{0\} \to {\mathbb{R}},\) \(x \mapsto -\frac{1}{x^2}.\)
Proof. Let \(x \in {\mathbb{R}}\setminus\{0\}\) be arbitrary. Then for each \(h \in {\mathbb{R}}\setminus\{0,-x\}\) we obtain \[\frac{\mathop{\mathrm{inv}}(x+h)-\mathop{\mathrm{inv}}(x)}{h} = \frac{\frac{1}{x+h} - \frac{1}{x}}{h} = \frac{\frac{x-(x+h)}{x(x+h)}}{h} = \frac{-h}{h\cdot x(x+h)} = \frac{-1}{x(x+h)}.\] Thus, we get \[\mathop{\mathrm{inv}}'(x) = \lim_{h \to 0} \frac{\mathop{\mathrm{inv}}(x+h) - \mathop{\mathrm{inv}}(x)}{h} = -\frac{1}{x^2}.\]
Let \(D \subseteq {\mathbb{R}}\) and \(f,\,g:D \to {\mathbb{R}}\) be differentiable in \(x \in D\) and \(0 \not\in g(D).\) Then \(\frac{f}{g}\) is differentiable in \(x\) and \[\left(\frac{f}{g}\right)'(x) = \frac{f'(x)g(x) - f(x)g'(x)}{g(x)^2}.\]
Proof. It holds that \[\frac{f}{g} = f\cdot\left( \mathop{\mathrm{inv}}\circ g\right).\] Thus, combining the product and the chain rule and using Lemma 6.5 we obtain the differentiability of \(\frac{f}{g}\) as well as \[\begin{aligned} \left(\frac{f}{g}\right)'(x) &= f'(x)\cdot\mathop{\mathrm{inv}}(g(x)) + f(x)\cdot\mathop{\mathrm{inv}}'(g(x))\cdot g'(x) \\ &= f'(x)\cdot\frac{1}{g(x)} - f(x) \cdot\frac{g'(x)}{g^2(x)} \\ &= \frac{f'(x)g(x) - f(x)g'(x)}{g(x)^2}. \end{aligned}\]
Video 6.4. Quotient rule.
Rational functions are differentiable in their entire domain and their derivatives are again rational functions.
The function \(\tan:D \to {\mathbb{R}},\) \(x \mapsto \frac{\sin x}{\cos x}\) with \(D = {\mathbb{R}}\setminus \left\{ \frac{\pi}{2} + k\pi \; | \; k \in {\mathbb{Z}}\right\}\) is differentiable and we have \(\tan': D \to {\mathbb{R}}\) where for all \(x \in D\) it holds that \[\begin{aligned} \tan'(x) = \left(\frac{\sin}{\cos}\right)'(x) &= \frac{\cos x\cdot\cos x - \sin x \cdot (-\sin x)}{\cos^2 x} \\ &= \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = 1 + \tan^2 x. \end{aligned}\] An alternative representation is \[\tan'(x) = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x}.\]