Skip to content

Differentiability

5.1 The Derivative

Definition. f:(a,b)Rf : (a,b) \to \mathbb{R} is differentiable at c(a,b)c \in (a,b) if the limit

f"(c)=limh0f(c+h)f(c)hf"(c) = \lim_{h \to 0} \frac{f(c+h) - f(c)}{h}

Exists (as a finite real number).

Proposition 5.1. If ff is differentiable at ccThen ff is continuous at cc.

Proof. limxc(f(x)f(c))=limxcf(x)f(c)xc(xc)=f(c)0=0\lim_{x \to c} (f(x) - f(c)) = \lim_{x \to c} \frac{f(x) - f(c)}{x - c} \cdot (x - c) = f'(c) \cdot 0 = 0. \blacksquare

The converse is false: f(x)=xf(x) = |x| is continuous at 00 but not differentiable at 00.

5.2 Differentiation Rules

Theorem 5.1. If ff and gg are differentiable at ccThen:

  1. (f+g)(c)=f(c)+g(c)(f + g)'(c) = f'(c) + g'(c)
  2. (fg)(c)=f(c)g(c)+f(c)g(c)(fg)'(c) = f'(c)g(c) + f(c)g'(c)
  3. (f/g)(c)=f(c)g(c)f(c)g(c)g(c)2(f/g)'(c) = \frac{f'(c)g(c) - f(c)g'(c)}{g(c)^2} (if g(c)0g(c) \neq 0)
  4. (fg)(c)=f(g(c))g(c)(f \circ g)'(c) = f'(g(c)) \cdot g'(c) (Chain Rule)

5.3 Mean Value Theorem

Theorem 5.2 (Rolle’s Theorem). If f:[a,b]Rf : [a,b] \to \mathbb{R} is continuous on [a,b][a,b]Differentiable On (a,b)(a,b)And f(a)=f(b)f(a) = f(b)Then there exists c(a,b)c \in (a,b) such that f(c)=0f'(c) = 0.

Proof. By the Extreme Value Theorem, ff attains its maximum MM and minimum mm on [a,b][a,b]. If M=mM = mThen ff is constant and f(c)=0f'(c) = 0 for all c(a,b)c \in (a,b). Otherwise, at least one Of MM or mm is attained at some c(a,b)c \in (a,b) (since f(a)=f(b)f(a) = f(b)). By Fermat’s theorem, f(c)=0f'(c) = 0. \blacksquare

Theorem 5.3 (Mean Value Theorem). If f:[a,b]Rf : [a,b] \to \mathbb{R} is continuous on [a,b][a,b] and Differentiable on (a,b)(a,b)Then there exists c(a,b)c \in (a,b) such that

f(c)=f(b)f(a)baf'(c) = \frac{f(b) - f(a)}{b - a}

Proof. Define g(x)=f(x)f(b)f(a)ba(xa)g(x) = f(x) - \frac{f(b)-f(a)}{b-a}(x - a). Then g(a)=g(b)g(a) = g(b) and gg satisfies the Hypotheses of Rolle’s theorem. So g(c)=0g'(c) = 0 for some c(a,b)c \in (a,b)Which gives the result. \blacksquare

Corollary 5.4. If f(x)=0f'(x) = 0 for all x(a,b)x \in (a,b)Then ff is constant on [a,b][a,b].

Corollary 5.5. If f(x)>0f'(x) > 0 for all x(a,b)x \in (a,b)Then ff is strictly increasing on [a,b][a,b].

Theorem 5.3a (Cauchy’s Mean Value Theorem). If f,g:[a,b]Rf, g : [a,b] \to \mathbb{R} are continuous on [a,b][a,b] and differentiable on (a,b)(a,b)Then there exists c(a,b)c \in (a,b) such that

(f(b)f(a))g(c)=(g(b)g(a))f(c)(f(b) - f(a))g'(c) = (g(b) - g(a))f'(c)

Proof. Define h(x)=(f(b)f(a))g(x)(g(b)g(a))f(x)h(x) = (f(b) - f(a))g(x) - (g(b) - g(a))f(x). Then h(a)=h(b)h(a) = h(b)So by Rolle’s Theorem, h(c)=0h'(c) = 0 for some c(a,b)c \in (a,b)Which gives the result. \blacksquare

Remark. When g(x)=xg(x) = xCauchy’s MVT reduces to the standard MVT. Cauchy’s MVT is the key Ingredient in the …/1-number-and-algebra/3_proof-and-logic of L’Hôpital’s rule.

Corollary 5.6. If ff is differentiable on (a,b)(a,b) and f(x)M|f'(x)| \leq M for all x(a,b)x \in (a,b) Then ff is Lipschitz continuous with constant MM: f(x)f(y)Mxy|f(x) - f(y)| \leq M|x - y| for all x,y(a,b)x, y \in (a,b).

