Everyone who has studied calculus believes that a function whose derivative is zero at every point of an interval is constant. Try to prove it from the definition of the derivative. The hypothesis says that at each point \(a\) the difference quotient tends to \(0\) : near \(a\) , the function changes by much less than the distance moved. That is a statement about each point separately, with its own “near”. The conclusion compares the values of the function at two points that may be far apart. Between them lie infinitely many points, each with its own tiny neighbourhood and its own tiny error, and nothing in the definition prevents infinitely many tiny errors from adding up.
The gap between the local definition and global conclusions is bridged by one theorem, the Mean Value Theorem, and it is not a formal consequence of the definition: it uses the Extreme Value Theorem, hence compactness, hence completeness. This chapter proves it and then uses it for everything else, including monotonicity, inequalities, L’Hôpital’s rule, and Taylor’s theorem. Along the way it shows that derivatives, though they need not be continuous, cannot be arbitrary functions.
6.1 The derivative
Throughout the chapter \(I\) denotes an interval containing more than one point.
Definition 6.1 (derivative). Let \(f:I\to\mathbb R\) and \(a\in I\) . The function \(f\) is differentiable at \(a\) if the limit
exists (as a real number). The number \(f'(a)\) is the derivative of \(f\) at \(a\) . If \(f\) is differentiable at every point of \(I\) , the function \(f':I\to\mathbb R\) is its derivative; higher derivatives \(f''\) , \(f'''\) , \(f^{(n)}\) are defined by repetition.
The limit is taken over \(x\in I\) , \(x\ne a\) , so at an endpoint of \(I\) the derivative is automatically one-sided. A reformulation due to Carathéodory removes the quotient and makes most proofs shorter.
Proposition 6.2 (Carathéodory’s criterion). A function \(f:I\to\mathbb R\) is differentiable at \(a\) if and only if there is a function \(\varphi:I\to\mathbb R\) , continuous at \(a\) , with
In that case \(f'(a)=\varphi(a)\) .
Proof. If \(f\) is differentiable at \(a\) , define \(\varphi(x)=(f(x)-f(a))/(x-a)\) for \(x\ne a\) and \(\varphi(a)=f'(a)\) . The identity holds, and \(\varphi\) is continuous at \(a\) because \(\lim_{x\to a}\varphi(x)=f'(a)=\varphi(a)\) . Conversely, if such a \(\varphi\) exists, then for \(x\ne a\) the difference quotient equals \(\varphi(x)\) , which tends to \(\varphi(a)\) as \(x\to a\) .
Corollary 6.3 (differentiable implies continuous). If \(f\) is differentiable at \(a\) , then \(f\) is continuous at \(a\) .
Proof. \(f(x)=f(a)+\varphi(x)(x-a)\) is a sum and product of functions continuous at \(a\) .
Theorem 6.4 (rules of differentiation). Let \(f,g:I\to\mathbb R\) be differentiable at \(a\) . Then: (a) \((f+g)'(a)=f'(a)+g'(a)\) and \((cf)'(a)=cf'(a)\) ; (b) \((fg)'(a)=f'(a)g(a)+f(a)g'(a)\) ; (c) if \(g(a)\ne 0\) , then \((f/g)'(a)=\bigl(f'(a)g(a)-f(a)g'(a)\bigr)/g(a)^2\) ; (d) (chain rule) if \(f(I)\subseteq J\) and \(h:J\to\mathbb R\) is differentiable at \(f(a)\) , then \((h\circ f)'(a)=h'(f(a))\,f'(a)\) .
Proof. Write \(f(x)-f(a)=\varphi(x)(x-a)\) and \(g(x)-g(a)=\psi(x)(x-a)\) with \(\varphi,\psi\) continuous at \(a\) . (a) is immediate. (b) We have
and the bracket is continuous at \(a\) , because \(g\) is, with value \(f'(a)g(a)+f(a)g'(a)\) there. (c) is Exercise 4. (d) Put \(b=f(a)\) and write \(h(y)-h(b)=\eta(y)(y-b)\) with \(\eta\) continuous at \(b\) . Substituting \(y=f(x)\) ,
The function \(\eta(f(x))\varphi(x)\) is continuous at \(a\) , since \(f\) is continuous at \(a\) and \(\eta\) at \(f(a)\) , and its value at \(a\) is \(h'(f(a))f'(a)\) .
The Carathéodory form disposes of the classical difficulty in the chain rule, that \(f(x)-f(a)\)
may vanish for \(x\)
near \(a\)
: no division by it occurs. From (b) and induction, \((x^n)'=nx^{n-1}\)
, and with (a) and (c) every polynomial and rational function is differentiable on its domain. The resulting table of derivatives is the one built up in Calculus, where these rules are first met as computational structure (math.calculus.derivative-rules-as-structure). The present chapter is about what the derivative implies, and uses that table freely.
Example 6.1: Three difference quotients
A smooth point. For \(f(x)=x^3\) and any \(a\) ,
The right side is a polynomial, continuous everywhere; it is the function \(\varphi\) of Proposition 6.2. Its value at \(a\) is \(3a^2\) , so \(f'(a)=3a^2\) .
A corner. For \(f(x)=\lvert x\rvert\) at \(a=0\) , the quotient \(\lvert x\rvert/x\) equals \(1\) for \(x>0\) and \(-1\) for \(x<0\) . It has no limit at \(0\) , so \(f\) is not differentiable there, although it is continuous. The converse of Corollary 6.3 is false.
A vertical tangent. For \(f(x)=\sqrt x\) on \([0,\infty)\) at \(a=0\) , the quotient is \(\sqrt x/x=1/\sqrt x\) , which is unbounded as \(x\to 0\) : at \(x=10^{-4}\) it is \(100\) . So \(f\) is not differentiable at \(0\) . At \(a>0\) the quotient is \((\sqrt x-\sqrt a)/(x-a)=1/(\sqrt x+\sqrt a)\to 1/(2\sqrt a)\) .
Example 6.2: A derivative that exists everywhere and is not continuous
Let \(f(x)=x^2\sin(1/x)\) for \(x\ne 0\) and \(f(0)=0\) . For \(x\ne 0\) the rules give
At \(0\) the rules do not apply and we use the definition: the quotient is \(f(x)/x=x\sin(1/x)\) , and \(\lvert x\sin(1/x)\rvert\le\lvert x\rvert\to 0\) . So \(f'(0)=0\) . The function is differentiable at every point of \(\mathbb R\) .
But \(f'\) is not continuous at \(0\) . At the points \(x_n=1/(2\pi n)\) , which tend to \(0\) , we have \(\sin(1/x_n)=0\) and \(\cos(1/x_n)=1\) , so \(f'(x_n)=-1\) for every \(n\) , while \(f'(0)=0\) . At the points \(1/((2n+1)\pi)\) the derivative equals \(+1\) . The derivative oscillates between values near \(-1\) and near \(1\) in every neighbourhood of \(0\) .
So “differentiable” and “continuously differentiable” are different properties. A function whose derivative exists and is continuous on \(I\) is said to be of class \(C^1\) .
6.2 From local to global: the Mean Value Theorem
A point \(c\in I\) is a local maximum of \(f\) if there is \(\delta>0\) with \(f(x)\le f(c)\) for all \(x\in I\) with \(\lvert x-c\rvert<\delta\) ; local minimum is defined likewise. An interior point of \(I\) is a point that is not an endpoint.
Theorem 6.5 (interior extremum theorem). If \(f:I\to\mathbb R\) has a local maximum or a local minimum at an interior point \(c\) of \(I\) and is differentiable at \(c\) , then \(f'(c)=0\) .
Proof. Suppose \(c\) is a local maximum. For \(x\) slightly larger than \(c\) we have \(f(x)-f(c)\le 0\) and \(x-c>0\) , so the difference quotient is at most \(0\) ; letting \(x\to c\) from the right, \(f'(c)\le 0\) by the order theorem for limits. For \(x\) slightly smaller than \(c\) the quotient is at least \(0\) , so \(f'(c)\ge 0\) . Both one-sided approaches are available because \(c\) is interior. Hence \(f'(c)=0\) . For a minimum apply this to \(-f\) .
Theorem 6.6 (Rolle). Let \(f:[a,b]\to\mathbb R\) be continuous on \([a,b]\) and differentiable on \((a,b)\) , with \(f(a)=f(b)\) . Then there is a point \(c\in(a,b)\) with \(f'(c)=0\) .
Proof. By the Extreme Value Theorem \(f\) attains a maximum and a minimum on \([a,b]\) . If both are attained at endpoints, then since \(f(a)=f(b)\) the maximum equals the minimum, \(f\) is constant, and \(f'(c)=0\) for every \(c\) . Otherwise one of them is attained at an interior point \(c\) , and \(f'(c)=0\) by Theorem 6.5.
Theorem 6.7 (Mean Value Theorem). Let \(f:[a,b]\to\mathbb R\) be continuous on \([a,b]\) and differentiable on \((a,b)\) . Then there is a point \(c\in(a,b)\) with
Proof. Subtract from \(f\) the linear function through the endpoints of its graph:
Then \(g\) is continuous on \([a,b]\) , differentiable on \((a,b)\) , and \(g(a)=g(b)=0\) . By Rolle’s theorem there is \(c\in(a,b)\) with \(0=g'(c)=f'(c)-(f(b)-f(a))/(b-a)\) .
The theorem asserts that a point \(c\) exists; it does not say where it is or that it is unique, and in applications one almost never finds it. Its use is to transfer a bound on \(f'\) over an interval into a bound on a difference of values of \(f\) .
Example 6.3: The theorem at work and the theorem failing
A point that can be found. For \(f(x)=x^3\) on \([0,3]\) the secant slope is \((27-0)/3=9\) , and \(f'(c)=3c^2=9\) gives \(c=\sqrt3\approx 1.732\) , which lies in \((0,3)\) .
Differentiability fails at one interior point. For \(f(x)=\lvert x\rvert\) on \([-1,1]\) the secant slope is \(0\) , but \(f'(x)\) is \(-1\) or \(1\) wherever it exists. No point \(c\) has \(f'(c)=0\) . The function is continuous on \([-1,1]\) and differentiable except at the single point \(0\) .
Continuity fails at one endpoint. Let \(f(x)=x\) for \(0\le x<1\) and \(f(1)=0\) . Then \(f(1)-f(0)=0\) , while \(f'(x)=1\) on \((0,1)\) . Again no \(c\) exists. The function is differentiable on the open interval, as required, but not continuous on the closed one.
Each of the two failures violates exactly one hypothesis, at exactly one point. The hypotheses are stated with a closed interval for continuity and an open one for differentiability because that is precisely what the proof uses: the Extreme Value Theorem on \([a,b]\) , and Theorem 6.5 at interior points.
Corollary 6.8 (consequences of the Mean Value Theorem). Let \(f\) be continuous on an interval \(I\) and differentiable at its interior points. (a) If \(f'(x)=0\) at every interior point, then \(f\) is constant on \(I\) . (b) If \(f'(x)\ge 0\) at every interior point, then \(f\) is increasing on \(I\) ; if \(f'(x)>0\) , strictly increasing. The same holds with reversed inequalities and “decreasing”. (c) If \(\lvert f'(x)\rvert\le L\) at every interior point, then \(\lvert f(x)-f(y)\rvert\le L\lvert x-y\rvert\) for all \(x,y\in I\) .
Proof. Let \(x<y\) be points of \(I\) . The hypotheses of Theorem 6.7 hold on \([x,y]\) , so \(f(y)-f(x)=f'(c)(y-x)\) for some \(c\in(x,y)\) , an interior point of \(I\) . In case (a) the right side is \(0\) ; in case (b) it is nonnegative, or positive; in case (c) its absolute value is at most \(L(y-x)\) .
Part (a) is the statement from the chapter opening, now proved. It follows that two functions with the same derivative on an interval differ by a constant. The word “interval” is essential: on the set \((-1,0)\cup(0,1)\)
the function equal to \(0\)
on the left piece and \(1\)
on the right piece has derivative \(0\)
everywhere and is not constant. Part (b) is what justifies reading the behaviour of a function from the sign of its derivative, the method that Calculus uses to locate extrema (math.calculus.optimization-from-signs). Its converse holds only weakly: a differentiable increasing function has \(f'\ge 0\)
, but a strictly increasing one need not have \(f'>0\)
everywhere, as \(x^3\)
shows at \(0\)
. Part (c) says that a bounded derivative makes a function Lipschitz, hence uniformly continuous.
Example 6.4: Inequalities and estimates from the Mean Value Theorem
The sine is Lipschitz. Since \(\lvert\cos\rvert\le 1\) , Corollary 6.8(c) gives \(\lvert\sin x-\sin y\rvert\le\lvert x-y\rvert\) for all real \(x,y\) .
A square root. Let \(f(t)=\sqrt t\) on \([100,102]\) . The theorem gives \(\sqrt{102}-10=2\cdot\dfrac{1}{2\sqrt c}=\dfrac1{\sqrt c}\) for some \(c\in(100,102)\) . Since \(10<\sqrt c<10.1\) (because \(10.1^2=102.01\) ), we get
The true value is \(10.0995\) to four places. We did not find \(c\) ; we only used where it must lie.
The exponential dominates its tangent. For \(x>0\) , applying the theorem to \(e^t\) on \([0,x]\) gives \(e^x-1=e^c\,x>x\) , since \(c>0\) . For \(x<0\) , on \([x,0]\) it gives \(1-e^x=e^c(-x)<-x\) , since \(c<0\) . Either way \(e^x\ge 1+x\) for all real \(x\) , with equality only at \(0\) .
Common mistake. Reading too much into a single value of the derivative. From \(f'(c)>0\) at one point it does not follow that \(f\) is increasing on some interval around \(c\) . Corollary 6.8(b) needs the sign of \(f'\) on a whole interval. Example 6.5 below gives a function with \(f'(0)=\tfrac12\) that is not monotone on any neighbourhood of \(0\) . What \(f'(c)>0\) does give is weaker: for \(x\) near \(c\) , \(f(x)>f(c)\) if \(x>c\) and \(f(x)<f(c)\) if \(x<c\) .
6.3 What a derivative can and cannot be
Example 6.2 showed that a derivative need not be continuous. One might then expect that any function at all could be a derivative. It cannot: derivatives share with continuous functions the property of not skipping values.
Theorem 6.9 (Darboux). Let \(f\) be differentiable on \([a,b]\) and let \(\lambda\) be a number strictly between \(f'(a)\) and \(f'(b)\) . Then there is \(c\in(a,b)\) with \(f'(c)=\lambda\) .
Proof. Suppose \(f'(a)<\lambda<f'(b)\) ; otherwise consider \(-f\) . Let \(g(x)=f(x)-\lambda x\) , so that \(g'(a)<0<g'(b)\) . The function \(g\) is continuous on \([a,b]\) , so it attains a minimum at some \(c\in[a,b]\) . Since \(g'(a)<0\) , the difference quotient \((g(x)-g(a))/(x-a)\) is negative for \(x\) close to \(a\) , so \(g(x)<g(a)\) for such \(x\) : the minimum is not at \(a\) . Since \(g'(b)>0\) , the quotient \((g(x)-g(b))/(x-b)\) is positive for \(x\) close to \(b\) , and as \(x-b<0\) this gives \(g(x)<g(b)\) : the minimum is not at \(b\) . So \(c\) is interior, and \(g'(c)=0\) by Theorem 6.5, that is, \(f'(c)=\lambda\) .
Note that the proof does not assume \(f'\) continuous; if it did, the Intermediate Value Theorem would apply directly. A consequence is that a derivative has no jump discontinuities. The function equal to \(0\) for \(x<0\) and \(1\) for \(x\ge 0\) skips the value \(\tfrac12\) and so is not the derivative of any function on \(\mathbb R\) . The discontinuity in Example 6.2 is of the only kind a derivative can have: oscillation.
Example 6.5: A positive derivative at a point, with no monotonicity nearby
Let \(f(x)=\tfrac12x+x^2\sin(1/x)\) for \(x\ne 0\) and \(f(0)=0\) . By Example 6.2, \(f'(0)=\tfrac12+0=\tfrac12>0\) , and for \(x\ne 0\)
At \(x_n=1/(2\pi n)\) this is \(\tfrac12-1=-\tfrac12\) , and at \(1/((2n+1)\pi)\) it is \(\tfrac12+1=\tfrac32\) . In every neighbourhood of \(0\) the derivative takes both signs, and by Darboux’s theorem every value between. If \(f\) were increasing on some interval around \(0\) , its derivative would be nonnegative there, which is false at the points \(x_n\) ; and \(f\) is not decreasing near \(0\) either, since that would force \(f'(0)\le 0\) . So \(f\) is not monotone on any interval containing \(0\) , although \(f'(0)>0\) .
6.4 Cauchy’s mean value theorem and L’Hôpital’s rule
Theorem 6.10 (Cauchy’s mean value theorem). Let \(f\) and \(g\) be continuous on \([a,b]\) and differentiable on \((a,b)\) . Then there is \(c\in(a,b)\) with
Proof. Let \(h(x)=(f(b)-f(a))\,g(x)-(g(b)-g(a))\,f(x)\) . Then \(h\) is continuous on \([a,b]\) , differentiable on \((a,b)\) , and a short computation gives \(h(a)=f(b)g(a)-g(b)f(a)=h(b)\) . Rolle’s theorem supplies \(c\) with \(h'(c)=0\) .
With \(g(x)=x\) this is Theorem 6.7. The point is that the same \(c\) serves both functions, which two separate applications of the Mean Value Theorem would not give.
Theorem 6.11 (L’Hôpital’s rule, the case of two vanishing limits). Let \(f\) and \(g\) be differentiable on \((a,b)\) with \(g'(x)\ne 0\) for all \(x\in(a,b)\) . Suppose \(\lim_{x\to a^+}f(x)=0\) and \(\lim_{x\to a^+}g(x)=0\) , and suppose
Then \(\lim_{x\to a^+}f(x)/g(x)=L\) . The same holds for limits from the left at \(b\) , and hence for two-sided limits.
Proof. Define \(f(a)=g(a)=0\) ; then \(f\) and \(g\) are continuous on \([a,b)\) . For \(x\in(a,b)\) we have \(g(x)\ne 0\) , for otherwise Rolle’s theorem on \([a,x]\) would give a zero of \(g'\) . By Theorem 6.10 on \([a,x]\) there is \(c_x\in(a,x)\) with
Let \(\varepsilon>0\) and choose \(\delta>0\) so that \(\lvert f'(t)/g'(t)-L\rvert<\varepsilon\) for \(a<t<a+\delta\) . If \(a<x<a+\delta\) , then \(a<c_x<x<a+\delta\) , so \(\lvert f(x)/g(x)-L\rvert<\varepsilon\) .
There is also a version for quotients in which \(g(x)\to\infty\) ; it is proved from the same theorem with one more estimate (Exercise 21 outlines it).
Example 6.6: Using the rule, and a case where it says nothing
Two applications. For \((1-\cos x)/x^2\) as \(x\to 0\) , numerator and denominator tend to \(0\) , and the quotient of derivatives is \(\sin x/(2x)\) . That is again a quotient of two functions tending to \(0\) , and its quotient of derivatives is \(\cos x/2\to\tfrac12\) . So \(\sin x/(2x)\to\tfrac12\) by the rule, and then \((1-\cos x)/x^2\to\tfrac12\) by the rule again. Numerically the quotient is about \(0.499583\) at \(x=0.1\) and \(0.499996\) at \(x=0.01\) .
The rule is one-directional. Let \(f(x)=x^2\sin(1/x)\) and \(g(x)=x\) . Then \(f(x)/g(x)=x\sin(1/x)\to 0\) as \(x\to 0\) . But \(f'(x)/g'(x)=2x\sin(1/x)-\cos(1/x)\) has no limit at \(0\) , by Example 6.2. The quotient of the functions converges although the quotient of the derivatives does not. The theorem says: if the second limit exists, so does the first. It does not say that the first limit fails to exist when the second does.
6.5 Taylor’s theorem
The Mean Value Theorem writes \(f(x)=f(a)+f'(c)(x-a)\) : the constant approximation \(f(a)\) , plus an error expressed through the first derivative at an unknown point. Taylor’s theorem does the same for polynomial approximations of any degree. For a function \(f\) with \(n\) derivatives at \(a\) , its Taylor polynomial of degree \(n\) at \(a\) is
It is the unique polynomial of degree at most \(n\) whose value and first \(n\) derivatives at \(a\) agree with those of \(f\) .
Theorem 6.12 (Taylor’s theorem with Lagrange remainder). Let \(f\) have \(n+1\) derivatives on an open interval \(I\) , and let \(a,x\in I\) with \(x\ne a\) . Then there is a point \(c\) strictly between \(a\) and \(x\) with
Proof. Fix \(x\) and define the number \(M\) by \(f(x)=P_n(x)+M(x-a)^{n+1}\) . Consider the function of \(t\)
By the defining property of \(P_n\) , and because \((t-a)^{n+1}\) and its first \(n\) derivatives vanish at \(t=a\) , we have \(g(a)=g'(a)=\cdots=g^{(n)}(a)=0\) . Also \(g(x)=0\) by the choice of \(M\) . By Rolle’s theorem there is \(c_1\) between \(a\) and \(x\) with \(g'(c_1)=0\) . Since \(g'(a)=0\) as well, Rolle’s theorem applied to \(g'\) gives \(c_2\) between \(a\) and \(c_1\) with \(g''(c_2)=0\) . Continuing, after \(n+1\) steps we reach a point \(c=c_{n+1}\) between \(a\) and \(x\) with \(g^{(n+1)}(c)=0\) . Since \(P_n\) has degree at most \(n\) , \(g^{(n+1)}(t)=f^{(n+1)}(t)-(n+1)!\,M\) . Hence \(M=f^{(n+1)}(c)/(n+1)!\) .
For \(n=0\) this is the Mean Value Theorem. The remainder term has the form of the next term of the polynomial, with the derivative evaluated at an unknown intermediate point; a bound on \(f^{(n+1)}\) between \(a\) and \(x\) therefore bounds the error.
Example 6.7: A guaranteed error bound
Approximate \(\sin(0.5)\) . The Taylor polynomial of \(\sin\) at \(0\) of degree \(4\) is \(P_4(x)=x-x^3/6\) , the term in \(x^4\) being zero. The fifth derivative of \(\sin\) is \(\cos\) , bounded by \(1\) , so Theorem 6.12 with \(n=4\) gives
Here \(P_4(0.5)=0.5-0.125/6\approx 0.479167\) , and the true value is \(\sin(0.5)\approx 0.479426\) ; the actual error, about \(0.000259\) , is just inside the bound. Using the zero \(x^4\) term to apply the theorem with \(n=4\) in place of \(n=3\) improved the bound from \(0.5^4/4!\approx 0.0026\) by a factor of ten at no cost.
Example 6.8: The number \(e\) is irrational
Apply Theorem 6.12 to \(e^t\) at \(a=0\) , \(x=1\) . Every derivative of \(e^t\) is \(e^t\) , so with \(s_n=\sum_{k=0}^n1/k!\) ,
Since \(1<e^c<e<3\) , this gives \(0<e-s_n<3/(n+1)!\) . With \(n=6\) : \(s_6=1957/720\approx 2.718056\) , and \(e\) lies between \(s_6+1/5040\approx 2.718254\) and \(s_6+3/5040\approx 2.718651\) .
Now suppose \(e=p/q\) with \(p,q\in\mathbb N\) ; multiplying numerator and denominator by \(3\) if necessary we may assume \(q\ge 3\) . Multiply the inequality for \(n=q\) by \(q!\) :
But \(q!\,e=(q-1)!\,p\) is an integer, and \(q!\,s_q=\sum_{k=0}^qq!/k!\) is an integer. Their difference is an integer strictly between \(0\) and \(1\) , which is impossible. So \(e\) is irrational.
A second standard use of the theorem is the test for extrema.
Corollary 6.13 (second derivative test). Let \(f\) have a continuous second derivative on an open interval containing \(c\) , with \(f'(c)=0\) . If \(f''(c)>0\) , then \(c\) is a strict local minimum of \(f\) ; if \(f''(c)<0\) , a strict local maximum.
Proof. Suppose \(f''(c)>0\) . By continuity there is \(\delta>0\) with \(f''>0\) on \((c-\delta,c+\delta)\) . For \(x\) in that interval, \(x\ne c\) , Theorem 6.12 with \(n=1\) gives \(f(x)=f(c)+\tfrac12f''(\xi)(x-c)^2\) with \(\xi\) between \(c\) and \(x\) , and the last term is positive.
A warning belongs here. Even when \(f\) has derivatives of all orders, the Taylor polynomials \(P_n(x)\) need not converge to \(f(x)\) as \(n\to\infty\) . The function equal to \(e^{-1/x^2}\) for \(x\ne 0\) and to \(0\) at \(0\) has all its derivatives at \(0\) equal to \(0\) (Exercise 19), so every one of its Taylor polynomials at \(0\) is the zero polynomial, while the function is positive away from \(0\) . Whether the remainder tends to \(0\) must be checked in each case; Chapter 8 takes up the question for power series.
6.6 Derivatives of inverse functions
Theorem 6.14 (derivative of the inverse). Let \(f:I\to\mathbb R\) be continuous and strictly monotone, with inverse \(g:J\to I\) on the interval \(J=f(I)\) . If \(f\) is differentiable at \(a\) with \(f'(a)\ne 0\) , then \(g\) is differentiable at \(b=f(a)\) and
Proof. Let \(y_n\in J\) with \(y_n\ne b\) and \(y_n\to b\) , and put \(x_n=g(y_n)\) . Then \(x_n\ne a\) because \(g\) is one-to-one, and \(x_n\to a\) because \(g\) is continuous at \(b\) by Theorem 5.10. Therefore
using the quotient law, which applies since \(f'(a)\ne 0\) . By the sequential form of the definition of a limit, \(g'(b)=1/f'(a)\) .
The hypothesis \(f'(a)\ne 0\) cannot be removed: \(f(x)=x^3\) is strictly increasing with \(f'(0)=0\) , and its inverse \(y^{1/3}\) is not differentiable at \(0\) . For \(f(x)=x^n\) on \((0,\infty)\) the theorem gives the derivative of \(g(y)=y^{1/n}\) as \(1/(n\,g(y)^{n-1})=\tfrac1n\,y^{1/n-1}\) , extending the power rule to roots.
The chapter has gone from the definition of the derivative to global conclusions in one essential step, the Mean Value Theorem. The reverse journey, from a derivative back to the function, is integration. Chapter 7 defines the integral without reference to derivatives and then proves that the two operations undo each other; the proof of that fact will use the Mean Value Theorem once more.
Exercises
-
Compute from Definition 6.1, by finding the function \(\varphi\) of Proposition 6.2 explicitly, the derivative of \(f(x)=1/x\) at a point \(a\ne 0\) and of \(f(x)=\sqrt x\) at a point \(a>0\) .
Answer
For \(f(x)=1/x\) : \(\dfrac{1/x-1/a}{x-a}=-\dfrac{1}{xa}\) , so \(\varphi(x)=-1/(xa)\) , continuous at \(a\) , and \(f'(a)=-1/a^2\) . For \(f(x)=\sqrt x\) : \(\varphi(x)=1/(\sqrt x+\sqrt a)\) , and \(f'(a)=1/(2\sqrt a)\) .
-
Let \(f(x)=x\lvert x\rvert\) . Show that \(f\) is differentiable on \(\mathbb R\) , find \(f'\) , and decide whether \(f'\) is differentiable at \(0\) .
Solution
Here \(f(x)=x^2\) for \(x\ge 0\) and \(f(x)=-x^2\) for \(x<0\) .
Away from \(0\) . If \(a>0\) , then \(f(x)=x^2\) for all \(x\) in a neighbourhood of \(a\) , and the derivative at a point depends only on the function near that point, so \(f'(a)=2a\) . If \(a<0\) , similarly \(f'(a)=-2a\) . In both cases \(f'(a)=2\lvert a\rvert\) .
At \(0\) . The formulas on the two sides differ, so we use the definition. For \(x\ne 0\) ,
\[ \frac{f(x)-f(0)}{x-0}=\frac{x\lvert x\rvert}{x}=\lvert x\rvert\to 0\quad\text{as }x\to 0 . \]So \(f'(0)=0\) , which also equals \(2\lvert 0\rvert\) .
Hence \(f\) is differentiable on \(\mathbb R\) with \(f'(x)=2\lvert x\rvert\) , a continuous function: \(f\) is of class \(C^1\) .
Second derivative at \(0\) . The difference quotient of \(f'\) at \(0\) is \(2\lvert x\rvert/x\) , which is \(2\) for \(x>0\) and \(-2\) for \(x<0\) . It has no limit, so \(f'\) is not differentiable at \(0\) . The function \(f\) is once but not twice differentiable at \(0\) ; multiplying \(\lvert x\rvert\) by \(x\) smoothed the corner by exactly one order.
-
Let \(f(x)=x^2\) for rational \(x\) and \(f(x)=0\) for irrational \(x\) . Prove that \(f\) is differentiable at \(0\) , and that \(f\) is not continuous, hence not differentiable, at any other point.
Solution
At \(0\) . For \(x\ne 0\) the difference quotient is \(f(x)/x\) , which equals \(x\) if \(x\) is rational and \(0\) if \(x\) is irrational. In both cases \(\lvert f(x)/x\rvert\le\lvert x\rvert\) . Given \(\varepsilon>0\) , take \(\delta=\varepsilon\) : if \(0<\lvert x\rvert<\delta\) then \(\lvert f(x)/x-0\rvert<\varepsilon\) . So \(f'(0)=0\) .
At \(a\ne 0\) . By the density of the rationals and of the irrationals (Theorem 1.10 and Corollary 1.12) there are rationals \(q_n\to a\) and irrationals \(t_n\to a\) . Then
\[ f(q_n)=q_n^2\to a^2\ne 0,\qquad f(t_n)=0\to 0 . \]If \(f\) were continuous at \(a\) , both sequences \(f(q_n)\) and \(f(t_n)\) would converge to \(f(a)\) by Theorem 5.2, forcing \(a^2=0\) . So \(f\) is not continuous at \(a\) , and by Corollary 6.3 it is not differentiable at \(a\) .
Thus \(f\) is differentiable at exactly one point, and continuous at exactly one point. Differentiability at a point is a statement about that point only; it implies nothing about the function’s behaviour at any other point, however near.
-
Prove the quotient rule of Theorem 6.4(c) using Proposition 6.2, first for the reciprocal \(1/g\) and then by combining with the product rule.
Hint
Since \(g\) is continuous at \(a\) and \(g(a)\ne 0\) , \(g(x)\ne 0\) for \(x\) near \(a\) (Exercise 5.3). For such \(x\) , \(\dfrac1{g(x)}-\dfrac1{g(a)}=-\dfrac{g(x)-g(a)}{g(x)g(a)}=-\dfrac{\psi(x)}{g(x)g(a)}\,(x-a)\) , and the coefficient is continuous at \(a\) with value \(-g'(a)/g(a)^2\) . Then apply the product rule to \(f\cdot(1/g)\) .
-
For each integer \(k\ge 0\) let \(f_k(x)=x^k\sin(1/x)\) for \(x\ne 0\) and \(f_k(0)=0\) . For which \(k\) is \(f_k\) continuous at \(0\) ? Differentiable at \(0\) ? Continuously differentiable at \(0\) ?
Answer
Continuous at \(0\) exactly for \(k\ge 1\) (for \(k=0\) , \(\sin(1/x)\) has no limit). Differentiable at \(0\) exactly for \(k\ge 2\) , since the difference quotient is \(x^{k-1}\sin(1/x)\) . Continuously differentiable at \(0\) exactly for \(k\ge 3\) : for \(x\ne 0\) , \(f_k'(x)=kx^{k-1}\sin(1/x)-x^{k-2}\cos(1/x)\) , which tends to \(f_k'(0)=0\) only if \(k-2\ge 1\) .
-
Find all points \(c\) that satisfy the conclusion of the Mean Value Theorem for \(f(x)=x^3-x\) on \([0,2]\) and for \(f(x)=1/x\) on \([1,4]\) .
Answer
For \(x^3-x\) on \([0,2]\) : the secant slope is \((6-0)/2=3\) , and \(3c^2-1=3\) gives \(c=2/\sqrt3\approx 1.1547\) (the negative root is outside the interval). For \(1/x\) on \([1,4]\) : the secant slope is \((\tfrac14-1)/3=-\tfrac14\) , and \(-1/c^2=-\tfrac14\) gives \(c=2\) .
-
Use the Mean Value Theorem to prove that \(x/(1+x)<\log(1+x)<x\) for every \(x>0\) .
Solution
Fix \(x>0\) and let \(f(t)=\log(1+t)\) for \(t\in[0,x]\) . It is continuous on \([0,x]\) and differentiable on \((0,x)\) with \(f'(t)=1/(1+t)\) . By the Mean Value Theorem there is \(c\in(0,x)\) with
\[ \log(1+x)-\log 1=\frac{1}{1+c}\,(x-0),\qquad\text{that is,}\qquad\log(1+x)=\frac{x}{1+c}. \]Since \(0<c<x\) we have \(1<1+c<1+x\) , so \(\dfrac{1}{1+x}<\dfrac{1}{1+c}<1\) . Multiplying by \(x>0\) ,
\[ \frac{x}{1+x}<\log(1+x)<x . \]For example, with \(x=0.5\) the bounds are \(0.3333<\log 1.5<0.5\) , and \(\log 1.5\approx 0.4055\) . Neither the value of \(c\) nor its uniqueness was needed, only the interval in which it lies.
-
Let \(r\ge 1\) be a real number. Use the Mean Value Theorem to prove that \((1+x)^r\ge 1+rx\) for all \(x>-1\) , extending Lemma 2.6 from integer to real exponents.
Hint
Let \(f(t)=(1+t)^r-1-rt\) on \((-1,\infty)\) . Then \(f(0)=0\) and \(f'(t)=r\bigl((1+t)^{r-1}-1\bigr)\) , which has the sign of \(t\) when \(r>1\) and is identically \(0\) when \(r=1\) . So \(f\) is decreasing on \((-1,0]\) and increasing on \([0,\infty)\) by Corollary 6.8(b), and its minimum value is \(f(0)=0\) .
-
Let \(f:\mathbb R\to\mathbb R\) be differentiable with \(\lvert f'(x)\rvert\le c\) for all \(x\) , where \(c<1\) . Prove that for any starting value \(x_1\) the sequence \(x_{n+1}=f(x_n)\) converges, and that its limit is the unique solution of \(f(x)=x\) .
Solution
Contraction. By Corollary 6.8(c), \(\lvert f(x)-f(y)\rvert\le c\lvert x-y\rvert\) for all real \(x,y\) . Hence
\[ \lvert x_{n+2}-x_{n+1}\rvert=\lvert f(x_{n+1})-f(x_n)\rvert\le c\,\lvert x_{n+1}-x_n\rvert . \]If \(c>0\) the sequence is contractive in the sense of Proposition 2.17; if \(c=0\) the same inequality holds with any constant in \((0,1)\) . Either way \((x_n)\) converges; call the limit \(L\) .
The limit is a fixed point. \(f\) is differentiable, hence continuous, so \(f(x_n)\to f(L)\) . But \(f(x_n)=x_{n+1}\to L\) . By uniqueness of limits, \(f(L)=L\) .
Uniqueness. If \(f(L)=L\) and \(f(L')=L'\) , then \(\lvert L-L'\rvert=\lvert f(L)-f(L')\rvert\le c\lvert L-L'\rvert\) , so \((1-c)\lvert L-L'\rvert\le 0\) . Since \(1-c>0\) , \(L=L'\) .
For instance \(f(x)=\tfrac12\cos x\) has \(\lvert f'\rvert\le\tfrac12\) . Starting from \(x_1=1\) the iteration gives \(0.2702\) , \(0.4819\) , \(0.4431\) , \(0.4517\) , and converges to the unique solution of \(\cos x=2x\) , which is \(0.450184\) to six places.
-
Find the error: “For \(f(x)=1/x\) we have \(f'(x)=-1/x^2<0\) at every point of the domain, so \(f\) is decreasing; hence \(f(-1)>f(1)\) , that is, \(-1>1\) .”
Answer
Corollary 6.8(b) is a statement about an interval. The domain of \(1/x\) is \((-\infty,0)\cup(0,\infty)\) , which is not an interval. The function is decreasing on each of the two pieces separately, and the corollary says nothing about how values on one piece compare with values on the other.
-
Let \(f\) be continuous on \([a,b]\) and differentiable on \((a,b)\) with \(f'(x)>0\) except at finitely many points, where \(f'(x)=0\) . Prove that \(f\) is strictly increasing on \([a,b]\) .
Hint
By Corollary 6.8(b), \(f\) is increasing. If \(f(x)=f(y)\) for some \(x<y\) , then \(f\) is constant on \([x,y]\) , so \(f'=0\) at every point of \((x,y)\) , which is infinitely many points.
-
Prove that a differentiable function on an interval with bounded derivative is uniformly continuous. Show that the converse is false by considering \(\sqrt x\) on \((0,1)\) .
Hint
Corollary 6.8(c) gives a Lipschitz bound, and Lipschitz functions are uniformly continuous. For the converse, \(\sqrt x\) on \((0,1)\) extends continuously to \([0,1]\) , so it is uniformly continuous by Theorem 5.15(b), but its derivative \(1/(2\sqrt x)\) is unbounded.
-
Prove that there is no differentiable function \(F:\mathbb R\to\mathbb R\) with \(F'(x)=0\) for \(x<0\) and \(F'(x)=1\) for \(x\ge 0\) .
Solution
Suppose such an \(F\) exists. It is differentiable on \([-1,1]\) , with \(F'(-1)=0\) and \(F'(1)=1\) . The number \(\lambda=\tfrac12\) lies strictly between these values, so by Darboux’s theorem (Theorem 6.9) there is \(c\in(-1,1)\) with \(F'(c)=\tfrac12\) . But \(F'\) takes only the values \(0\) and \(1\) . This is a contradiction, so no such \(F\) exists.
A direct argument shows where the trouble is. By Corollary 6.8(a) applied on \((-\infty,0]\) , \(F\) would be constant there, say \(F(x)=k\) . On \([0,\infty)\) the function \(F(x)-x\) has derivative \(0\) , so \(F(x)=x+k\) , the constant being the same because \(F(0)=k\) . Then the difference quotient of \(F\) at \(0\) is \(0\) from the left and \(1\) from the right, so \(F'(0)\) does not exist, contrary to the requirement \(F'(0)=1\) . The candidate antiderivative has a corner exactly where the proposed derivative jumps.
-
Let \(f:\mathbb R\to\mathbb R\) be differentiable with \(f'(x)\ne 0\) for every \(x\) . Prove that \(f\) is strictly monotone.
Solution
Suppose \(f'\) takes a positive value at some point \(p\) and a negative value at some point \(q\) . Then \(p\ne q\) , and \(0\) lies strictly between \(f'(q)\) and \(f'(p)\) . Applying Darboux’s theorem on the closed interval with endpoints \(p\) and \(q\) , on which \(f\) is differentiable, there is a point \(c\) between them with \(f'(c)=0\) . This contradicts the hypothesis.
Therefore \(f'\) does not change sign: since it is never \(0\) , either \(f'(x)>0\) for all \(x\) or \(f'(x)<0\) for all \(x\) . By Corollary 6.8(b), \(f\) is strictly increasing in the first case and strictly decreasing in the second.
Note that \(f'\) was not assumed continuous. Had it been, the Intermediate Value Theorem would give the zero directly; Darboux’s theorem is what allows the argument for every differentiable function.
-
Evaluate with L’Hôpital’s rule, checking the hypotheses each time: (a) \(\lim_{x\to 0}(e^x-1-x)/x^2\) ; (b) \(\lim_{x\to 1}\log x/(x-1)\) ; (c) \(\lim_{x\to 0}(x-\sin x)/x^3\) .
Answer
(a) \(\tfrac12\) : both limits are \(0\) ; the quotient of derivatives is \((e^x-1)/(2x)\) , again of the same type, with quotient of derivatives \(e^x/2\to\tfrac12\) . (b) \(1\) : both tend to \(0\) ; the quotient of derivatives is \((1/x)/1\to 1\) . (c) \(\tfrac16\) : three applications, through \((1-\cos x)/(3x^2)\) and \(\sin x/(6x)\) to \(\cos x/6\to\tfrac16\) .
-
A student computes \(\lim_{x\to 0}(x+1)/(2x+3)\) “by L’Hôpital’s rule” as \(\lim_{x\to 0}1/2=\tfrac12\) . Find the correct limit and the hypothesis that was not checked.
Answer
The function is continuous at \(0\) , so the limit is its value there, \(\tfrac13\) . L’Hôpital’s rule requires the numerator and the denominator both to tend to \(0\) ; here they tend to \(1\) and \(3\) .
-
Let \(f(x)=\sqrt{1+x}\) . Write down its Taylor polynomial \(P_2\) at \(0\) , use it to approximate \(\sqrt{1.1}\) , and use Theorem 6.12 to bound the error.
Solution
Derivatives. With \(f(x)=(1+x)^{1/2}\) on \((-1,\infty)\) ,
\[ f'(x)=\tfrac12(1+x)^{-1/2},\qquad f''(x)=-\tfrac14(1+x)^{-3/2},\qquad f'''(x)=\tfrac38(1+x)^{-5/2}. \]So \(f(0)=1\) , \(f'(0)=\tfrac12\) , \(f''(0)=-\tfrac14\) , and
\[ P_2(x)=1+\frac x2-\frac{x^2}{8}. \]Approximation. \(P_2(0.1)=1+0.05-0.00125=1.04875\) .
Error. By Theorem 6.12 with \(n=2\) , \(a=0\) , \(x=0.1\) ,
\[ \sqrt{1.1}-P_2(0.1)=\frac{f'''(c)}{3!}\,(0.1)^3\qquad\text{for some }c\in(0,0.1). \]For such \(c\) , \(0<f'''(c)=\tfrac38(1+c)^{-5/2}<\tfrac38\) . Hence
\[ 0<\sqrt{1.1}-1.04875<\frac{3/8}{6}\cdot 0.001=0.0000625 . \]So \(1.04875<\sqrt{1.1}<1.0488125\) . The true value is \(1.0488088\) , with error about \(0.0000588\) , inside the bound and of the predicted sign.
Two features of the estimate are worth noticing. Because the third derivative is positive on the whole interval, the theorem gives not only the size of the error but its direction: the quadratic polynomial underestimates the square root. And the bound was obtained by replacing the unknown point \(c\) with the endpoint at which the third derivative is largest, which is the usual way to make the remainder computable.
-
Let \(f\) be twice differentiable on an open interval \(I\) with \(f''(x)\ge 0\) for all \(x\in I\) . Prove that the graph of \(f\) lies above each of its tangent lines: \(f(x)\ge f(a)+f'(a)(x-a)\) for all \(a,x\in I\) .
Solution
Let \(a,x\in I\) . If \(x=a\) the inequality is an equality. If \(x\ne a\) , apply Taylor’s theorem (Theorem 6.12) with \(n=1\) : there is a point \(c\) strictly between \(a\) and \(x\) , hence in \(I\) , with
\[ f(x)=f(a)+f'(a)(x-a)+\frac{f''(c)}{2}\,(x-a)^2 . \]By hypothesis \(f''(c)\ge 0\) , and \((x-a)^2>0\) . So the last term is nonnegative and
\[ f(x)\ge f(a)+f'(a)(x-a). \]The right side is the tangent line to the graph at \(a\) , so the graph lies on or above every tangent line. Functions with this property are the convex ones; the property is the starting point of the theory developed in Continuous Optimization. If \(f''>0\) throughout, the inequality is strict for \(x\ne a\) .
-
Let \(f(x)=e^{-1/x^2}\) for \(x\ne 0\) and \(f(0)=0\) . Prove that \(f'(0)=0\) . Then show by induction that for \(x\ne 0\) every derivative has the form \(f^{(n)}(x)=q_n(1/x)\,e^{-1/x^2}\) with \(q_n\) a polynomial, and deduce that \(f^{(n)}(0)=0\) for all \(n\) .
Hint
The key limit is \(\lim_{x\to 0}x^{-k}e^{-1/x^2}=0\) for every integer \(k\ge 0\) . To prove it put \(u=1/x^2\) and use \(e^u\ge u^m/m!\) for \(u>0\) , which follows from Taylor’s theorem applied to \(e^u\) . The case \(k=1\) gives \(f'(0)=0\) . For the induction, differentiating \(q_n(1/x)e^{-1/x^2}\) produces a polynomial in \(1/x\) times \(e^{-1/x^2}\) ; then \(f^{(n+1)}(0)=\lim_{x\to 0}q_n(1/x)e^{-1/x^2}/x=0\) by the key limit.
-
Let \(f(x)=x^3+x\) . Prove that \(f\) has an inverse \(g:\mathbb R\to\mathbb R\) which is differentiable everywhere, and compute \(g'(0)\) and \(g'(2)\) .
Solution
Invertibility. \(f\) is a polynomial, so it is continuous and differentiable, with \(f'(x)=3x^2+1>0\) for all \(x\) . By Corollary 6.8(b) it is strictly increasing, hence one-to-one. Its image is an interval by Corollary 5.8. Since \(f(n)\ge n\) and \(f(-n)\le-n\) for every \(n\in\mathbb N\) , the image is unbounded in both directions, so it is all of \(\mathbb R\) . Thus \(f\) has an inverse \(g:\mathbb R\to\mathbb R\) , continuous by Theorem 5.10.
Differentiability. Since \(f'(a)\ne 0\) for every \(a\) , Theorem 6.14 applies at every point: \(g\) is differentiable on \(\mathbb R\) and
\[ g'(f(a))=\frac{1}{3a^2+1}. \]Values. \(f(0)=0\) , so \(g(0)=0\) and \(g'(0)=1/(0+1)=1\) . \(f(1)=2\) , so \(g(2)=1\) and \(g'(2)=1/(3+1)=\tfrac14\) .
As a check, \(g(2.01)\) should be close to \(1+0.01\cdot\tfrac14=1.0025\) ; solving \(x^3+x=2.01\) numerically gives \(x\approx 1.002495\) .
-
Prove that a polynomial of degree \(n\ge 1\) has at most \(n\) distinct real zeros, by induction using Rolle’s theorem. Then outline a proof of L’Hôpital’s rule when \(g(x)\to\infty\) as \(x\to a^+\) : for \(a<x<y\) apply Theorem 6.10 on \([x,y]\) , and write \(f(x)/g(x)\) in terms of the resulting quotient.
Hint
A polynomial of degree \(1\) has one zero. If a polynomial \(p\) of degree \(n+1\) had \(n+2\) distinct real zeros, Rolle’s theorem between consecutive zeros would give \(n+1\) distinct zeros of \(p'\) , a polynomial of degree \(n\) . For the second part: for \(a<x<y\) , Theorem 6.10 gives \(c\in(x,y)\) with \(\dfrac{f(x)-f(y)}{g(x)-g(y)}=\dfrac{f'(c)}{g'(c)}\) . Write \(\dfrac{f(x)}{g(x)}=\dfrac{f(x)-f(y)}{g(x)-g(y)}\Bigl(1-\dfrac{g(y)}{g(x)}\Bigr)+\dfrac{f(y)}{g(x)}\) ; first fix \(y\) close to \(a\) so that the quotient of derivatives is within \(\varepsilon\) of \(L\) on \((a,y)\) , then let \(x\to a^+\) so that \(g(y)/g(x)\) and \(f(y)/g(x)\) tend to \(0\) .
-
Let \(f\) be continuous on \([a,b)\) and differentiable on \((a,b)\) , and suppose \(\lim_{x\to a^+}f'(x)=L\) exists. Prove that \(f\) is differentiable at \(a\) with \(f'(a)=L\) . Deduce that a derivative cannot have a removable discontinuity.
Hint
For \(x\in(a,b)\) the Mean Value Theorem on \([a,x]\) gives \(c_x\in(a,x)\) with \((f(x)-f(a))/(x-a)=f'(c_x)\) . As \(x\to a^+\) , \(c_x\to a^+\) and \(f'(c_x)\to L\) . For the deduction: if \(f\) is differentiable near \(a\) and \(\lim_{x\to a}f'(x)\) exists, the two one-sided versions give \(f'(a)\) equal to that limit, so \(f'\) is continuous at \(a\) .