Skip to main content
Logo image

Section 4.1 The derivative

Note: 1 lecture
The idea of a derivative is the following. If the graph of a function looks locally like a straight line, then we can then talk about the slope of this line. The slope tells us the rate at which the value of the function is changing at that particular point. Of course, we are leaving out any function that has corners or discontinuities. Let us be precise.

Subsection 4.1.1 Definition and basic properties

Definition 4.1.1.

Let \(I\) be an interval, let \(f \colon I \to \R\) be a function, and let \(c \in I\text{.}\) If the limit
\begin{equation*} L \coloneqq \lim_{x \to c} \frac{f(x)-f(c)}{x-c} \end{equation*}
exists, then we say \(f\) is differentiable at \(c\text{,}\) we call \(L\) the derivative of \(f\) at \(c\text{,}\) and we write \(f'(c) \coloneqq L\text{.}\)
If \(f\) is differentiable at all \(c \in I\text{,}\) then we simply say that \(f\) is differentiable, and then we obtain a function \(f' \colon I \to \R\text{.}\) The derivative is sometimes written as \(\frac{df}{dx}\) or \(\frac{d}{dx}\bigl( f(x) \bigr)\text{.}\)
The expression \(\frac{f(x)-f(c)}{x-c}\) is called the difference quotient.
The graphical interpretation of the derivative is depicted in Figure 4.1. The left-hand plot gives the line through \(\bigl(c,f(c)\bigr)\) and \(\bigl(x,f(x)\bigr)\) with slope \(\frac{f(x)-f(c)}{x-c}\text{,}\) that is, the so-called secant line. When we take the limit as \(x\) goes to \(c\text{,}\) we get the right-hand plot, where we see that the derivative of the function at the point \(c\) is the slope of the line tangent to the graph of \(f\) at the point \(\bigl(c,f(c)\bigr)\text{.}\)

Figure 4.1. Graphical interpretation of the derivative.

We allow \(I\) to be a closed interval and we allow \(c\) to be an endpoint of \(I\text{.}\) Some calculus books do not allow \(c\) to be an endpoint of an interval, but all the theory still works by allowing it, and it makes our work easier.

Example 4.1.2.

Let \(f(x) \coloneqq x^2\) defined on the whole real line. Let \(c \in \R\) be arbitrary. We find that if \(x \not=c\text{,}\)
\begin{equation*} \frac{x^2-c^2}{x-c} = \frac{(x+c)(x-c)}{x-c} = (x+c) . \end{equation*}
Therefore,
\begin{equation*} f'(c) = \lim_{x\to c} \frac{x^2-c^2}{x-c} = \lim_{x\to c} (x+c) = 2c. \end{equation*}

Example 4.1.3.

Let \(f(x) \coloneqq ax + b\) for numbers \(a, b \in \R\text{.}\) Let \(c \in \R\) be arbitrary. For \(x \not=c\text{,}\)
\begin{equation*} \frac{f(x)-f(c)}{x-c} = \frac{a(x-c)}{x-c} = a . \end{equation*}
Therefore,
\begin{equation*} f'(c) = \lim_{x\to c} \frac{f(x)-f(c)}{x-c} = \lim_{x\to c} a = a. \end{equation*}
In fact, every differentiable function “infinitesimally” behaves like the affine function \(ax + b\text{.}\) You can guess many results and formulas for derivatives, if you work them out for affine functions first.

Example 4.1.4.

The function \(f(x) \coloneqq \sqrt{x}\) is differentiable for \(x > 0\text{.}\) To see this fact, fix \(c > 0\text{,}\) and suppose \(x \not= c\) and \(x > 0\text{.}\) Compute
\begin{equation*} \frac{\sqrt{x}-\sqrt{c}}{x-c} = \frac{\sqrt{x}-\sqrt{c}}{(\sqrt{x}-\sqrt{c})(\sqrt{x}+\sqrt{c})} = \frac{1}{\sqrt{x}+\sqrt{c}} . \end{equation*}
Therefore,
\begin{equation*} f'(c) = \lim_{x\to c} \frac{\sqrt{x}-\sqrt{c}}{x-c} = \lim_{x\to c} \frac{1}{\sqrt{x}+\sqrt{c}} = \frac{1}{2\sqrt{c}} . \end{equation*}

Example 4.1.5.

The function \(f(x) \coloneqq \abs{x}\) is not differentiable at the origin. When \(x > 0\text{,}\)
\begin{equation*} \frac{\abs{x}-\abs{0}}{x-0} = \frac{x-0}{x-0} = 1 . \end{equation*}
When \(x < 0\text{,}\)
\begin{equation*} \frac{\abs{x}-\abs{0}}{x-0} = \frac{-x-0}{x-0} = -1 . \end{equation*}
A famous example of Weierstrass shows that there exists a continuous function that is not differentiable at any point. The construction of this function is beyond the scope of this chapter. On the other hand, a differentiable function is always continuous.

Proof.

We know the limits
\begin{equation*} \lim_{x\to c}\frac{f(x)-f(c)}{x-c} = f'(c) \qquad \text{and} \qquad \lim_{x\to c}(x-c) = 0 \end{equation*}
exist. Furthermore,
\begin{equation*} f(x)-f(c) = \left( \frac{f(x)-f(c)}{x-c} \right) (x-c) . \end{equation*}
Therefore, the limit of \(f(x)-f(c)\) exists and
\begin{equation*} \lim_{x\to c} \bigl( f(x)-f(c) \bigr) = \left(\lim_{x\to c} \frac{f(x)-f(c)}{x-c} \right) \left(\lim_{x\to c} (x-c) \right) = f'(c) \cdot 0 = 0. \end{equation*}
Hence \(\lim\limits_{x\to c} f(x) = f(c)\text{,}\) and \(f\) is continuous at \(c\text{.}\)
An important property of the derivative is linearity. The derivative is the approximation of a function by a straight line. The slope of a line through two points changes linearly when the \(y\)-coordinates are changed linearly. By taking the limit, it makes sense that the derivative is linear.

Proof.

First, let \(h(x) \coloneqq \alpha f(x)\text{.}\) For \(x \in I\text{,}\) \(x \not= c\text{,}\)
\begin{equation*} \frac{h(x)-h(c)}{x-c} = \frac{\alpha f(x) - \alpha f(c)}{x-c} = \alpha \frac{f(x) - f(c)}{x-c} . \end{equation*}
The limit as \(x\) goes to \(c\) exists on the right-hand side by Corollary 3.1.12. We get
\begin{equation*} \lim_{x\to c}\frac{h(x)-h(c)}{x-c} = \alpha \lim_{x\to c} \frac{f(x) - f(c)}{x-c} . \end{equation*}
Therefore, \(h\) is differentiable at \(c\text{,}\) and the derivative is computed as given.
Next, define \(h(x) \coloneqq f(x)+g(x)\text{.}\) For \(x \in I\text{,}\) \(x \not= c\text{,}\) we have
\begin{equation*} \frac{h(x)-h(c)}{x-c} = \frac{\bigl(f(x) + g(x)\bigr) - \bigl(f(c) + g(c)\bigr)}{x-c} = \frac{f(x) - f(c)}{x-c} + \frac{g(x) - g(c)}{x-c} . \end{equation*}
The limit as \(x\) goes to \(c\) exists on the right-hand side by Corollary 3.1.12. We get
\begin{equation*} \lim_{x\to c}\frac{h(x)-h(c)}{x-c} = \lim_{x\to c} \frac{f(x) - f(c)}{x-c} + \lim_{x\to c}\frac{g(x) - g(c)}{x-c} . \end{equation*}
Therefore, \(h\) is differentiable at \(c\text{,}\) and the derivative is computed as given.
It is not true that the derivative of a product of two functions is the product of the derivatives. Instead we get the so-called product rule or the Leibniz rule 1 .
The proof of the product rule is left as an exercise. The key to the proof is the identity \(f(x) g(x) - f(c) g(c) = f(x)\bigl( g(x) - g(c) \bigr) + \bigl( f(x) - f(c) \bigr) g(c)\text{,}\) which is illustrated in Figure 4.2.

Figure 4.2. The idea of product rule. The area of the entire rectangle \(f(x)g(x)\) differs from the area of the white rectangle \(f(c)g(c)\) by the area of the lightly shaded rectangle \(f(x)\bigl( g(x) - g(c) \bigr)\) plus the darker rectangle \(\bigl( f(x) - f(c) \bigr) g(c)\text{.}\) In other words, \(\Delta (f \cdot g) = f \cdot \Delta g + \Delta f \cdot g\text{.}\)

Again, the proof is left as an exercise.

Subsection 4.1.2 Chain rule

More complicated functions are often obtained by composition, which is differentiated via the chain rule. The rule also tells us how a derivative changes if we change variables.

Proof.

Let \(d \coloneqq g(c)\text{.}\) Define \(u \colon I_2 \to \R\) and \(v \colon I_1 \to \R\) by
\begin{equation*} u(y) \coloneqq \begin{cases} \frac{f(y) - f(d)}{y-d} & \text{if } y \not=d, \\ f'(d) & \text{if } y = d, \end{cases} \qquad v(x) \coloneqq \begin{cases} \frac{g(x) - g(c)}{x-c} & \text{if } x \not=c, \\ g'(c) & \text{if } x = c. \end{cases} \end{equation*}
Because \(f\) is differentiable at \(d = g(c)\text{,}\) we find that \(u\) is continuous at \(d\text{.}\) Similarly, \(v\) is continuous at \(c\text{.}\) For any \(x\) and \(y\text{,}\)
\begin{equation*} f(y)-f(d) = u(y) (y-d) \qquad \text{and} \qquad g(x)-g(c) = v(x) (x-c) . \end{equation*}
Plug in to obtain
\begin{equation*} h(x)-h(c) = f\bigl(g(x)\bigr)-f\bigl(g(c)\bigr) = u\bigl( g(x) \bigr) \bigl(g(x)-g(c)\bigr) = u\bigl( g(x) \bigr) \bigl(v(x) (x-c)\bigr) . \end{equation*}
Therefore, if \(x \not= c\text{,}\)
\begin{equation} \frac{h(x)-h(c)}{x-c} = u\bigl( g(x) \bigr) v(x) .\tag{4.1} \end{equation}
By continuity of \(u\) and \(v\) at \(d\) and \(c\) respectively, we find \(\lim_{y \to d} u(y) = f'(d) = f'\bigl(g(c)\bigr)\) and \(\lim_{x \to c} v(x) = g'(c)\text{.}\) The function \(g\) is continuous at \(c\text{,}\) and so \(\lim_{x \to c} g(x) = g(c)\text{.}\) Hence the limit of the right-hand side of (4.1) as \(x\) goes to \(c\) exists and is equal to \(f'\bigl(g(c)\bigr) g'(c)\text{.}\) Thus \(h\) is differentiable at \(c\) and \(h'(c) = f'\bigl(g(c)\bigr)g'(c)\text{.}\)

Subsection 4.1.3 Exercises

Exercise 4.1.1.

Prove the product rule. Hint: Prove and use \(f(x) g(x) - f(c) g(c) = f(x)\bigl( g(x) - g(c) \bigr) + \bigl( f(x) - f(c) \bigr) g(c)\text{.}\)

Exercise 4.1.2.

Prove the quotient rule. Hint: You can do this directly, but it may be easier to find the derivative of \(\nicefrac{1}{x}\) and then use the chain rule and the product rule.

Exercise 4.1.3.

For \(n \in \Z\text{,}\) prove that \(x^n\) is differentiable and find the derivative, unless, of course, \(n < 0\) and \(x=0\text{.}\) Hint: Use the product rule.

Exercise 4.1.4.

Prove that a polynomial is differentiable and find the derivative. Hint: Use the previous exercise.

Exercise 4.1.5.

Define \(f \colon \R \to \R\) by
\begin{equation*} f(x) \coloneqq \begin{cases} x^2 & \text{if } x \in \Q,\\ 0 & \text{otherwise.} \end{cases} \end{equation*}
Prove that \(f\) is differentiable at \(0\text{,}\) but discontinuous at all points except \(0\text{.}\)

Exercise 4.1.6.

Assume the inequality \(\abs{x-\sin(x)} \leq x^2\text{.}\) Prove that \(\sin\) is differentiable at \(0\text{,}\) and find the derivative at \(0\text{.}\)

Exercise 4.1.7.

Using the previous exercise, prove that \(\sin\) is differentiable at all \(x\) and that the derivative is \(\cos(x)\text{.}\) Hint: Use the sum-to-product trigonometric identity as we did before.

Exercise 4.1.8.

Let \(f \colon I \to \R\) be differentiable. For \(n \in \Z\text{,}\) let \(f^n\) be the function defined by \(f^n(x) \coloneqq {\bigl( f(x) \bigr)}^n\text{.}\) If \(n < 0\text{,}\) assume \(f(x) \not= 0\) for all \(x \in I\text{.}\) Prove that \((f^n)'(x) = n {\bigl(f(x) \bigr)}^{n-1} f'(x)\text{.}\)

Exercise 4.1.9.

Suppose \(f \colon \R \to \R\) is a differentiable Lipschitz continuous function. Prove that \(f'\) is a bounded function.

Exercise 4.1.10.

Let \(I_1, I_2\) be intervals. Let \(f \colon I_1 \to I_2\) be a bijective function and \(g \colon I_2 \to I_1\) be the inverse. Suppose that both \(f\) is differentiable at \(c \in I_1\) and \(f'(c) \not=0\) and \(g\) is differentiable at \(f(c)\text{.}\) Use the chain rule to find a formula for \(g'\bigl(f(c)\bigr)\) (in terms of \(f'(c)\)).

Exercise 4.1.11.

Suppose \(f \colon I \to \R\) is bounded, \(g \colon I \to \R\) is differentiable at \(c \in I\text{,}\) and \(g(c) = g'(c) = 0\text{.}\) Show that \(h(x) \coloneqq f(x) g(x)\) is differentiable at \(c\text{.}\) Hint: You cannot apply the product rule.

Exercise 4.1.12.

Suppose \(f \colon I \to \R\text{,}\) \(g \colon I \to \R\text{,}\) and \(h \colon I \to \R\text{,}\) are functions. Suppose \(c \in I\) is such that \(f(c) = g(c) = h(c)\text{,}\) \(g\) and \(h\) are differentiable at \(c\text{,}\) and \(g'(c) = h'(c)\text{.}\) Furthermore suppose \(h(x) \leq f(x) \leq g(x)\) for all \(x \in I\text{.}\) Prove \(f\) is differentiable at \(c\) and \(f'(c) = g'(c) = h'(c)\text{.}\)

Exercise 4.1.13.

Suppose \(f \colon (-1,1) \to \R\) is a function such that \(f(x) = x h(x)\) for a bounded function \(h\text{.}\)
  1. Show that \(g(x) \coloneqq {\bigl( f(x) \bigr)}^2\) is differentiable at the origin and \(g'(0) = 0\text{.}\)
  2. Find an example of a continuous function \(f \colon (-1,1) \to \R\) with \(f(0) = 0\text{,}\) but such that \(g(x) \coloneqq {\bigl( f(x) \bigr)}^2\) is not differentiable at the origin.

Exercise 4.1.14.

Suppose \(f \colon I \to \R\) is differentiable at \(c \in I\text{.}\) Prove there exist numbers \(a\) and \(b\) with the property that for every \(\epsilon > 0\text{,}\) there is a \(\delta > 0\text{,}\) such that \(\abs{a+b(x-c) - f(x)} \leq \epsilon \abs{x-c}\text{,}\) whenever \(x \in I\) and \(\abs{x-c} < \delta\text{.}\) In other words, show that there exists a function \(g \colon I \to \R\) such that \(\lim_{x\to c} g(x) = 0\) and \(\abs{a+b(x-c) - f(x)} = g(x) \abs{x-c}\text{.}\)

Exercise 4.1.15.

Prove the following simple version of L’Hôpital’s rule. Suppose \(f \colon (a,b) \to \R\) and \(g \colon (a,b) \to \R\) are differentiable functions whose derivatives \(f'\) and \(g'\) are continuous functions. Suppose that at \(c \in (a,b)\text{,}\) \(f(c) = 0\text{,}\) \(g(c)=0\text{,}\) \(g'(x) \not= 0\) for all \(x \in (a,b)\text{,}\) and \(g(x) \not= 0\) whenever \(x \not= c\text{.}\) Note that the limit of \(\nicefrac{f'(x)}{g'(x)}\) as \(x\) goes to \(c\) exists. Show that
\begin{equation*} \lim_{x \to c} \frac{f(x)}{g(x)} = \lim_{x \to c} \frac{f'(x)}{g'(x)} . \end{equation*}

Exercise 4.1.16.

Suppose \(f \colon (a,b) \to \R\) is differentiable at \(c \in (a,b)\text{,}\) \(f(c)=0\text{,}\) and \(f'(c) > 0\text{.}\) Prove that there is a \(\delta > 0\) such that \(f(x) < 0\) whenever \(c-\delta < x < c\) and \(f(x) > 0\) whenever \(c < x < c+\delta\text{.}\)
Named for the German mathematician Gottfried Wilhelm Leibniz (1646–1716).
For a higher quality printout use the PDF versions: https://www.jirka.org/ra/realanal.pdf or https://www.jirka.org/ra/realanal2.pdf