Proof. Apply the MVT to ff on the interval between xx and yy. \blacksquare

5.4 Taylor’s Theorem

Theorem 5.6 (Taylor’s Theorem with Lagrange Remainder). If ff is (n+1)(n+1)-times differentiable on An open interval containing aaThen for each xx in that interval:

f(x)=k=0nf(k)(a)k!(xa)k+Rn(x)f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^k + R_n(x)

Where the remainder is

Rn(x)=f(n+1)(ξ)(n+1)!(xa)n+1R_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x - a)^{n+1}

For some ξ\xi between aa and xx.

Proof. Fix xax \neq a and define

g(t)=f(x)k=0nf(k)(t)k!(xt)kg(t) = f(x) - \sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!}(x - t)^k

Then g(a)=Rn(x)g(a) = R_n(x) and g(x)=0g(x) = 0. By the generalized Rolle’s theorem (or direct computation Using the Cauchy mean value theorem), there exists ξ\xi between aa and xx with g(ξ)=0g'( \xi ) = 0. Computing:

g(t)=f(n+1)(t)n!(xt)ng'(t) = -\frac{f^{(n+1)}(t)}{n!}(x - t)^n

Setting g(ξ)=0g'(\xi) = 0 yields the result after comparing g(a)=Rn(x)g(a) = R_n(x) with the integral form. A Cleaner approach uses the standard MVT applied to gg on [a,x][a, x]. \blacksquare

5.5 L’Hôpital’s Rule

Theorem 5.7 (L’Hôpital’s Rule, 00\frac{0}{0} case). Suppose ff and gg are differentiable on An open interval containing cc (except possibly at cc itself), g(x)0g'(x) \neq 0 near ccAnd limxcf(x)=limxcg(x)=0\lim_{x \to c} f(x) = \lim_{x \to c} g(x) = 0. If limxcf(x)/g(x)=L\lim_{x \to c} f'(x)/g'(x) = L exists (as a finite Number or ±\pm\infty), then limxcf(x)/g(x)=L\lim_{x \to c} f(x)/g(x) = L.

Proof. Extend ff and gg continuously to cc by setting f(c)=g(c)=0f(c) = g(c) = 0. For xcx \neq cBy Cauchy’s Mean Value Theorem, there exists ξ\xi strictly between cc and xx such that

f(x)f(c)g(x)g(c)=f(ξ)g(ξ)\frac{f(x) - f(c)}{g(x) - g(c)} = \frac{f'(\xi)}{g'(\xi)}

I.e., f(x)g(x)=f(ξ)g(ξ)\frac{f(x)}{g(x)} = \frac{f'(\xi)}{g'(\xi)}. As xcx \to cWe have ξc\xi \to c (since ξ\xi is trapped between cc and xx). Therefore limxcf(x)/g(x)=limξcf(ξ)/g(ξ)=L\lim_{x \to c} f(x)/g(x) = \lim_{\xi \to c} f'(\xi)/g'(\xi) = L. \blacksquare

Theorem 5.7b (L’Hôpital’s Rule, \frac{\infty}{\infty} case). Suppose ff and gg are Differentiable on (a,b)(a, b) (except possibly at cc), g(x)0g'(x) \neq 0 near ccAnd limxcf(x)=limxcg(x)=\lim_{x \to c} |f(x)| = \lim_{x \to c} |g(x)| = \infty. If limxcf(x)/g(x)=L\lim_{x \to c} f'(x)/g'(x) = L exists, Then limxcf(x)/g(x)=L\lim_{x \to c} f(x)/g(x) = L.

Proof (sketch). Fix ε>0\varepsilon > 0. For x,yx, y near cc with xyx \neq yBy Cauchy’s MVT:

f(x)f(y)g(x)g(y)=f(ξ)g(ξ)\frac{f(x) - f(y)}{g(x) - g(y)} = \frac{f'(\xi)}{g'(\xi)}

For some ξ\xi between xx and yy. Since f(ξ)/g(ξ)Lf'(\xi)/g'(\xi) \approx L for ξ\xi near ccWe have:

f(x)g(x)=f(x)f(y)g(x)g(y)1f(y)/f(x)1g(y)/g(x)\frac{f(x)}{g(x)} = \frac{f(x) - f(y)}{g(x) - g(y)} \cdot \frac{1 - f(y)/f(x)}{1 - g(y)/g(x)}

Since f(x),g(x)f(x), g(x) \to \inftyBy fixing yy and letting xcx \to cThe fractions f(y)/f(x)f(y)/f(x) and g(y)/g(x)g(y)/g(x) tend to 00So the second factor tends to 11. The first factor tends to LL by Cauchy’s MVT. Hence f(x)/g(x)Lf(x)/g(x) \to L. \blacksquare

