In this article, we’ll look at differentiation more rigourously and carefully. Throughout this article, we suppose f is a real-valued function defined on an open interval (b, c) containing a, i.e. f : (b, c) → R with b < a < c.
Theorem. The derivative of f(x) at a is defined by:
If the limit exists, we also say f(x) is differentiable at x=a. If f(x) is differentiable at every point in (b, c), then we get a function
,
. The resulting function is then written as
.
Pictorially, the derivative measures the gradient of the tangent at x=a:
Example 1
Consider f : R → R, given by f(x) = x3. At any point x=a, we have:
which is equal to when x≠a. Hence, as x→a, the expression tends to
. Conclusion: the derivative exists at every point a on the real line and
.
Example 2
Consider f : R-{0} → R, given by f(x) = 1/x. At any point x=a≠0, note that f(x) is defined on an open interval containing a. Then:
.
Hence, . Conclusion: the derivative exists for every non-zero a.
Example 3
Take the function f : R → R, given by f(x) = |x|. If x=a>0, then f(x)=x on an open interval containing a so it’s easy to check that f’(a) = 1. Likewise, if x=a<0, then f’(a) = -1. Finally, we shall show that f’(0) does not exist. But f’(0) is the limit of g(x) := (|x|-|0|)/(x-0) = |x|/x as x tends to 0. Note that g(x)=1 for x>0, and g(x)=-1 for x<0. Hence, the left limit is -1 while the right limit is +1. Since the two limits don’t match, the limit doesn’t exist. Conclusion: the derivative exists for every non-zero a.
Properties of the Derivative
We have the following basic properties.
Theorem. Let f(x) and g(x) be defined on an open interval about a. If they are both differentiable at x=a, then:
- f(x) is continuous at x=a;
- (addition rule) the derivative of the sum (f+g)(x) at x=a is (f+g)'(a) = f'(a) + g'(a);
- (product rule) the derivative of the product (fg)(x) at x=a is (fg)'(a) = f'(a)g(a) + f(a)g'(a).
Proof.
1. For the first property, we have , so:
if both limits on the RHS exist. But they do: the first is f’(a) while the second is 0. So the LHS tends to 0 and f(x)→f(a) as x→a as desired.
2. For the second property, write:
The two limits on the right are f’(a) and g’(a) respectively. Hence, the middle limit equals f’(a)+g’(a) and we’re done.
3. For the final property, write (fg)'(a) as:
Since f is differentiable at x=a, it’s continuous there also. Thus, the limits on the RHS all exist the expression approaches f(a)g’(a) + f’(a)g(a), as desired. ♦
The next property is extremely useful computationally.
Theorem (Chain Rule). Suppose f(x) (resp. g(x)) is defined on an open interval containing a (resp. f(a)). If f'(a) and g'(f(a)) both exist, then the composed function h = g°f gives h'(a) = g'(f(a))·f'(a).
Proof.
One’s inclined to write:
,
if f(x) ≠ f(a), and let x→a. But the problem is that f(x)=f(a) may occur even when x is arbitrarily close to a. This is a slight technical issue, which we’ll counter by defining:
Then G(y) is defined on an open interval about f(a) and is continuous there. Now we can write the above equality as:
,
if x ≠ a. Now since G is continuous at f(a) and f is continuous at a, taking the limit x→a gives (g°f)'(a) = g’(f(a)) f’(a) on both sides. ♦
Now we can describe the derivative of f(x)/g(x).
Corollary. If f(x) and g(x) are differentiable at x=a, and g'(a)≠0, then
- 1/g is differentiable at x=a and (1/g)'(a) = -g'(a)/g(a)2.
- f/g is differentiable at x=a and
.
Proof. The first property follows from the Chain Rule and Example 2. The second property follows from the first property and the product rule.
Summary. We have derived the standard laws of differentiation in secondary school calculus.
- (addition rule)
;
- (product rule)
;
- (quotient rule)
;
- (chain rule)
.
More Examples
The above rules for manipulating derivatives have multiple applications.
Example 4
Let’s differentiate for an integer n. Clearly, for n=0, the derivative is 0 and for n=1, it’s 1. For a positive integer n>1, the derivative of fn can be obtained by recursively applying the product rule:
which gives for n≥0. By applying the division rule, we see that in fact this equation holds for all integers n.
Example 5
Let . We wish to compute
in closed form. Let
and
. Since f(x) = v(u(x)), the chain rule gives us
Example 6
For a fixed positive integer n, write the binomial expansion:
Differentiating both sides with respect to x, the chain rule applied to the LHS gives n(1+x)n-1 while the RHS gives us . Substituting x=1 then gives us the combinatorial equality:
Many more examples can be found in our articles on generating functions.
Example 7 (with Warning)
We know that for |x|<1, the geometric series converges to:
One’s tempted to differentiate both sides with respect to x, which gives on the LHS and
on the RHS by using the chain rule with u(x) = 1-x. But there’s no guarantee that the addition rule holds for infinitely many terms, although in this case it does work. The underlying theory will be covered in greater detail in a later article.
Higher Derivatives
From the above results, we see that we can differentiate a function f(x) = p(x)/q(x), where p(x) and q(x) are both polynomials, at any point x=a which is not a root of q(x). A function of this form (p(x)/q(x) for polynomials p(x) and q(x)) is called a rational function. Furthermore, from the division rule the derivative is also a rational function, which means we can differentiate it as many times as we wish:
These can also be denoted by f”, f”’, etc, or f(2), f(3), … .
Now, if f(x) is second-differentiable (i.e. f” exists) at x=a, then by definition f’ = df/dx must exist on an open interval (b, c) about a, and also be differentiable at x=a. In particular, since differentiability implies continuity, df/dx is continuous at x=a:
Definition. A function f(x) is said to be continuously differentiable at x=a if it’s differentiable on an open interval about a, and the derivative is continuous at x=a.
Clearly, we have the following implications:
And the implications are strict:
- Continuous but not differentiable function : easy, take f(x) = |x|; it’s continuous and example 3 tells us it’s not differentiable at x=0.
- Differentiable but not continuously differentiable function : take
When a≠0, the derivative
, which does not converge as a→0. When a=0, the derivative is
by squeezing the function between |x| and -|x|.
- Continuously differentiable but not second differentiable function : take f(x) = x|x|. It’s easy to see that the derivative is f’(a) = 2a if a≥0, and f’(a) = -2a if a<0. Thus f’(x) = 2|x| which is continuous but not differentiable.
More generally, it’s easy to see that the function f(x) = xn-1|x| is (n-1)th order continuously differentiable (i.e. the (n-1)th derivative exists and is continuous) but not n-th order differentiable.
Now, we say f(x) is infinitely differentiable if the n-th order derivative exists for all n. For such a function, one’s inclined to write down its Taylor series about x=a:
and hope that the Taylor series converges to f(x) in some open interval about a. If so, we say f(x) is analytic. Alas.
- Infinitely differentiable but not analytic function : let
At the points x=a≠0, it’s easy to see the n-th derivative is of the form
for some polynomial p(x) and positive integer m. To check its behaviour as x→0, let y=1/x; then
which approaches zero since exponential increases much faster than any polynomial function. With this, one proves via induction that the n-th derivative at 0 is always 0, so the Taylor series is 0.
It should be noted that this anomaly doesn’t occur for complex analysis. Specifically, a differentiable function C → C on an open set is automatically analytic there and one immediately has all the wonderful results about Taylor series convergence etc. We hope to come around to that at a later date.