22 Definition
Highlights of this Chapter: we define the derivative and compute a few examples directly from the definition.
Finally - on to some calculus! Here we will define the derivative, and study its properties. This may sound daunting at first, remembering back to the days of calculus when it all seemed so new and advanced. But hopefully, after so much exposure to sequences and series during this course, the rigorous notion of a derivative will feel more just like a nice application of what we’ve learned, than a whole new theory.
22.1 Difference Quotients
The derivative is defined to capture the slope of a graph at a point. Elementary algebra tells us we can compute the slope of a line given two points as rise over run, and so we can compute the slope of a secant line of a function between the points \(a,t\) as
\[\frac{f(t)-f(a)}{t-a}\]
The derivative is the limit of this, as \(t\to a\):
Definition 22.1 (The Derivative) Let \(f\) be a function defined on an open interval containing \(a\). Then \(f\) is differentiable at \(a\) if the following limit of difference quotients exists. In this case, we define the limiting value to be the derivative of \(f\) at \(a\). \[f^\prime(a)=D f(a)=\lim_{t\to a}\frac{f(t)-f(a)}{t-a}\]
Exercise 22.1 (Equivalent Formulation) Prove that we may alternatively use the following limit definition to calculate the derivative: \[f^\prime(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h}\]
Example 22.1 The function \(f(x)=x^2\) is differentiable at \(x=2\).
This is a classic problem from calculus 1, whose argument is already pretty much rigorous! We wish to compute the limit
\[\lim_{x\to 2}\frac{x^2-4}{x-2}\]
So, we choose an arbitrary sequence \(x_n\) with \(x_n\neq 2\) but \(x_n\to 2\) and compute
\[\lim \frac{x_n^2-4}{x_n-2}=\lim \frac{(x_n+2)(x_n-2)}{x_n-2}=\lim x_n+2\]
Where the arithmetic is justified since \(x_n\neq 2\) for all \(n\) by definition, so everything is defined. But now, as \(x_n\to 2\) we can just use the limit laws to see
\[\lim x_n+2=2+2=4\]
Since \(x_n\) was arbitrary, this holds for all such sequences, so the limit exists and equals 4. Because this limit defines the derivative, we have that \(f\) is differentiable at 2 and
\[f^\prime(2)=4\]
Exercise 22.2 Compute the derivative of \(f(x)=x^3\) at an arbitrary point \(a\in\RR\), directly from the definition and show \(f^\prime(a)=3a^2\).
22.1.1 One-Sided Derivative
As defined above, the derivative is a limit \(t\to a\), which depends on values of \(t\) both greater than and less than \(a\). But sometimes its useful to have a notion of the derivative that only cares about one sided limits (for instance, when computing the slope at the end of an interval). We give the analogous definition below
Definition 22.2 (One Sided Derivatives) Let \(f\) be a function defined at \(a\); then its 1-sided derivatives are defined by the following limits, when they exist
\[D_+f(a)=\lim_{t\to a^+}\frac{f(t)-f(a)}{t-a}\] \[D_-f(a)=\lim_{t\to a^-}\frac{f(t)-f(a)}{t-a}\]
This definition, together with our previous work on limits, implies that a function \(f\) is differentiable if and only if its two one sided derivatives exist and are equal. This is useful in practice, for instance in showing the non-differentiability of the absolute value:
Exercise 22.3 Show that \(f(x)=|x|\) is not differentiable at \(x=0\).
The pasting lemma has a differentiable analog, which shows exactly when gluing two pieces (like the absolute value) is differentiable, and when its not.
Exercise 22.4 Let \(f,g\) be two continuous and differentiable functions with \(a\in\RR\) a point such that \(f(a)=g(a)\). Prove that the piecewise function \[h(x)=\begin{cases} f(x)&x\leq a\\ g(x)&x>a \end{cases}\] is differentiable at \(a\) if and only if \(f^\prime(a)=g^\prime(a)\). (recall we saw such a function is always continuous at \(a\) in ?exr-pasting-lemma).
One sided derivatives let us more easily prove that the derivative exists in cases where it is easy to take limits from above and below, but not arbitrary limits. A great example use case is when the difference quotient is monotone: then the right and left limits exist ?exr-monotone-limits (they are the inf and sup for any sequence, respectively). When is the difference quotient monotone? One particularly useful case: this holds whenever the function is convex
Proposition 22.1 (\(\blacklozenge\) Convexity & 1-Sided Derivatives) If \(f\) is convex then at any point \(a\in\RR\) the one sided difference quotients \(D^-f(a)\) and \(D^+f(a)\) both exist.
Proof.
Exercise 22.5 These one sided difference quotients need not be equal, however. Prove the convex function \(f(x)\) below is not differentiable at \(x=1\): \[f(x)=\begin{cases} x&x\leq 1\\ x^2 &x>1 \end{cases}\]
22.2 Derivative as a Function
So far we have been discussing the derivative at a point as a number; the result of a limiting process. But we can let this point vary, and produce a function taking in \(x\) and outputting the derivative at \(x\):
Definition 22.3 (The Function \(f^\prime\)) Let \(f\) be a function, and suppose that the derivative of \(f\) exists at each point of a set \(D\subset\RR\). Then we may define a function \(f^\prime\colon D\to \RR\) by
\[f^\prime\colon x\mapsto f^\prime(x)=\lim_{t\to x}\frac{f(t)-f(x)}{t-x}\]
If \(f^\prime\) is continuous, \(f\) is called continuously differentiable on \(D\).
For example, \(f(x)=x^3\) is continuously differentiable on \(\RR\) since by Exercise 22.2 we see its derivative is the function \(x\mapsto 3x^2\), and this is a polynomial: we proved all polynomials are continuous in ?exr-polynomials-continuous.
Example 22.2 While its hard to imagine a function that is differentiable at every point but not continuously differentiable such things exist. For example \[f(x)=\begin{cases} x^2\sin\left(\frac{1}{x^2}\right)&x\neq 0\\ 0 & x=0 \end{cases} \]
Its possible to find a formula for \(f^\prime(x)\) when \(x\neq 0\), and show that \(\lim_{x\to 0}f^\prime(x)\) does not exist (we will do this later). However one can also calculate directly the derivative at zero: and find \(f^\prime(0)=0\). This means \(\lim_{x\to 0}f^\prime(x)\neq f^\prime(\lim_{x\to 0}x)\) as one side does not exist and the other is zero: thus \(f^\prime\) is not continuous at \(0\).
Exercise 22.6 For \(f(x)\) as above in Example 23.1, calculate \(f^\prime(0)\) directly using the limit definition. (Perhaps surprisingly, all you need to know about the sine function here is that it is bounded between \(-1\) and \(1\)!)
22.3 Higher Derivatives
Since the derivative of a function yields another function, we can look at iterating this process to produce higher derivatives
Definition 22.4 (nth Derivatives) Given a differentiable function \(f\), the second derivative \(f^{\prime\prime}\) is defined as the derivative of \(f^\prime\). A function is twice differentiable at \(x\) if \[\lim_{x\to a}\frac{f^\prime(x)-f^\prime(a)}{x-a}\] exists. Continuing inductively, we define the \(n^{th}\) derivative of a function at \(a\) as the derivative of the \(n-1^{st}\) derivative of \(f\) at \(a\).
We will use the prime notation for small numbers of derivatives, like \(f^\prime(x)\), \(f^{\prime\prime}(x)\) and \(f^{\prime\prime\prime}(x)\). For higher derivatives it is traditional to denote via the number of derivatives in parentheses: \(f^{(2)}=f^{\prime\prime}\), \(f^{(3)}=f^{\prime\prime\prime}\) and so on; so \(f^{(47)}\) for the 47th derivative of \(f\).
Proposition 22.2 (A Difference Quotient for 2nd Derivative) If \(f\) is twice differentiable at \(a\), then \[f^{\prime\prime}(a)=\lim_{h\to 0}\frac{f(a+2h)-2f(a+h)+f(a)}{h^2}\]
Proof.
Exercise 22.7 (A Difference Quotient for 3nd Derivative) Find a limit depending only on \(f\) (not \(f^\prime\) or \(f^{\prime\prime}\)) which computes the third derivative
Its useful to have a notation for functions which admit \(k\) derivatives, or infinitely many derivatives: we give the standard one below.
Definition 22.5 (\(C^k\) Functions) A function is \(k\) times differentiable on a domain \(D\) if \(f^{(k)}(x)\) exists for all \(x\in D\). The set of all \(k\) times differentiable functions on a domain \(D\) is denoted \(C^k(D)\).
Definition 22.6 (Smooth Functions) A function is called smooth at a point if its \(n^{th}\) derivative exists for all \(n\in\NN\). A function is smooth on a domain \(D\) if its infinitely differentiable at each point of \(D\). The collection of all smooth functions on \(D\) is denoted \(C^\infty(D)\).