Worked Example: Compute $\lim_{x \to 0} \frac{e^x - 1 - x}{x^2}$

Solution. Both numerator and denominator approach 00 as x0x \to 0. Applying L’Hôpital’s rule:

limx0ex1xx2=limx0ex12x\lim_{x \to 0} \frac{e^x - 1 - x}{x^2} = \lim_{x \to 0} \frac{e^x - 1}{2x}

This is still 00\frac{0}{0}So apply L’Hôpital again:

=limx0ex2=12= \lim_{x \to 0} \frac{e^x}{2} = \frac{1}{2}

\blacksquare

5.6 Darboux’s Theorem

Theorem 5.8 (Darboux’s Theorem). If ff is differentiable on [a,b][a, b]Then ff' has the Intermediate value property: for any yy between f(a)f'(a) and f(b)f'(b)There exists c(a,b)c \in (a, b) With f(c)=yf'(c) = y.

Remark. This means derivatives satisfy the intermediate value property even though they need not Be continuous. For example, f(x)=x2sin(1/x)f(x) = x^2 \sin(1/x) (with f(0)=0f(0) = 0) is differentiable everywhere, But ff' is not continuous at 00.

Proof. Assume without loss of generality that f(a)<y<f(b)f'(a) \lt y \lt f'(b). Define g(x)=f(x)yxg(x) = f(x) - yx. Then gg is differentiable on [a,b][a, b] with

g(a)=f(a)y<0andg(b)=f(b)y>0g'(a) = f'(a) - y \lt 0 \quad \mathrm{and} \quad g'(b) = f'(b) - y > 0

Since g(a)<0g'(a) \lt 0There exists x1>ax_1 > a with g(x1)<g(a)g(x_1) \lt g(a) (otherwise g(x)g(a)g(x) \geq g(a) For xx near aaContradicting g(a)<0g'(a) \lt 0). Similarly, since g(b)>0g'(b) > 0There exists x2<bx_2 \lt b with g(x2)<g(b)g(x_2) \lt g(b).

Therefore gg attains its minimum at some c(a,b)c \in (a, b). By Fermat’s theorem on interior extrema, g(c)=0g'(c) = 0So f(c)=yf'(c) = y. \blacksquare

Worked Example: Apply Darboux's theorem to $f(x) = x^2 \sin(1/x)$ ($f(0) = 0$)

Solution. For x0x \neq 0: f(x)=2xsin(1/x)cos(1/x)f'(x) = 2x \sin(1/x) - \cos(1/x). At x=0x = 0: f(0)=limh0h2sin(1/h)h=limh0hsin(1/h)=0f'(0) = \lim_{h \to 0} \frac{h^2 \sin(1/h)}{h} = \lim_{h \to 0} h \sin(1/h) = 0.

So f(0)=0f'(0) = 0. For any δ>0\delta > 0The term cos(1/x)-\cos(1/x) oscillates between 1-1 and 11 on (0,δ)(0, \delta)So ff' takes all values in [1,1][-1, 1] infinitely often on (0,δ)(0, \delta).

But Darboux’s theorem says ff' has the intermediate value property. Indeed, ff' is not continuous At 00 (it oscillates wildly), yet it still satisfies the IVP. This shows that derivatives can be Highly discontinuous while retaining the intermediate value property. \blacksquare

5.7 Worked Examples

Worked Example. Compute the third-order Taylor polynomial of f(x)=exf(x) = e^x about a=0a = 0.

f(0)=1f(0) = 1, f(0)=1f'(0) = 1, f(0)=1f''(0) = 1, f(0)=1f'''(0) = 1. So

T3(x)=1+x+x22+x36T_3(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}

The remainder is R3(x)=eξ24x4R_3(x) = \frac{e^\xi}{24} x^4 for some ξ\xi between 00 and xx.

Worked Example: Approximate $\sin(0.1)$ with error less than $10^{-10}$

Solution. For f(x)=sinxf(x) = \sin x about a=0a = 0: f(k)(0){0,1,1}f^{(k)}(0) \in \{0, 1, -1\} and the Taylor Polynomial of degree nn has the form Tn(x)=xx3/3!+x5/5!T_n(x) = x - x^3/3! + x^5/5! - \cdots (odd terms only).

The Lagrange remainder is Rn(x)=f(n+1)(ξ)(n+1)!xn+1xn+1(n+1)!|R_n(x)| = \frac{|f^{(n+1)}(\xi)|}{(n+1)!} |x|^{n+1} \leq \frac{|x|^{n+1}}{(n+1)!} (since f(k)1|f^{(k)}| \leq 1 for all kk).

