3.3 Differentiability, Mean Value Theorems and Taylor’s Theorem
The derivative as a limit and as a continuous slope function, the chain rule, Rolle's theorem and the mean value theorems of Lagrange and Cauchy, L'Hôpital's rule, Darboux's theorem, Taylor's theorem with remainder, and convex functions — with the standard pathological examples that CSIR NET loves.
The derivative compresses the behaviour of a function near a point into a single number, the slope of the best linear approximation. Most of what calculus does with derivatives — proving inequalities, counting roots, locating maxima, computing limits, estimating errors — rests on one theorem that turns this local information into global information: the mean value theorem. If $f'$ is small on an interval, $f$ changes little there; if $f'\gt0$, $f$ increases; if $f'=0$, $f$ is constant. Cauchy's two-function version gives L'Hôpital's rule, and applying the same idea to higher derivatives gives Taylor's theorem, which says how far $f$ is from its Taylor polynomial. All of these rest on the completeness of $\mathbb{R}$ through the extreme value theorem (§3.1): Rolle's theorem needs a maximum to be attained.
Differentiability is also where intuition fails most often, and CSIR NET exploits this systematically. A function can be differentiable everywhere while its derivative is discontinuous ($x^2\sin\frac1x$); a derivative can be discontinuous, yet it can never jump (Darboux's theorem); $f'(c)\gt0$ does not make $f$ increasing near $c$; a function can have derivatives of all orders and still differ from its Taylor series ($e^{-1/x^2}$); and a continuous function can fail to be differentiable at every point (Weierstrass). This section proves the main theorems carefully, with all their hypotheses, and then tests each hypothesis against a counterexample.
The Derivative: Carathéodory's Form and the Chain Rule
The difference quotient has a hole at $x=c$. Carathéodory's reformulation fills the hole with a continuous function and thereby turns statements about derivatives into statements about continuity, which we already know how to handle (§3.1).
Proof. If $f'(c)$ exists, define $\varphi(x)=\dfrac{f(x)-f(c)}{x-c}$ for $x\ne c$ and $\varphi(c)=f'(c)$. The identity holds for $x\ne c$ by construction and for $x=c$ because both sides are $0$; and $\varphi(x)\to f'(c)=\varphi(c)$ as $x\to c$, which is continuity at $c$. Conversely, if such a $\varphi$ exists, then for $x\ne c$ the difference quotient equals $\varphi(x)$, which tends to $\varphi(c)$ by continuity; so $f'(c)$ exists and equals $\varphi(c)$. Uniqueness: for $x\ne c$ the identity forces the value of $\varphi(x)$, and continuity at $c$ forces $\varphi(c)$. ∎
Proof. Write $f(x)-f(c)=\varphi(x)(x-c)$ and $g(x)-g(c)=\psi(x)(x-c)$ with $\varphi,\psi$ continuous at $c$. (a) The right side $\varphi(x)(x-c)\to\varphi(c)\cdot0=0$. (b) $(f+g)(x)-(f+g)(c)=(\varphi+\psi)(x)(x-c)$ and $\varphi+\psi$ is continuous at $c$; similarly for $\alpha f$. (c) $$\begin{aligned}f(x)g(x)-f(c)g(c)&=\big(f(x)-f(c)\big)g(x)\\&\quad+f(c)\big(g(x)-g(c)\big)\\&=\big[\varphi(x)g(x)+f(c)\psi(x)\big](x-c),\end{aligned}$$ and the bracket is continuous at $c$ (since $g$ is, by (a)) with value $f'(c)g(c)+f(c)g'(c)$. (d) By (a) $g$ is nonzero on some interval $J\ni c$ of $I$. For $x\in J$, $$\frac1{g(x)}-\frac1{g(c)}=\frac{g(c)-g(x)}{g(x)g(c)}=\left[\frac{-\psi(x)}{g(x)g(c)}\right](x-c),$$ and the bracket is continuous at $c$ with value $-g'(c)/g(c)^2$. Now apply (c) to $f\cdot\frac1g$. ∎
Proof. Write $f(x)-f(c)=\varphi(x)(x-c)$ with $\varphi$ continuous at $c$, and $g(y)-g(f(c))=\psi(y)\big(y-f(c)\big)$ with $\psi$ continuous at $f(c)$. Substituting $y=f(x)$: $$\begin{aligned}g(f(x))-g(f(c))&=\psi(f(x))\big(f(x)-f(c)\big)\\&=\big[\psi(f(x))\,\varphi(x)\big](x-c).\end{aligned}$$ Since $f$ is continuous at $c$ (Theorem 3.22(a)) and $\psi$ is continuous at $f(c)$, the composite $\psi\circ f$ is continuous at $c$; so the bracket is continuous at $c$, with value $\psi(f(c))\varphi(c)=g'(f(c))f'(c)$. Theorem 3.21 finishes the proof. ∎
The familiar "proof" writes $\frac{g(f(x))-g(f(c))}{x-c}=\frac{g(f(x))-g(f(c))}{f(x)-f(c)}\cdot\frac{f(x)-f(c)}{x-c}$, which divides by zero whenever $f(x)=f(c)$ for $x$ arbitrarily close to $c$ — as happens for $f(x)=x^2\sin\frac1x$ at $c=0$. Carathéodory's form never divides.
Proof. Let $f(x)-f(c)=\varphi(x)(x-c)$ with $\varphi$ continuous at $c$ and $\varphi(c)=f'(c)\ne0$. For $x\ne c$, injectivity gives $f(x)\ne f(c)$, hence $\varphi(x)\ne0$; so $\varphi$ never vanishes on $I$. Put $x=g(y)$ for $y\in f(I)$: $y-d=\varphi(g(y))\big(g(y)-c\big)$, that is, $$g(y)-g(d)=\frac{1}{\varphi(g(y))}\,(y-d).$$ The function $1/(\varphi\circ g)$ is continuous at $d$ because $g$ is continuous at $d$, $\varphi$ is continuous at $g(d)=c$, and $\varphi(c)\ne0$. By Theorem 3.21, $g'(d)=1/\varphi(c)=1/f'(c)$. If $f'(c)=0$ and $g'(d)$ existed, the chain rule applied to $g\circ f=\mathrm{id}$ would give $1=g'(d)f'(c)=0$. ∎
For example $\sin$ is strictly increasing on $[-\tfrac\pi2,\tfrac\pi2]$ with $\sin'=\cos\gt0$ inside, so $\arcsin'(y)=\dfrac1{\cos(\arcsin y)}=\dfrac1{\sqrt{1-y^2}}$ for $-1\lt y\lt1$; at $y=\pm1$, where $\cos=0$, $\arcsin$ has vertical tangents. Likewise $x^3$ has derivative $0$ at $0$, so its inverse $x^{1/3}$ is not differentiable at $0$.
Proof. Suppose $c$ is a local maximum (for a minimum apply this to $-f$). For $0\lt h\lt\delta$ with $c+h\in I$, $\dfrac{f(c+h)-f(c)}{h}\le0$, so $f'(c)=f'_+(c)\le0$. For $-\delta\lt h\lt0$, $\dfrac{f(c+h)-f(c)}{h}\ge0$, so $f'(c)=f'_-(c)\ge0$. Hence $f'(c)=0$. ∎
Both hypotheses matter: $f(x)=x$ on $[0,1]$ has its maximum at the end point $1$, where $f'=1$; and $|x|$ has a minimum at $0$, where it is not differentiable. The converse fails too: $x^3$ has $f'(0)=0$ but no extremum at $0$. More precisely, the proof shows: if $f'_+(c)\gt0$ then $f(x)\gt f(c)$ for all $x\gt c$ close enough to $c$ — but, as we shall see, not that $f$ is increasing near $c$.
Rolle's Theorem and the Mean Value Theorems
Proof. By the extreme value theorem (§3.1), $f$ attains a maximum $M$ and a minimum $m$ on $[a,b]$. If both are attained only at end points, then $M=m=f(a)$, so $f$ is constant and $f'(c)=0$ for every $c\in(a,b)$. Otherwise $M$ or $m$ is attained at some interior point $c$; this is a local extremum and $f$ is differentiable at $c$, so $f'(c)=0$ by Theorem 3.25. ∎
Each hypothesis is needed: $|x|$ on $[-1,1]$ (not differentiable at one interior point); $f(x)=x$ on $[0,1)$ with $f(1)=0$ (discontinuous at an end point); $f(x)=x$ on $[0,1]$ (unequal end values). Note that differentiability at the end points is not required: $\sqrt{1-x^2}$ on $[-1,1]$ satisfies Rolle.
Proof. Subtract the chord: $g(x)=f(x)-f(a)-\dfrac{f(b)-f(a)}{b-a}(x-a)$. Then $g$ is continuous on $[a,b]$, differentiable on $(a,b)$, and $g(a)=g(b)=0$. Rolle gives $c\in(a,b)$ with $0=g'(c)=f'(c)-\dfrac{f(b)-f(a)}{b-a}$. ∎
Geometrically: somewhere strictly between $a$ and $b$ the tangent is parallel to the chord. The point $c$ need not be unique and the theorem does not say where it is; for $f(x)=x^2$ it is always the midpoint $c=\tfrac{a+b}2$, for $\sqrt x$ on $[0,b]$ it is $c=\tfrac b4$. The power of the theorem is that it converts information about $f'$ everywhere on an interval into information about $f$.
- If $f'=0$ on the interior, $f$ is constant on $I$. If $f'=g'$ on the interior (with $g$ like $f$), then $f-g$ is constant.
- If $f'\ge0$ on the interior, $f$ is increasing on $I$; if $f'\gt0$, strictly increasing. (Similarly for $\le$, $\lt$.) The converse of the strict statement fails: $x^3$ is strictly increasing with $f'(0)=0$.
- If $|f'|\le K$ on the interior, then $|f(x)-f(y)|\le K|x-y|$ for all $x,y\in I$: $f$ is $K$-Lipschitz, hence uniformly continuous (§3.2).
- Derivative limit theorem. If $f$ is continuous at $c\in I$, differentiable on $I\setminus\{c\}$, and $\lim_{x\to c}f'(x)=L$ exists in $\mathbb{R}$, then $f$ is differentiable at $c$ and $f'(c)=L$.
Proof. For $x\lt y$ in $I$, the MVT on $[x,y]$ gives $\xi\in(x,y)$ with $f(y)-f(x)=f'(\xi)(y-x)$. (1) The right side is $0$. Apply this to $f-g$ for the second statement. (2) The right side is $\ge0$ (resp. $\gt0$). (3) $|f(y)-f(x)|=|f'(\xi)|\,|y-x|\le K|y-x|$. (4) For $x\ne c$ near $c$, the MVT on the interval between $c$ and $x$ (where $f$ is continuous, and differentiable inside) gives $\xi_x$ strictly between $c$ and $x$ with $\dfrac{f(x)-f(c)}{x-c}=f'(\xi_x)$. As $x\to c$, $\xi_x\to c$ with $\xi_x\ne c$, so $f'(\xi_x)\to L$. ∎
Part (4) is a quick way to compute derivatives of piecewise-defined functions at the joins, and it already shows that a derivative cannot have a removable discontinuity: if $f'(x)\to L$ as $x\to c$, then $f'(c)=L$. Darboux's theorem below goes further.
Proof. Let $h(x)=\big(f(b)-f(a)\big)g(x)-\big(g(b)-g(a)\big)f(x)$. It is continuous on $[a,b]$, differentiable on $(a,b)$, and a direct computation gives $h(a)=f(b)g(a)-g(b)f(a)=h(b)$. Rolle gives $c$ with $h'(c)=0$, which is the identity. If $g'\ne0$ on $(a,b)$, then $g(b)\ne g(a)$ (otherwise Rolle would give a zero of $g'$), and we may divide; $g'(c)\ne0$ as well. ∎
With $g(x)=x$ this is Lagrange's theorem. Geometrically, the curve $t\mapsto\big(g(t),f(t)\big)$ has, at some interior time $c$, a tangent parallel to the chord joining its end points. Do not try to prove Cauchy's theorem by applying Lagrange to $f$ and $g$ separately: that produces two possibly different points $c_1,c_2$.
A warning about vector- and complex-valued functions. The mean value equality is a statement about real-valued functions. For $F(t)=(\cos t,\sin t)$, i.e. $e^{it}$, on $[0,2\pi]$ we have $F(2\pi)-F(0)=0$ but $|F'(t)|=1$ for every $t$, so no $c$ satisfies $F(2\pi)-F(0)=2\pi F'(c)$. What survives is the mean value inequality $|F(b)-F(a)|\le(b-a)\sup|F'|$.
- An inequality between $f(x)$ and $f(y)$? Write $f(x)-f(y)=f'(\xi)(x-y)$ and bound $f'$ on the interval between them (Example 2(a), (b)).
- Exactly $k$ roots? Existence from the intermediate value theorem; "at most $k$" from Rolle: if $f^{(k)}$ never vanishes, $f$ has at most $k$ zeros (Example 2(c)). For "at most one", show $f'\ne0$, i.e. $f$ strictly monotone.
- Behaviour of $f$ as $x\to\infty$ from $f'$? Apply the MVT on $[M,x]$ or $[n,n+1]$ (Example 3).
- Two functions or a ratio? Use Cauchy's form — or L'Hôpital, which is Cauchy's form in disguise.
- Know the hypotheses: continuous on the closed interval, differentiable on the open one, real-valued. Check each one before quoting the theorem in a Part C option.
L'Hôpital's Rule, Darboux's Theorem and Pathological Derivatives
Proof. Since $g'\ne0$ on $(a,b)$, Rolle's theorem shows $g$ is injective there, so $g(x)\ne g(y)$ for $x\ne y$, and $g$ is strictly monotone (continuous injective functions on intervals are, §3.1). We treat finite $L$; for $L=+\infty$ replace "$|\,\cdot-L|\lt\varepsilon$" by "$\cdot\gt K$" throughout, and $L=-\infty$ is symmetric.
Fix $\varepsilon\gt0$ and choose $c\in(a,b)$ with $\left|\dfrac{f'(t)}{g'(t)}-L\right|\lt\varepsilon$ for all $t\in(a,c)$. For $a\lt x\lt y\lt c$, Cauchy's MVT on $[x,y]$ gives $t\in(x,y)$ with $$Q(x,y):=\frac{f(y)-f(x)}{g(y)-g(x)}=\frac{f'(t)}{g'(t)},$$ so that $$|Q(x,y)-L|\lt\varepsilon.\qquad(*)$$
Case (i). Fix $y\in(a,c)$ and let $x\to a+$: $f(x)\to0$ and $g(x)\to0$. Since $g$ is strictly monotone with limit $0$ at $a$, $g(y)\ne0$. So $Q(x,y)\to f(y)/g(y)$, and $(*)$ gives $\left|\dfrac{f(y)}{g(y)}-L\right|\le\varepsilon$ for every $y\in(a,c)$. This is the claim.
Case (ii). Now fix $y=c'\in(a,c)$ and let $x\to a+$ (here $x$ is the moving point). Since $|g(x)|\to\infty$, for $x$ close to $a$ we have $g(x)\ne0$, and dividing numerator and denominator of $Q(x,c')$ by $g(x)$, $$\frac{f(x)}{g(x)}=Q(x,c')\left(1-\frac{g(c')}{g(x)}\right)+\frac{f(c')}{g(x)}.$$ Hence $$\begin{aligned}\left|\frac{f(x)}{g(x)}-L\right|&\le|Q-L|+|Q|\frac{|g(c')|}{|g(x)|}+\frac{|f(c')|}{|g(x)|}\\&\lt\varepsilon+(|L|+\varepsilon)\frac{|g(c')|}{|g(x)|}+\frac{|f(c')|}{|g(x)|},\end{aligned}$$ where $Q=Q(x,c')$. The last two terms tend to $0$ as $x\to a+$, so $|f(x)/g(x)-L|\lt2\varepsilon$ for $x$ close to $a$. ∎
Two remarks that CSIR NET tests directly. The rule is only sufficient. For $\lim_{x\to\infty}\dfrac{x+\sin x}{x}=1$, the ratio of derivatives $\dfrac{1+\cos x}{1}$ has no limit; the rule simply does not apply. The hypothesis $g'\ne0$ cannot be dropped (Stolz's example): with $f(x)=x+\sin x\cos x$ and $g(x)=e^{\sin x}f(x)$, one finds $f'(x)=2\cos^2x$ and $g'(x)=e^{\sin x}\cos x\,\big(f(x)+2\cos x\big)$. Cancelling the factor $\cos x$, which is illegitimate because it vanishes at $x=\tfrac\pi2+k\pi$, gives $\dfrac{f'}{g'}=\dfrac{2\cos x}{e^{\sin x}(f(x)+2\cos x)}\to0$, while $\dfrac fg=e^{-\sin x}$ oscillates between $e^{-1}$ and $e$ as $x\to\infty$.
- $f'(I)$ is an interval;
- $f'$ has no removable and no jump discontinuities — every discontinuity of a derivative is of the second kind;
- if $f'(x)\ne0$ for all $x\in I$, then $f'$ has constant sign and $f$ is strictly monotone;
- if $f'$ is monotone on $I$, then $f'$ is continuous.
Proof. Say $f'(a)\lt k\lt f'(b)$ (otherwise replace $f$ by $-f$ and $k$ by $-k$). Let $g(x)=f(x)-kx$; then $g$ is differentiable on $[a,b]$ with $g'(a)\lt0\lt g'(b)$. By the extreme value theorem $g$ attains its minimum on $[a,b]$ at some $c$. Since $g'(a)=\lim_{x\to a+}\frac{g(x)-g(a)}{x-a}\lt0$, there are $x\gt a$ arbitrarily close to $a$ with $g(x)\lt g(a)$, so the minimum is not at $a$. Likewise $g'(b)\gt0$ gives $x\lt b$ near $b$ with $g(x)\lt g(b)$, so it is not at $b$. Thus $c\in(a,b)$ is an interior minimum and $g'(c)=0$ (Theorem 3.25), i.e. $f'(c)=k$. Note that we never used continuity of $f'$ — only that $f'$ exists.
(1) is a restatement. (2) If $f'(c\pm)$ both exist, then $f'(c)=f'(c-)=f'(c+)$ by the derivative limit theorem (Theorem 3.28(4), applied on each side), so $f'$ is continuous at $c$. A function with the intermediate value property cannot have a jump either — but (2) follows here even more directly. (3) $f'(I)$ is an interval not containing $0$, so it lies in $(0,\infty)$ or in $(-\infty,0)$; apply Theorem 3.28(2). (4) A monotone function has only jump discontinuities (§3.2), and by (2) a derivative has none. ∎
So no differentiable function has derivative $\operatorname{sgn}x$, $\lfloor x\rfloor$, or the indicator of $[0,\infty)$ on an interval containing $0$ — even though such functions are Riemann integrable. Derivatives can be discontinuous, as the next example shows, but only by oscillating.
How badly can differentiability fail for a continuous function? Completely.
(b) (Takagi.) Let $\phi(x)=\operatorname{dist}(x,\mathbb{Z})$, the distance from $x$ to the nearest integer. Then $$T(x)=\sum_{n=0}^\infty2^{-n}\phi(2^nx)$$ is continuous on $\mathbb{R}$ and differentiable at no point.
Proof of (b). Continuity. Let $S_N$ be the $N$-th partial sum, a continuous function. Since $0\le\phi\le\tfrac12$, $|T(x)-S_N(x)|\le\sum_{n\gt N}2^{-n-1}=2^{-N-1}$ for every $x$. Hence $|T(x)-T(y)|\le|S_N(x)-S_N(y)|+2^{-N}$, and continuity of $S_N$ gives continuity of $T$. (This is uniform convergence and the Weierstrass M-test of §5.1.)
A lemma. If $f$ is differentiable at $x$ and $u_n\le x\le v_n$ with $u_n\lt v_n$ and $v_n-u_n\to0$, then $D_n=\dfrac{f(v_n)-f(u_n)}{v_n-u_n}\to f'(x)$. Indeed, if $u_n\lt x\lt v_n$, put $\lambda_n=\frac{v_n-x}{v_n-u_n}\in(0,1)$; then $D_n=\lambda_n\frac{f(v_n)-f(x)}{v_n-x}+(1-\lambda_n)\frac{f(x)-f(u_n)}{x-u_n}$, a convex combination of two quotients that both tend to $f'(x)$ (and if $x=u_n$ or $x=v_n$, $D_n$ is itself such a quotient).
No derivative. Fix $x$, let $m_n=\lfloor2^nx\rfloor$, $u_n=m_n2^{-n}$, $v_n=(m_n+1)2^{-n}$, so $u_n\le x\lt v_n$. For $k\ge n$, $2^ku_n$ and $2^kv_n$ are integers, so $\phi(2^ku_n)=\phi(2^kv_n)=0$: these terms contribute nothing to $T(v_n)-T(u_n)$. For $k\lt n$, the interval $[2^ku_n,2^kv_n]$ has length $2^{k-n}\le\tfrac12$ and its end points are multiples of $2^{k-n}$, so it contains no point of $\tfrac12\mathbb{Z}$ in its interior; on it $\phi$ is linear with slope $\pm1$, so $x\mapsto2^{-k}\phi(2^kx)$ is linear on $[u_n,v_n]$ with slope $\pm1$. Therefore $$D_n=\frac{T(v_n)-T(u_n)}{v_n-u_n}=\sum_{k=0}^{n-1}\varepsilon_k,\qquad\varepsilon_k\in\{1,-1\},$$ where $\varepsilon_k$ does not depend on $n$ (it is the slope of the $k$-th term on the dyadic interval of length $2^{-k-1}$ containing $x$). Thus $D_{n+1}-D_n=\varepsilon_n=\pm1$ for every $n$, so $(D_n)$ is not Cauchy and does not converge. By the lemma, $T'(x)$ does not exist. ∎
For (a) the idea is the same — the $n$-th term oscillates with amplitude $a^n$ but slope of order $(ab)^n\pi$, which outgrows everything before it — but the estimates are longer, and we only need the statement. Such functions are not exotic: Brownian motion, the standard model of noisy signals and stock prices, has nowhere-differentiable paths with probability one.
Taylor's Theorem
Proof. Fix $x$ and regard $c$ as a variable $t$: define, for $t$ in the closed interval $J$ between $c$ and $x$, $$F(t)=f(x)-\sum_{k=0}^n\frac{f^{(k)}(t)}{k!}(x-t)^k.$$ Then $F(x)=0$ and $F(c)=R_n(x)$. $F$ is continuous on $J$ (it involves $f,\dots,f^{(n)}$) and differentiable inside, and the derivative telescopes: $$\begin{aligned}F'(t)&=-\sum_{k=0}^n\frac{f^{(k+1)}(t)}{k!}(x-t)^k\\&\quad+\sum_{k=1}^n\frac{f^{(k)}(t)}{(k-1)!}(x-t)^{k-1}\\&=-\frac{f^{(n+1)}(t)}{n!}(x-t)^n.\end{aligned}$$ Let $p\gt0$ and $G(t)=(x-t)^p$, so $G(x)=0$, $G(c)=(x-c)^p$ and $G'(t)=-p(x-t)^{p-1}\ne0$ inside $J$. Cauchy's MVT (Theorem 3.29) on $J$ gives $\zeta$ strictly between $c$ and $x$ with $$\frac{F(x)-F(c)}{G(x)-G(c)}=\frac{F'(\zeta)}{G'(\zeta)},$$ that is, $$\frac{R_n(x)}{(x-c)^p}=\frac{f^{(n+1)}(\zeta)\,(x-\zeta)^{n+1-p}}{n!\,p}.$$ Taking $p=n+1$ gives the Lagrange form ($\xi=\zeta$), and $p=1$ gives the Cauchy form ($\eta=\zeta$). (General $p$ gives the Schlömilch form.) ∎
Why two remainders? Take $f(x)=\log(1+x)$, $c=0$, so $f^{(n+1)}(t)=\dfrac{(-1)^nn!}{(1+t)^{n+1}}$ and $T_n(x)=x-\tfrac{x^2}2+\cdots+(-1)^{n+1}\tfrac{x^n}{n}$. For $0\le x\le1$ the Lagrange form gives $|R_n(x)|=\dfrac{x^{n+1}}{(n+1)(1+\xi)^{n+1}}\le\dfrac1{n+1}\to0$; in particular $\log2=1-\tfrac12+\tfrac13-\cdots$. For $-1\lt x\lt0$ the Lagrange bound $\dfrac{|x|^{n+1}}{(n+1)(1+x)^{n+1}}$ is useless when $x\lt-\tfrac12$, since then $\frac{|x|}{1+x}\gt1$. The Cauchy form rescues us: $|R_n(x)|=\dfrac{|x|}{1+\eta}\left(\dfrac{\eta-x}{1+\eta}\right)^n$ with $x\lt\eta\lt0$, and $\dfrac{\eta-x}{1+\eta}\le|x|$ (this rearranges to $\eta(1+x)\le0$). Hence $|R_n(x)|\le\dfrac{|x|^{n+1}}{1+x}\to0$, and the Maclaurin series of $\log(1+x)$ converges to it on all of $(-1,1]$. Interactive 2 shows both bounds.
Proof. (a) For $n=1$ this is the definition of $f'(c)$. For $n\ge2$, $R=f-T_n$ satisfies $R(c)=R'(c)=\cdots=R^{(n)}(c)=0$, and $R^{(n-1)}$ exists near $c$. Apply L'Hôpital's rule (case (i)) $n-1$ times to $R(x)/(x-c)^n$: the successive quotients are $\dfrac{R^{(j)}(x)}{n(n-1)\cdots(n-j+1)(x-c)^{n-j}}$, all of type $\tfrac00$, with denominators having nonzero derivatives for $x\ne c$. The last one is $$\begin{aligned}\frac{R^{(n-1)}(x)}{n!\,(x-c)}&=\frac1{n!}\cdot\frac{R^{(n-1)}(x)-R^{(n-1)}(c)}{x-c}\\&\to\frac{R^{(n)}(c)}{n!}=0.\end{aligned}$$ Since this limit exists, each preceding limit exists and equals it.
(b) By (a), $f(x)-f(c)=\Big(\dfrac{f^{(n)}(c)}{n!}+\rho(x)\Big)(x-c)^n$ with $\rho(x)\to0$. For $x$ near $c$, the bracket has the sign of $f^{(n)}(c)$. If $n$ is even, $(x-c)^n\gt0$ for $x\ne c$, so $f(x)-f(c)$ has the sign of $f^{(n)}(c)$: a strict minimum or maximum. If $n$ is odd, $(x-c)^n$ changes sign at $c$, so $f(x)-f(c)$ takes both signs arbitrarily close to $c$: no extremum. ∎
Taylor series need not represent the function. Let $f(x)=e^{-1/x^2}$ for $x\ne0$ and $f(0)=0$. By induction, for $x\ne0$, $f^{(k)}(x)=P_k(1/x)\,e^{-1/x^2}$ with $P_k$ a polynomial; and since $t^me^{-t^2}\to0$ as $|t|\to\infty$, the derivative limit theorem (Theorem 3.28(4)) gives $f^{(k)}(0)=0$ for all $k$. So $f\in C^\infty(\mathbb{R})$, every Taylor polynomial at $0$ is identically $0$, and the Taylor series converges everywhere — to the zero function, not to $f$. A $C^\infty$ function equal to the sum of its Taylor series near each point is called real analytic; $e^{-1/x^2}$ is smooth but not analytic at $0$. Even an analytic function's Taylor series may converge only on a small interval: $\dfrac1{1+x^2}=\sum(-1)^kx^{2k}$ only for $|x|\lt1$.
Convex Functions
- Three-chord lemma. For $x\lt y\lt z$ in $I$: $\ \dfrac{f(y)-f(x)}{y-x}\le\dfrac{f(z)-f(x)}{z-x}\le\dfrac{f(z)-f(y)}{z-y}.$
- At every interior point $c$ of $I$, $f'_-(c)$ and $f'_+(c)$ exist and $f'_-(c)\le f'_+(c)$; for interior $c\lt d$, $f'_+(c)\le\dfrac{f(d)-f(c)}{d-c}\le f'_-(d)$.
- $f$ is continuous at every interior point of $I$ (not necessarily at end points).
- $f$ is differentiable at all but countably many interior points.
Proof. (1) Write $y=\lambda x+(1-\lambda)z$ with $\lambda=\frac{z-y}{z-x}\in(0,1)$. Convexity gives $f(y)\le\lambda f(x)+(1-\lambda)f(z)$. Subtracting $f(x)$ and using $1-\lambda=\frac{y-x}{z-x}$: $f(y)-f(x)\le\frac{y-x}{z-x}\big(f(z)-f(x)\big)$, the first inequality. Subtracting $f(z)$ instead and using $\lambda=\frac{z-y}{z-x}$: $f(y)-f(z)\le\frac{z-y}{z-x}\big(f(x)-f(z)\big)$; dividing by $-(z-y)$ gives the second.
(2) Fix an interior $c$ and let $s(x)=\frac{f(x)-f(c)}{x-c}$ for $x\in I\setminus\{c\}$. Applying (1) to the three points $\{x,c,x'\}$ in each possible order shows that $s$ is increasing on $I\setminus\{c\}$: $s(x)\le s(x')$ whenever $x\lt x'$. As $x\to c-$, $s(x)$ increases and is bounded above by $s(z)$ for any $z\gt c$ in $I$, so $f'_-(c)=\lim_{x\to c-}s(x)$ exists; likewise $s(x)$ decreases as $x\to c+$ and is bounded below, so $f'_+(c)$ exists, and $f'_-(c)\le f'_+(c)$. For $c\lt d$, $f'_+(c)=\inf_{x\gt c}s_c(x)\le s_c(d)$, and by symmetry $s_c(d)=s_d(c)\le\sup_{x\lt d}s_d(x)=f'_-(d)$.
(3) $f(x)-f(c)=s(x)(x-c)$, and $s$ is bounded near $c$ by (2), so $f(x)\to f(c)$. (4) By (2), for interior $c\lt d$ we have $f'_-(c)\le f'_+(c)\le f'_-(d)\le f'_+(d)$, so the open intervals $\big(f'_-(c),f'_+(c)\big)$ are pairwise disjoint. Each nonempty one — that is, each point of non-differentiability — contains a rational, and distinct points get distinct rationals. ∎
At an end point continuity can fail: $f(0)=1$ and $f(x)=0$ for $0\lt x\le1$ is convex on $[0,1]$. And (4) is sharp in the sense that $|x|$, or $\sum2^{-n}|x-r_n|$ over an enumeration $(r_n)$ of $\mathbb{Q}\cap(0,1)$, is convex and non-differentiable at the points $r_n$.
Proof. (i)⇒(ii): for $x\lt y$, Theorem 3.35(2) gives $f'(x)=f'_+(x)\le f'_-(y)=f'(y)$. (ii)⇒(iii): by the MVT, $f(y)-f(x)=f'(\xi)(y-x)$ with $\xi$ between $x$ and $y$. If $y\gt x$ then $f'(\xi)\ge f'(x)$ and $y-x\gt0$; if $y\lt x$ then $f'(\xi)\le f'(x)$ and $y-x\lt0$. Either way $f'(\xi)(y-x)\ge f'(x)(y-x)$. (iii)⇒(i): let $z=\lambda x+(1-\lambda)y$. By (iii) at $z$: $f(x)\ge f(z)+f'(z)(x-z)$ and $f(y)\ge f(z)+f'(z)(y-z)$. Multiply by $\lambda$ and $1-\lambda$ and add: $$\begin{aligned}&\lambda f(x)+(1-\lambda)f(y)\\&\quad\ge f(z)+f'(z)\big(\lambda x+(1-\lambda)y-z\big)=f(z).\end{aligned}$$ (ii)⇔(iv) is Theorem 3.28(2) applied to $f'$ (and the converse direction: an increasing differentiable function has $f''\ge0$, since its difference quotients are $\ge0$). If $f''\gt0$, then $f'$ is strictly increasing, the inequalities above become strict for $x\ne y$, and $f$ is strictly convex. Finally $x^4$ is strictly convex ($f'=4x^3$ is strictly increasing) but $f''(0)=0$. ∎
Proof. Induction on $n$; $n=1$ is trivial and $n=2$ is the definition. If $\lambda_n=1$ the claim is trivial; otherwise put $\mu=1-\lambda_n\gt0$ and $y=\sum_{i\lt n}\frac{\lambda_i}{\mu}x_i\in I$ (a convex combination of points of the interval $I$). Then $\sum_{i\le n}\lambda_ix_i=\mu y+\lambda_nx_n$, and $$\begin{aligned}f(\mu y+\lambda_nx_n)&\le\mu f(y)+\lambda_nf(x_n)\\&\le\mu\sum_{i\lt n}\frac{\lambda_i}{\mu}f(x_i)+\lambda_nf(x_n)\\&=\sum_{i\le n}\lambda_if(x_i),\end{aligned}$$ using the case $n=2$ and then the induction hypothesis. For AM–GM, $(-\log)''=1/x^2\gt0$, so $-\log$ is convex and $-\log\sum\lambda_ix_i\le-\sum\lambda_i\log x_i$; exponentiate. ∎
- Continuous but not differentiable: $|x|$ (corner), $x^{1/3}$ (vertical tangent), $x^{2/3}$ (cusp), $x\sin\frac1x$ at $0$ (oscillation); Weierstrass's and Takagi's functions are differentiable nowhere.
- Differentiable but not $C^1$: $x^2\sin\frac1x$ — its derivative exists everywhere but is discontinuous (second kind) at $0$. With $x^2\sin\frac1{x^2}$ the derivative is even unbounded on $[-1,1]$.
- Differentiable at a single point: $x^2$ on $\mathbb{Q}$, $0$ off $\mathbb{Q}$ (only at $0$).
- $f'(c)\gt0$ does not make $f$ increasing near $c$: $f(x)=x+2x^2\sin\frac1x$, $f(0)=0$, has $f'(0)=1$, but $f'\big(\frac1{2\pi n}\big)=1-2=-1$, so $f$ is not monotone on any interval around $0$.
- Every hypothesis of Rolle matters: $|x|$ on $[-1,1]$; $x$ on $[0,1)$ with $f(1)=0$; and the end values must be equal. Differentiability at the end points is not needed.
- No mean value equality for complex/vector functions: $e^{it}$ on $[0,2\pi]$.
- $f\to L$ does not give $f'\to0$: $\frac{\sin x^2}{x}$. $f'\to0$ does not give convergence of $f$: $\log x$. But if both $f$ and $f'$ have limits, $f'\to0$.
- Bounded $f$, unbounded $f'$: $\sqrt x$ on $(0,1)$; $\sin x^2$ on $\mathbb{R}$.
- L'Hôpital is only sufficient: $\frac{x+\sin x}{x}\to1$ though $\frac{1+\cos x}{1}$ has no limit. And $g'\ne0$ is essential: Stolz's example $f=x+\sin x\cos x$, $g=e^{\sin x}f$.
- Derivatives cannot jump (Darboux): there is no $f$ with $f'=\operatorname{sgn}$ or $f'=\mathbf 1_{[0,\infty)}$ on $\mathbb{R}$; but a derivative can be discontinuous ($x^2\sin\frac1x$). A derivative that is monotone is continuous.
- Smooth but not analytic: $e^{-1/x^2}$ has all Taylor polynomials at $0$ equal to $0$. Analytic on $\mathbb{R}$ with radius $1$: $\frac1{1+x^2}$.
- $f^{(n)}(c)=0$ is inconclusive until you reach the first nonzero derivative: $x^3$ (none), $x^4$ (minimum), $-x^4$ (maximum).
- Convexity: strictly convex does not mean $f''\gt0$ ($x^4$); convex need not be differentiable ($|x|$); convex on a closed interval need not be continuous at the end points; products of convex functions need not be convex ($x\cdot x^2$).
Exercises
- 1 Let $f(x)=|x|^3$. Find $f'$ and $f''$. Is $f$ three times differentiable at $0$? Is $f\in C^2(\mathbb{R})$?
- 2 Let $g$ be continuous at $0$. Prove that $f(x)=x\,g(x)$ is differentiable at $0$ with $f'(0)=g(0)$, and that $h(x)=|x|\,g(x)$ is differentiable at $0$ if and only if $g(0)=0$.
- 3 Find the Carathéodory function $\varphi$ of $f(x)=x^3$ at $c=2$ and read off $f'(2)$.
- 4 Prove the product rule using Theorem 3.21 only (no limits of quotients).
- 5 Prove that if $f$ is differentiable at $c$, then $\lim_{h\to0}\dfrac{f(c+h)-f(c-h)}{2h}=f'(c)$. Show by an example that this symmetric limit may exist where $f$ is not differentiable.
- 6 Let $f(x)=x+e^x$. Show that $f$ has a differentiable inverse on $\mathbb{R}$ and compute $(f^{-1})'(1)$.
- 7 Let $f:\mathbb{R}\to\mathbb{R}$ satisfy $|f(x)-f(y)|\le(x-y)^2$ for all $x,y$. Prove that $f$ is constant.
- 8 Show that $x^{1/3}$ is continuous and strictly increasing but not differentiable at $0$, and explain this with Theorem 3.24.
- 1 Find all $c$ given by the mean value theorem for $f(x)=x^3$ on $[0,2]$.
- 2 Prove that $\dfrac{x}{1+x^2}\lt\arctan x\lt x$ for all $x\gt0$.
- 3 Prove that $x^5+5x-3=0$ has exactly one real root, and locate it between consecutive tenths.
- 4 Prove that for every real $k$ the polynomial $x^3-3x+k$ has at most one root in $[-1,1]$.
- 5 Let $f$ be continuous on $[0,1]$, differentiable on $(0,1)$, with $f(0)=0$ and $f(1)=1$. Prove that there are distinct $a,b\in(0,1)$ with $\dfrac1{f'(a)}+\dfrac1{f'(b)}=2$.
- 6 Let $f$ be differentiable on $(a,b)$ (bounded interval) with $f'$ bounded. Prove that $f$ is uniformly continuous and that $\lim_{x\to a+}f(x)$ exists.
- 7 (Generalised Rolle.) Let $f$ be $n$ times differentiable on an interval and have $n+1$ distinct zeros there. Prove that $f^{(n)}$ has a zero. Deduce that $e^x=\alpha x^2+\beta x+\gamma$ has at most three real solutions, whatever $\alpha,\beta,\gamma$.
- 8 Let $f:[0,\infty)\to\mathbb{R}$ be continuous, differentiable on $(0,\infty)$, with $f(0)=0$ and $f'$ increasing. Prove that $x\mapsto f(x)/x$ is increasing on $(0,\infty)$.
- 9 For $0\lt a\lt b\lt\pi$, use Cauchy's mean value theorem to show $\dfrac{\sin b-\sin a}{\cos a-\cos b}=\cot c$ for some $c\in(a,b)$, and identify $c$.
- 1 Evaluate $\displaystyle\lim_{x\to0}\frac{\tan x-x}{x^3}$.
- 2 Evaluate $\displaystyle\lim_{x\to0+}(\sin x)^x$.
- 3 Evaluate $\displaystyle\lim_{x\to0}\left(\frac1x-\frac1{e^x-1}\right)$.
- 4 Evaluate $\displaystyle\lim_{x\to\infty}x\left(\frac\pi2-\arctan x\right)$.
- 5 Show that $\displaystyle\lim_{x\to\infty}\frac{2x+\sin2x}{2x+\sin x}=1$ although the ratio of the derivatives has no limit. Does this contradict Theorem 3.30?
- 6 Is there a differentiable $f:\mathbb{R}\to\mathbb{R}$ with $f'(x)=0$ for $x\lt0$ and $f'(x)=1$ for $x\ge0$?
- 7 Let $f$ be differentiable on an interval $I$ with $f'(x)\in\mathbb{Z}$ for all $x$. Prove that $f(x)=kx+m$ for some constants $k\in\mathbb{Z}$, $m\in\mathbb{R}$.
- 8 Show that $f(x)=x^2\sin\frac1{x^2}$, $f(0)=0$, is differentiable on $\mathbb{R}$ but $f'$ is unbounded on $[-1,1]$. Is $f$ Lipschitz on $[-1,1]$?
- 9 Prove directly (without quoting Theorem 3.31(4)) that if $f$ is differentiable on $(a,b)$ and $f'$ is increasing, then $f'$ is continuous.
- 1 Find the Maclaurin polynomial $T_2$ of $\sqrt{1+x}$ and use the Lagrange remainder to bound $|\sqrt{1.1}-T_2(0.1)|$. Compare with the actual error.
- 2 Use Taylor expansions to evaluate $\displaystyle\lim_{x\to0}\frac{\cos x-e^{-x^2/2}}{x^4}$.
- 3 Prove that $\sin x\ge x-\dfrac{x^3}6$ for all $x\ge0$.
- 4 Decide whether $0$ is a local extremum of (a) $x^2-x\sin x$; (b) $\tan x-\sin x-\dfrac{x^3}2$ (near $0$).
- 5 Use Taylor's theorem with Lagrange remainder to prove that $e$ is irrational.
- 6 Prove that $-\log x$ is convex on $(0,\infty)$ and deduce $a^{1/3}b^{2/3}\le\dfrac a3+\dfrac{2b}3$ for $a,b\gt0$.
- 7 Let $f,g:\mathbb{R}\to\mathbb{R}$ be convex. Prove or disprove: (a) $f+g$ is convex; (b) $\max(f,g)$ is convex; (c) $f\circ g$ is convex; (d) $f\circ g$ is convex if $f$ is also increasing.
- 8 Let $f$ be convex on an open interval $I$ and differentiable at $c\in I$ with $f'(c)=0$. Prove that $f$ has a global minimum at $c$.
- 9 Find constants $a,b$ such that $\sin x-x\,(a+b\cos x)=O(x^5)$ as $x\to0$, and then find $\displaystyle\lim_{x\to0}\frac{\sin x-x(a+b\cos x)}{x^5}$.
- 10 Applied. The period of a pendulum is computed with the small-angle approximation $\sin\theta\approx\theta$. Use Taylor's theorem to find an angle $\theta_0$ (in radians and in degrees) such that the relative error $\dfrac{\theta-\sin\theta}{\theta}$ is guaranteed to be below $1\%$ for $0\lt\theta\le\theta_0$.
E1. CSIR Part B The number of real solutions of $e^x=1+x+\dfrac{x^2}2$ is (A) $0$; (B) $1$; (C) $2$; (D) $3$.
E2. CSIR Part B GATE MA $\displaystyle\lim_{x\to0}\frac{\sin x-x\cos x}{x^3}$ equals (A) $0$; (B) $\tfrac16$; (C) $\tfrac13$; (D) $\tfrac12$.
E3. CSIR Part B Let $f:[0,2]\to\mathbb{R}$ be differentiable with $f(0)=1$, $f(2)=5$ and $f'(x)\le2$ for all $x$. Then $f(1)$ (A) equals $2$; (B) equals $3$; (C) equals $4$; (D) cannot be determined from the data.
E4. CSIR Part C Let $f(x)=x^2\sin\frac1x$ for $x\ne0$ and $f(0)=0$. Which of the following are true? (One or more options may be correct.) (A) $f$ is differentiable on $\mathbb{R}$. (B) $f'$ has a jump discontinuity at $0$. (C) $f'$ is bounded on $[-1,1]$. (D) $f$ is Lipschitz on $[-1,1]$.
E5. CSIR Part C Let $f:\mathbb{R}\to\mathbb{R}$ be differentiable. Which of the following are true? (A) If $f'(x)\ne0$ for every $x$, then $f$ is injective. (B) If $f'$ takes a positive and a negative value, then $f'(c)=0$ for some $c$. (C) If $f$ is bounded, then $f'$ is bounded. (D) If $\lim_{x\to\infty}f'(x)=1$, then $\lim_{x\to\infty}f(x)=\infty$.
E6. CSIR Part C Let $f:\mathbb{R}\to\mathbb{R}$ be twice differentiable with $f''(x)\ge0$ for all $x$. Which of the following are true? (A) $f(x)\ge f(0)+f'(0)\,x$ for all $x$. (B) If $f$ is bounded above, then $f$ is constant. (C) If $f$ is strictly convex, then $f''(x)\gt0$ for all $x$. (D) $f$ has at most two real zeros.
Suggested plan — 3 lectures × 60 min.
- Derivative and mean value theorems. Definition 3.9 and Carathéodory's form; prove the chain rule both ways and show where the naive proof breaks ($x^2\sin\frac1x$). Example 1 on the board. Fermat, Rolle (stress where the extreme value theorem enters), Lagrange; project Interactive 1 and let students predict, for $|x|$ and $x^{1/3}$, whether a mean value point exists before revealing it. Theorem 3.28 with the derivative limit theorem.
- Using the MVT; L'Hôpital; Darboux. Example 2 (root counting via $g'''$) and Example 3 as a "true or false" round. Cauchy's MVT and the parametric picture; L'Hôpital with the full proof of case (i) and the idea of case (ii); the two warning examples. Darboux's theorem with its proof (the minimum of $f(x)-kx$), then Example 5. Finish with the statement of Weierstrass's theorem and the parity idea behind Takagi's function.
- Taylor and convexity. Theorem 3.33 with the auxiliary function $F(t)$ — derive both remainders at once. The $\log(1+x)$ discussion with Interactive 2 (set $x^\ast=-0.7$ and press Play); $e^{-1/x^2}$ and $\frac1{1+x^2}$ on the widget. Example 6 and the higher derivative test. Convexity: three-chord lemma, Theorem 3.36, Jensen and AM–GM; Example 7.
Discussion questions. (1) Rolle's theorem needs the extreme value theorem. Is Rolle true for functions on $\mathbb{Q}\cap[0,1]$ (with derivatives defined through rational points only)? What goes wrong? (2) Why can a derivative be discontinuous but never jump? Give the shortest argument you can. (3) Interactive 2 shows the Lagrange bound for $\log(1+x)$ growing with $n$ at $x=-0.7$ while the error shrinks. Is the Lagrange remainder wrong there?
Misconceptions to watch for. "$f'(c)\gt0$ ⇒ increasing near $c$"; "differentiable ⇒ $C^1$"; "if $\lim f'/g'$ does not exist then $\lim f/g$ does not exist"; applying L'Hôpital to limits that are not of type $\frac00$ or $\frac\infty\infty$; proving Cauchy's MVT with two different points; using the MVT for complex-valued functions; "$f\to L$ ⇒ $f'\to0$"; "strictly convex ⇒ $f''\gt0$"; believing a $C^\infty$ function equals its Taylor series.
Suggested homework. I(1, 2, 6, 7), II(3, 5, 7, 8, 9), III(1, 3, 5, 6, 7, 8), IV(1, 3, 4, 5, 7, 9); Exam corner E3, E5, E6.
Research question. How small should the step $h$ be when a computer approximates a derivative by a difference quotient — and why does making $h$ smaller eventually make the answer worse?
Why it matters. Engineers and scientists differentiate measured or simulated data every day: velocities from GPS tracks in sports science, strain rates in materials testing, sensitivities of climate and finance models, gradients in machine-learning code checks. Taylor's theorem predicts the truncation error of a difference quotient, while floating-point arithmetic (about 16 significant digits in double precision, unit roundoff $u=2^{-53}\approx1.1\times10^{-16}$) adds a rounding error that grows as $h$ shrinks. The best step balances the two.
What to do.
- Use Taylor's theorem to show that the forward quotient $D_+(h)=\frac{f(x+h)-f(x)}{h}$ has truncation error $\frac h2f''(\xi)$ and the central quotient $D_0(h)=\frac{f(x+h)-f(x-h)}{2h}$ has truncation error $\frac{h^2}{6}f'''(\eta)$ (use the intermediate value theorem to merge two third-derivative terms).
- Model the rounding error of $D_+$ by $\frac{2u|f(x)|}{h}$ and of $D_0$ by $\frac{u|f(x)|}{h}$. Minimise the total error in $h$ for $f=\exp$ at $x=1$ and predict the optimal step and the smallest achievable error for each formula.
- In a spreadsheet or a few lines of Python, compute $|D_+(h)-e|$ and $|D_0(h)-e|$ for $h=10^{-1},10^{-2},\dots,10^{-15}$, and plot them on log–log axes. Compare with your predictions.
- Explain the slopes of the two straight parts of each plot in terms of the orders $h$, $h^2$ and $h^{-1}$.
Tools: Python (or any spreadsheet) in double precision; a log–log plot.
Hand in: The table and the plot, your predicted and observed optimal steps, and a paragraph explaining the "V"-shaped error curves with Taylor's theorem.
Going further. Read about complex-step differentiation, $f'(x)\approx\operatorname{Im}f(x+ih)/h$, which avoids the subtraction and allows $h=10^{-20}$, and about automatic differentiation, which underlies modern machine-learning software.
🧪 Self-check quiz
Q1. Which of the following can be the derivative of a differentiable function on $\mathbb{R}$?
Q2. For $f(x)=x^2$ on $[a,b]$, the point $c$ given by the mean value theorem is
Q3. Consider $\lim_{x\to\infty}\frac{x+\sin x}{x}$. Which statement is correct?
Q4. For $f(x)=e^{-1/x^2}$ ($x\ne0$), $f(0)=0$:
Q5. Let $f$ be differentiable on an open interval. Then $f$ is convex if and only if