We need (0.1)n+1(n+1)!<1010\frac{(0.1)^{n+1}}{(n+1)!} \lt 10^{-10}. Testing: for n=5n = 5 (0.1)66!=1067201.39×109>1010\frac{(0.1)^6}{6!} = \frac{10^{-6}}{720} \approx 1.39 \times 10^{-9} \gt 10^{-10}. For n=7n = 7: (0.1)88!=108403202.48×1013<1010\frac{(0.1)^8}{8!} = \frac{10^{-8}}{40320} \approx 2.48 \times 10^{-13} \lt 10^{-10}.

So T7(0.1)=0.1(0.1)36+(0.1)5120(0.1)75040T_7(0.1) = 0.1 - \frac{(0.1)^3}{6} + \frac{(0.1)^5}{120} - \frac{(0.1)^7}{5040} =0.10.00016667+0.000000830.000000000.09983342= 0.1 - 0.00016667 + 0.00000083 - 0.00000000 \approx 0.09983342.

The error is at most 2.48×1013<10102.48 \times 10^{-13} \lt 10^{-10}. \blacksquare

Worked Example: Find the Maclaurin series for $\ln(1 + x)$ and its radius of convergence

Solution. For f(x)=ln(1+x)f(x) = \ln(1+x): f(0)=0f(0) = 0, f(x)=1/(1+x)f'(x) = 1/(1+x), f(x)=1/(1+x)2f''(x) = -1/(1+x)^2 f(k)(x)=(1)k1(k1)!/(1+x)kf^{(k)}(x) = (-1)^{k-1}(k-1)!/(1+x)^k for k1k \geq 1. So f(k)(0)=(1)k1(k1)!f^{(k)}(0) = (-1)^{k-1}(k-1)!.

ln(1+x)=k=1(1)k1(k1)!k!xk=k=1(1)k1kxk\ln(1+x) = \sum_{k=1}^{\infty} \frac{(-1)^{k-1}(k-1)!}{k!} x^k = \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k} x^k

By the ratio test: limkak+1/ak=limkkk+1x=x\lim_{k \to \infty} |a_{k+1}/a_k| = \lim_{k \to \infty} \frac{k}{k+1} |x| = |x|. The series converges for x<1|x| \lt 1 and diverges for x>1|x| > 1. At x=1x = 1 we get the alternating Harmonic series (converges to ln2\ln 2). At x=1x = -1 we get the negative harmonic series (diverges).

The radius of convergence is R=1R = 1 and the interval of convergence is (1,1](-1, 1]. \blacksquare

Worked Example: Compute the Taylor expansion of $\cos x$ about $a = \pi/3$ with remainder bound

Solution. Compute derivatives: f(x)=cosxf(x) = \cos x, f(x)=sinxf'(x) = -\sin x, f(x)=cosxf''(x) = -\cos x, f(x)=sinxf'''(x) = \sin x f(4)(x)=cosxf^{(4)}(x) = \cos x. Evaluated at a=π/3a = \pi/3:

f(π/3)=1/2f(\pi/3) = 1/2, f(π/3)=3/2f'(\pi/3) = -\sqrt{3}/2, f(π/3)=1/2f''(\pi/3) = -1/2, f(π/3)=3/2f'''(\pi/3) = \sqrt{3}/2.

The third-degree Taylor polynomial is:

T3(x)=1232(xπ3)14(xπ3)2+312(xπ3)3T_3(x) = \frac{1}{2} - \frac{\sqrt{3}}{2}\left(x - \frac{\pi}{3}\right) - \frac{1}{4}\left(x - \frac{\pi}{3}\right)^2 + \frac{\sqrt{3}}{12}\left(x - \frac{\pi}{3}\right)^3

The remainder satisfies R3(x)xπ/3424|R_3(x)| \leq \frac{|x - \pi/3|^4}{24} (since f(4)(ξ)=cosξ1|f^{(4)}(\xi)| = |\cos \xi| \leq 1).

For example, at x=1x = 1: R3(1)1π/34240.04724242.1×107|R_3(1)| \leq \frac{|1 - \pi/3|^4}{24} \approx \frac{0.0472^4}{24} \approx 2.1 \times 10^{-7}. \blacksquare

:::caution Common Pitfall L’Hôpital’s rule only applies to indeterminate forms 00\frac{0}{0} and \frac{\infty}{\infty}. Applying it to forms like 10\frac{1}{0} or 1\frac{\infty}{1} will give incorrect results. Always Verify the indeterminate form before applying the rule. Also, L’Hôpital’s rule requires that the Limit of the quotient of derivatives exists; if it does not exist (oscillates), the original limit May still exist.

:::