Skip to content

Mean Value Theorems and Taylor's Theorem: Recovering a Function from Its Derivatives

Prerequisite:The Derivative: From Difference Quotients to the Chain Rule

Raw
  • The derivative carries information about a single point only. The device that translates it into a statement holding on a whole interval is the mean value theorem, and almost every application of calculus passes through it.
  • Rolle’s theorem follows from the extreme value theorem together with Fermat’s lemma, and from Rolle’s theorem follow the mean value theorems of Lagrange and Cauchy. The three stand to one another almost as restatements of a single theorem.
  • L’Hôpital’s rule is derived from Cauchy’s mean value theorem. Using it without checking all three of “the expression really is of the form 0/00/0”, "g0g' \ne 0" and “the limit of f/gf'/g' exists” leads to false conclusions.
  • The protagonist of Taylor’s theorem is not the polynomial but the remainder. Only once we have the form Rn(x)=f(n+1)(c)(xa)n+1/(n+1)!R_n(x) = f^{(n+1)}(c)(x-a)^{n+1}/(n+1)! does the approximation become a usable tool.
  • The functions exe^x and sinx\sin x converge to their Maclaurin series for every real number, and log(1+x)\log(1+x) does so for 1<x1-1 < x \le 1. Proving this convergence is nothing other than checking that the remainder tends to 00.

The derivative f(c)f'(c) is a quantity determined by looking only at points arbitrarily close to cc. What we actually want to use, however, are statements about an entire interval, such as the following.

  • If ff' is identically 00 on an interval, then ff is constant there.
  • If ff' is everywhere positive on an interval, then ff is increasing there.
  • If f1|f'| \le 1, then ff satisfies f(x)f(y)xy|f(x) - f(y)| \le |x-y|.

Each of these feels inevitable, and none of them is obvious. The only thing appearing in the definition of the derivative is the limit as xcx \to c, and nothing in it directly relates the values of ff at two separated points x,yx, y. We need a bridge from local information to a global conclusion, and that bridge is the mean value theorem.

In everyday language it says this. A car that covers the 500500 km from Tokyo to Osaka in 55 hours must at some moment along the way have had its speedometer reading exactly 100100 km/h. The average speed (the ratio of a difference of two values) is realized as the instantaneous speed (the derivative) at some single point. That is the assertion of the mean value theorem.

There is a second line of motivation: the demand to compute values of functions in practice. If we want to know sin(0.1)\sin(0.1), extracting a number directly from the definition of the sine (arc length on a circle, or a series) is troublesome, whereas a polynomial can be evaluated with the four arithmetic operations alone. So we would like to replace ff by a polynomial. But the moment we do so, an error appears. Unless the size of that error can be estimated, the approximation is not a mathematical tool. Taylor’s theorem gives this error a definite form. And, remarkably, its proof again comes from the mean value theorem — Cauchy’s version, to be precise.

Let us set out the logical flow of this article in advance.

flowchart TD
A["Continuity of the reals (existence of suprema)"] --> B["Extreme value theorem"]
B --> D["Rolle's theorem"]
C["Fermat's lemma"] --> D
D --> E["Lagrange's mean value theorem"]
D --> F["Cauchy's mean value theorem"]
E --> G["Monotonicity tests and proofs of inequalities"]
F --> H["L'Hopital's rule"]
F --> I["Taylor's theorem (Lagrange remainder)"]
I --> J["Maclaurin expansions and error bounds"]
The logical structure of this article. Everything starts from the continuity of the real numbers and passes through Rolle's theorem.

We use the definition of the derivative and the basic rules of differentiation as treated in The definition of the derivative and basic differentiation. In particular, the fact that differentiability at cc implies continuity at cc (differentiable implies continuous(Theorem 3.4)[The Derivative]) will be used repeatedly below.

Definition 2.1Local maxima and minima

Let IRI \subset \mathbb{R}, let f:IRf: I \to \mathbb{R} and let cIc \in I. If there exists δ>0\delta > 0 such that

f(x)f(c)f(x) \le f(c)

holds for every xIx \in I with xc<δ|x - c| < \delta, we say that ff has a local maximum at cc. Likewise, if f(x)f(c)f(x) \ge f(c) holds for all such xx, we say that ff has a local minimum at cc. Having either a local maximum or a local minimum is expressed by saying that ff has a local extremum.

Note that “maximum” refers to a comparison with the whole interval, whereas “local maximum” refers to a comparison only with points near cc. A point at which the maximum is attained is a local maximum point, but not conversely.

Definition 2.2n times differentiable functions and functions of class C^n

For a function ff on an open interval II, put f(0)=ff^{(0)} = f, and whenever f(k1)f^{(k-1)} is differentiable on II set f(k)=(f(k1))f^{(k)} = (f^{(k-1)})'. If f(n)f^{(n)} exists on II, we say that ff is nn times differentiable on II; if moreover f(n)f^{(n)} is continuous on II, we say that ff is of class CnC^n. If ff is of class CnC^n for every nn, we say that it is of class CC^\infty.

If ff is nn times differentiable, then f(n1)f^{(n-1)} is differentiable and hence continuous, so ff is automatically of class Cn1C^{n-1}. The difference between being nn times differentiable and being of class CnC^n is precisely whether the last derivative f(n)f^{(n)} is continuous.

Theorem 2.3Extreme value theorem

Let a<ba < b and let f:[a,b]Rf: [a,b] \to \mathbb{R} be continuous on [a,b][a,b]. Then there exist xM,xm[a,b]x_M, x_m \in [a,b] such that

f(xm)f(x)f(xM)f(x_m) \le f(x) \le f(x_M)

holds for every x[a,b]x \in [a,b]. That is, ff attains a maximum and a minimum on [a,b][a,b].

Remark 2.4Where the proof lives, and why the hypotheses are needed

The proof of this theorem rests on the continuity of the real numbers (the existence of suprema, or the Bolzano–Weierstrass theorem). Since the proof is given in Limits and continuity (ε-δ arguments), we take the theorem as known here.

Neither hypothesis can be dropped. Failure for a non-closed interval is shown by f(x)=1/xf(x) = 1/x on (0,1](0,1], which is continuous but not even bounded above. Failure for an unbounded interval is shown by f(x)=xf(x) = x on [0,)[0,\infty). Dropping continuity, the function on [0,1][0,1] defined by f(0)=0f(0) = 0 and f(x)=1xf(x) = 1 - x for 0<x10 < x \le 1 never reaches its supremum 11.

Lemma 2.5Fermat's lemma

Let II be an open interval, let f:IRf : I \to \mathbb{R} and let cIc \in I. If ff has a local extremum at cc and is differentiable at cc, then f(c)=0f'(c) = 0.

Proof(Lemma 2.5)

It suffices to treat the case of a local maximum. For a local minimum, consider f-f: it has a local maximum at cc, so by the case already proved (f)(c)=f(c)=0(-f)'(c) = -f'(c) = 0, whence f(c)=0f'(c) = 0.

By Definition 2.1 there is δ1>0\delta_1 > 0 such that f(c+h)f(c)f(c+h) \le f(c) whenever h<δ1|h| < \delta_1 and c+hIc + h \in I. Moreover, since II is open, we may take δδ1\delta \le \delta_1 small enough that h<δ|h| < \delta already forces c+hIc + h \in I. We fix this δ\delta for the rest of the proof.

For 0<h<δ0 < h < \delta the numerator satisfies f(c+h)f(c)0f(c+h) - f(c) \le 0 while the denominator satisfies h>0h > 0, so

f(c+h)f(c)h0.\frac{f(c+h) - f(c)}{h} \le 0 .

Letting h+0h \to +0 and using that limits preserve weak inequalities (a limit of quantities that are 0\le 0 is 0\le 0), we obtain f(c)0f'(c) \le 0 from the right-hand limit.

For δ<h<0-\delta < h < 0 the numerator is again f(c+h)f(c)0f(c+h) - f(c) \le 0, but now the denominator satisfies h<0h < 0, so

f(c+h)f(c)h0,\frac{f(c+h) - f(c)}{h} \ge 0 ,

and letting h0h \to -0 gives f(c)0f'(c) \ge 0.

Since ff is differentiable at cc, the two one-sided limits both exist and are equal to the same value f(c)f'(c). Hence f(c)0f'(c) \le 0 and f(c)0f'(c) \ge 0, that is, f(c)=0f'(c) = 0.

The hypothesis that II is an open interval is essential. Taking f(x)=xf(x) = x on [0,1][0,1], the maximum occurs at x=1x = 1, yet f(1)=10f'(1) = 1 \ne 0. The reason is that 11 can be approached only from the left, so only one half of the argument above can be carried out. This circumstance reappears in the next section as conclusions of the form ”cc may be found inside the open interval (a,b)(a,b)”.

Theorem 3.1Rolle's theorem

Let a<ba < b and suppose f:[a,b]Rf : [a,b] \to \mathbb{R} satisfies the following three conditions.

  1. ff is continuous on the closed interval [a,b][a,b].
  2. ff is differentiable at every point of the open interval (a,b)(a,b).
  3. f(a)=f(b)f(a) = f(b).

Then there exists c(a,b)c \in (a,b) with f(c)=0f'(c) = 0.

Proof(Theorem 3.1)

By hypothesis 1 and Theorem 2.3, ff attains a maximum M=f(xM)M = f(x_M) and a minimum m=f(xm)m = f(x_m) on [a,b][a,b].

Case M=mM = m. Then mf(x)M=mm \le f(x) \le M = m for every x[a,b]x \in [a,b], so ff is constant. Since a<ba < b, the interval (a,b)(a,b) is nonempty; taking any point cc in it, the derivative of a constant function is by definition limh0(f(c+h)f(c))/h=limh00/h=0\lim_{h\to 0}(f(c+h)-f(c))/h = \lim_{h \to 0} 0/h = 0, so f(c)=0f'(c) = 0.

Case M>mM > m. By hypothesis 3 we have f(a)=f(b)f(a) = f(b). If both M=f(a)M = f(a) and m=f(a)m = f(a) held, we would get M=mM = m, contrary to the case assumption; so at least one of Mf(a)M \ne f(a) and mf(a)m \ne f(a) holds.

Suppose Mf(a)=f(b)M \ne f(a) = f(b). The point xMx_M where the maximum is attained satisfies f(xM)=Mf(a),f(b)f(x_M) = M \ne f(a), f(b), hence xMax_M \ne a and xMbx_M \ne b, that is, c:=xM(a,b)c := x_M \in (a,b). Since f(x)f(c)f(x) \le f(c) for every x[a,b]x \in [a,b], the point cc is in particular a local maximum point of ff on the open interval (a,b)(a,b) (take min{ca, bc}\min\lbrace c-a,\ b-c \rbrace as the δ\delta in Definition 2.1). By hypothesis 2, ff is differentiable at cc, so applying Lemma 2.5 to ff regarded as a function on the open interval (a,b)(a,b) gives f(c)=0f'(c) = 0.

In the case mf(a)m \ne f(a), the point xm(a,b)x_m \in (a,b) is a local minimum point and Lemma 2.5 applies in the same way, giving f(xm)=0f'(x_m) = 0.

Example 3.2None of the three hypotheses of Rolle's theorem can be dropped

For each of the three hypotheses we exhibit an example in which removing that hypothesis alone destroys the conclusion.

Dropping hypothesis 2 (differentiability). Consider f(x)=xf(x) = |x| on [1,1][-1,1]. It is continuous and f(1)=f(1)=1f(-1) = f(1) = 1, but for x0x \ne 0 we have f(x)=x/x=±1f'(x) = x/|x| = \pm 1, which is never 00. The cause is the failure of differentiability at x=0x = 0 (right derivative 11, left derivative 1-1).

Dropping hypothesis 3 (equal values at the endpoints). Consider f(x)=xf(x) = x on [0,1][0,1]. It is continuous and differentiable, but f(0)=01=f(1)f(0) = 0 \ne 1 = f(1), and f(x)=1f'(x) = 1 is nowhere 00.

Dropping hypothesis 1 (continuity on the closed interval). Consider the function on [0,1][0,1] defined by f(x)=xf(x) = x for 0x<10 \le x < 1 and f(1)=0f(1) = 0. Here f(0)=f(1)=0f(0) = f(1) = 0, and ff is differentiable at every point of (0,1)(0,1) with f(x)=1f'(x) = 1. But ff is not continuous at x=1x = 1 (as x1x \to 1- we have f(x)10=f(1)f(x) \to 1 \ne 0 = f(1)), and ff' is never 00. Thus a failure of continuity at a single endpoint already destroys the conclusion.

Theorem 3.3Lagrange's mean value theorem

Let a<ba < b and let f:[a,b]Rf : [a,b] \to \mathbb{R} be continuous on [a,b][a,b] and differentiable at every point of (a,b)(a,b). Then there exists c(a,b)c \in (a,b) with

f(b)f(a)=f(c)(ba).f(b) - f(a) = f'(c)\,(b-a) .

Equivalently, f(b)f(a)ba=f(c)\dfrac{f(b)-f(a)}{b-a} = f'(c).

Proof(Theorem 3.3)

We subtract from ff the straight line joining the two endpoints (the chord), so as to reach a situation where Rolle’s theorem applies. Put

g(x)=f(x)f(a)f(b)f(a)ba(xa)(x[a,b]).g(x) = f(x) - f(a) - \frac{f(b)-f(a)}{b-a}(x - a) \qquad (x \in [a,b]) .

Being the difference of ff and an affine function, gg is continuous on [a,b][a,b] and differentiable at every point of (a,b)(a,b) (this uses the properties assumed of ff, together with the fact that an affine function is everywhere continuous and differentiable). Moreover

g(a)=f(a)f(a)0=0,g(b)=f(b)f(a)f(b)f(a)ba(ba)=0,g(a) = f(a) - f(a) - 0 = 0, \qquad g(b) = f(b) - f(a) - \frac{f(b)-f(a)}{b-a}(b-a) = 0 ,

so g(a)=g(b)g(a) = g(b). Hence gg satisfies all the hypotheses of Theorem 3.1, and there is c(a,b)c \in (a,b) with g(c)=0g'(c) = 0. On (a,b)(a,b) we have

g(x)=f(x)f(b)f(a)ba,g'(x) = f'(x) - \frac{f(b)-f(a)}{b-a} ,

so g(c)=0g'(c) = 0 says exactly that f(c)=f(b)f(a)baf'(c) = \dfrac{f(b)-f(a)}{b-a}. Multiplying both sides by ba0b - a \ne 0 gives the asserted identity.

The affine function subtracted in the proof is precisely the chord joining (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)). So the theorem says: a curve always has a tangent line parallel to its chord.

y = f(x)chordtangentacb
The mean value theorem. A point c whose tangent line (dashed) is parallel to the chord joining the endpoints (solid) always exists inside the open interval.

Corollary 3.4The sign of the derivative and monotonicity

Let IRI \subset \mathbb{R} be an interval and let f:IRf : I \to \mathbb{R} be continuous on II and differentiable at every interior point of II.

  1. f=0f' = 0 everywhere in the interior of II if and only if ff is constant on II.
  2. f0f' \ge 0 everywhere in the interior of II if and only if ff is nondecreasing on II (that is, x<yf(x)f(y)x < y \Rightarrow f(x) \le f(y)).
  3. If f>0f' > 0 everywhere in the interior of II, then ff is strictly increasing on II (that is, x<yf(x)<f(y)x < y \Rightarrow f(x) < f(y)). The converse, however, fails.
Proof(Corollary 3.4)

We first make a preparation common to 1, 2 and 3. Let x<yx < y be arbitrary points of II. Since II is an interval, [x,y]I[x,y] \subset I. Now ff is continuous on [x,y][x,y], and the open interval (x,y)(x,y) is contained in the interior of II (a point lying between two points of II is an interior point of II), so ff is differentiable at every point of (x,y)(x,y). Hence Theorem 3.3 applies and yields a cc with

f(y)f(x)=f(c)(yx),c(x,y).f(y) - f(x) = f'(c)(y - x), \qquad c \in (x,y) .

Since yx>0y - x > 0, the sign of f(y)f(x)f(y)-f(x) agrees with the sign of f(c)f'(c).

Proof of 1. If f=0f' = 0 throughout the interior, the displayed identity gives f(y)f(x)=0f(y) - f(x) = 0 for all x<yx < y, so ff is constant. Conversely, if ff is constant, then at every interior point cc the difference quotient is identically 00, so f(c)=0f'(c) = 0.

Proof of 2. If f0f' \ge 0 throughout the interior, the identity gives f(y)f(x)=f(c)(yx)0f(y)-f(x) = f'(c)(y-x) \ge 0, so ff is nondecreasing. Conversely, if ff is nondecreasing, then for an interior point cc and h0h \ne 0 we have (f(c+h)f(c))/h0(f(c+h)-f(c))/h \ge 0 (for h>0h > 0 both numerator and denominator are 0\ge 0; for h<0h < 0 both are 0\le 0). Letting h0h \to 0 and using that limits preserve weak inequalities gives f(c)0f'(c) \ge 0.

Proof of 3. If f>0f' > 0 throughout the interior, the identity gives f(y)f(x)=f(c)(yx)>0f(y) - f(x) = f'(c)(y-x) > 0, so ff is strictly increasing. A counterexample to the converse is f(x)=x3f(x) = x^3. It is strictly increasing on R\mathbb{R} (if x<yx < y then y3x3=(yx)(y2+xy+x2)>0y^3 - x^3 = (y-x)(y^2+xy+x^2) > 0; indeed y2+xy+x2=(y+x/2)2+3x2/4y^2 + xy + x^2 = (y + x/2)^2 + 3x^2/4 is positive except at x=y=0x = y = 0), yet f(0)=0f'(0) = 0.

Statement 1 is used in the form “two functions with the same derivative differ by a constant”, which is what makes the indefinite integral well defined up to an additive constant. This fact plays a central role in The fundamental theorem of calculus and the definite integral.

Example 3.5Producing inequalities from the mean value theorem

The mean value theorem is used more often by estimating the value of ff' and passing to an inequality than as an equality in its own right.

(1) The sine function is 11-Lipschitz. For all real x,yx, y we have sinxsinyxy|\sin x - \sin y| \le |x - y|.

For x=yx = y both sides are 00. For xyx \ne y we may assume x<yx < y without loss of generality. Since sin\sin is differentiable on all of R\mathbb{R}, Theorem 3.3 applies on [x,y][x,y] and gives some c(x,y)c \in (x,y) with

sinysinx=cos(c)(yx).\sin y - \sin x = \cos(c)\,(y - x) .

As cosc1|\cos c| \le 1, taking absolute values yields sinysinxyx|\sin y - \sin x| \le |y - x|.

(2) Two-sided bounds for the logarithm. For x>0x > 0,

x1+x<log(1+x)<x.\frac{x}{1+x} < \log(1+x) < x .

The function f(t)=log(1+t)f(t) = \log(1+t) is continuous on [0,x][0,x] and differentiable on (0,x)(0,x) with f(t)=1/(1+t)f'(t) = 1/(1+t). By Theorem 3.3 there is c(0,x)c \in (0,x) with

log(1+x)log1=x1+c.\log(1+x) - \log 1 = \frac{x}{1+c} .

From 0<c<x0 < c < x we get 1<1+c<1+x1 < 1 + c < 1 + x, and taking reciprocals of each side gives 11+x<11+c<1\dfrac{1}{1+x} < \dfrac{1}{1+c} < 1. Multiplying by x>0x > 0,

x1+x<x1+c=log(1+x)<x.\frac{x}{1+x} < \frac{x}{1+c} = \log(1+x) < x .

Checking at x=1x = 1 gives 0.5<log2=0.6931<10.5 < \log 2 = 0.6931\ldots < 1, so the bounds do hold.

Sometimes we want to compare the variations of two functions. Naively one might apply Theorem 3.3 to ff and to gg separately and take the quotient, but the intermediate points produced for ff and for gg are different, leaving us with the unwieldy expression f(c1)/g(c2)f'(c_1)/g'(c_2). The following theorem realizes the ratio at one and the same point cc.

Theorem 3.6Cauchy's mean value theorem

Let a<ba < b and let f,g:[a,b]Rf, g : [a,b] \to \mathbb{R} both be continuous on [a,b][a,b] and differentiable at every point of (a,b)(a,b). Then there exists c(a,b)c \in (a,b) with

(f(b)f(a))g(c)=(g(b)g(a))f(c).\bigl(f(b) - f(a)\bigr) g'(c) = \bigl(g(b) - g(a)\bigr) f'(c) .

If moreover g(x)0g'(x) \ne 0 for every x(a,b)x \in (a,b), then g(b)g(a)g(b) \ne g(a) and we may write

f(b)f(a)g(b)g(a)=f(c)g(c).\frac{f(b)-f(a)}{g(b)-g(a)} = \frac{f'(c)}{g'(c)} .
Proof(Theorem 3.6)

Put

h(x)=(f(b)f(a))(g(x)g(a))(g(b)g(a))(f(x)f(a)).h(x) = \bigl(f(b)-f(a)\bigr)\bigl(g(x) - g(a)\bigr) - \bigl(g(b)-g(a)\bigr)\bigl(f(x) - f(a)\bigr) .

Being a sum of constant multiples of ff and gg, the function hh is continuous on [a,b][a,b] and differentiable on (a,b)(a,b). Its values at the endpoints are

h(a)=0,h(b)=(f(b)f(a))(g(b)g(a))(g(b)g(a))(f(b)f(a))=0,h(a) = 0, \qquad h(b) = \bigl(f(b)-f(a)\bigr)\bigl(g(b)-g(a)\bigr) - \bigl(g(b)-g(a)\bigr)\bigl(f(b)-f(a)\bigr) = 0 ,

so h(a)=h(b)h(a) = h(b). By Theorem 3.1 there is c(a,b)c \in (a,b) with h(c)=0h'(c) = 0, and substituting into

h(x)=(f(b)f(a))g(x)(g(b)g(a))f(x)h'(x) = \bigl(f(b)-f(a)\bigr) g'(x) - \bigl(g(b)-g(a)\bigr) f'(x)

gives the first assertion.

Now the second part. If g(a)=g(b)g(a) = g(b), then gg satisfies the hypotheses of Theorem 3.1, so there is ξ(a,b)\xi \in (a,b) with g(ξ)=0g'(\xi) = 0, contradicting ”g(x)0g'(x) \ne 0 for every x(a,b)x \in (a,b)”. Hence g(b)g(a)g(b) \ne g(a). Dividing the identity of the first assertion by (g(b)g(a))g(c)0\bigl(g(b)-g(a)\bigr) g'(c) \ne 0 (here g(c)0g'(c) \ne 0 by hypothesis) gives the stated form.

Remark 3.7Why a single intermediate point is indispensable

Consider f(x)=x3f(x) = x^3 and g(x)=x2g(x) = x^2 on [0,1][0,1]. Applying Theorem 3.3 to ff and to gg separately, f(1)f(0)=1=3c12f(1)-f(0) = 1 = 3c_1^2 gives c1=1/3=0.5773c_1 = 1/\sqrt{3} = 0.5773\ldots, and g(1)g(0)=1=2c2g(1)-g(0) = 1 = 2c_2 gives c2=1/2c_2 = 1/2, so the two intermediate points differ. The cc asserted by Theorem 3.6, on the other hand, is determined by

f(1)f(0)g(1)g(0)=1=3c22c=3c2\frac{f(1)-f(0)}{g(1)-g(0)} = 1 = \frac{3c^2}{2c} = \frac{3c}{2}

so that c=2/3=0.6666c = 2/3 = 0.6666\ldots, different from both c1c_1 and c2c_2. In the proof of l’Hôpital’s rule in the next section, the ability to rewrite numerator and denominator as a ratio of derivatives at one and the same point cc is decisive.

If f(x)0f(x) \to 0 and g(x)0g(x) \to 0 as xax \to a, what is the limit of the quotient f(x)/g(x)f(x)/g(x)? Among the rules for limits (the algebra of limits(Theorem 4.2)[Limits and Continuity]), the quotient rule applies only when the limit of the denominator is nonzero, so this shape — the indeterminate form 0/00/0 — has so far had to be handled by ad hoc devices in each case. L’Hôpital’s rule replaces those devices by the mechanical operation of differentiating numerator and denominator separately.

The rule bears this name because it appeared in the 1696 textbook Analyse des infiniment petits pour l’intelligence des lignes courbes by the Marquis de l’Hôpital, though the content is believed to be due to Johann Bernoulli. L’Hôpital had a contract with Bernoulli granting him the right to use Bernoulli’s results in his own book.

Theorem 4.1L'Hôpital's rule (the 0/0 form, right-hand limits)

Let aRa \in \mathbb{R} and δ0>0\delta_0 > 0, and let f,gf, g be real-valued functions differentiable on the open interval (a,a+δ0)(a, a+\delta_0). Assume the following three conditions.

  1. g(x)0g'(x) \ne 0 for every x(a,a+δ0)x \in (a, a+\delta_0).
  2. limxa+f(x)=0\displaystyle \lim_{x \to a+} f(x) = 0 and limxa+g(x)=0\displaystyle \lim_{x \to a+} g(x) = 0.
  3. The limit L=limxa+f(x)g(x)\displaystyle L = \lim_{x \to a+} \frac{f'(x)}{g'(x)} exists as a real number.

Then g(x)0g(x) \ne 0 for every x(a,a+δ0)x \in (a,a+\delta_0), and

limxa+f(x)g(x)=L.\lim_{x \to a+} \frac{f(x)}{g(x)} = L .
Proof(Theorem 4.1)

Step 0 (extend to functions continuous up to aa). Define F,G:[a,a+δ0)RF, G : [a, a+\delta_0) \to \mathbb{R} by

F(a)=0,F(x)=f(x) (x>a),G(a)=0,G(x)=g(x) (x>a).F(a) = 0,\quad F(x) = f(x)\ (x > a), \qquad G(a) = 0,\quad G(x) = g(x)\ (x > a) .

Hypothesis 2 says exactly that FF and GG are right-continuous at aa. On (a,a+δ0)(a, a+\delta_0) we have F=fF = f and G=gG = g, which are differentiable and hence continuous. Therefore, for every x(a,a+δ0)x \in (a, a+\delta_0), the functions FF and GG are continuous on [a,x][a,x] and differentiable on (a,x)(a,x).

Step 1 (the denominator does not vanish). Suppose g(x0)=0g(x_0) = 0 for some x0(a,a+δ0)x_0 \in (a, a+\delta_0). Then G(a)=G(x0)=0G(a) = G(x_0) = 0, and since GG is continuous on [a,x0][a,x_0] and differentiable on (a,x0)(a,x_0), Theorem 3.1 yields ξ(a,x0)\xi \in (a,x_0) with G(ξ)=g(ξ)=0G'(\xi) = g'(\xi) = 0, contradicting hypothesis 1. Hence g0g \ne 0 on (a,a+δ0)(a,a+\delta_0) and the quotient f(x)/g(x)f(x)/g(x) is meaningful.

Step 2 (rewriting as a ratio at a single point). Let x(a,a+δ0)x \in (a,a+\delta_0) be arbitrary. On (a,x)(a,a+δ0)(a,x) \subset (a,a+\delta_0) we have G=g0G' = g' \ne 0, so the second part of Theorem 3.6 applies to F,GF, G on [a,x][a,x], and for some cx(a,x)c_x \in (a,x)

f(x)g(x)=F(x)F(a)G(x)G(a)=F(cx)G(cx)=f(cx)g(cx).\frac{f(x)}{g(x)} = \frac{F(x) - F(a)}{G(x) - G(a)} = \frac{F'(c_x)}{G'(c_x)} = \frac{f'(c_x)}{g'(c_x)} .

Step 3 (the ε\varepsilon argument). Let ε>0\varepsilon > 0 be arbitrary. By hypothesis 3 there is δ(0,δ0]\delta \in (0, \delta_0] such that a<t<a+δa < t < a + \delta implies

f(t)g(t)L<ε.\left| \frac{f'(t)}{g'(t)} - L \right| < \varepsilon .

Now let a<x<a+δa < x < a + \delta. The point cxc_x from Step 2 satisfies a<cx<x<a+δa < c_x < x < a+\delta, so the estimate applies with t=cxt = c_x and

f(x)g(x)L=f(cx)g(cx)L<ε.\left| \frac{f(x)}{g(x)} - L \right| = \left| \frac{f'(c_x)}{g'(c_x)} - L \right| < \varepsilon .

Since ε>0\varepsilon > 0 was arbitrary, limxa+f(x)/g(x)=L\lim_{x \to a+} f(x)/g(x) = L.

Remark 4.2Left-hand, two-sided and infinite versions

For a left-hand limit xax \to a-, put f~(y)=f(2ay)\tilde f(y) = f(2a - y) and g~(y)=g(2ay)\tilde g(y) = g(2a-y) to reduce to the theorem as stated. Indeed f~(y)=f(2ay)\tilde f'(y) = -f'(2a-y) and g~(y)=g(2ay)\tilde g'(y) = -g'(2a-y), so f~/g~\tilde f'/\tilde g' equals f/gf'/g' evaluated at x=2ayx = 2a-y, and ya+y \to a+ corresponds to xax \to a-. A two-sided limit is obtained by applying both one-sided versions.

For x+x \to +\infty, substitute t=1/xt = 1/x. With F(t)=f(1/t)F(t) = f(1/t) and G(t)=g(1/t)G(t) = g(1/t) we get F(t)/G(t)=f(1/t)/g(1/t)F'(t)/G'(t) = f'(1/t)/g'(1/t) (the factors 1/t2-1/t^2 cancel), reducing to the case t0+t \to 0+. The same conclusions hold when L=±L = \pm\infty and for the indeterminate form /\infty/\infty, in which numerator and denominator both diverge to ±\pm\infty; but the proof for /\infty/\infty requires a different argument, since the trick of Step 0 — extending continuously — is unavailable. A unified proof may be found in Chapter 5 of Rudin’s Principles of Mathematical Analysis.

Example 4.3Three indeterminate limits

All three limits below are two-sided, so following Remark 4.2 we apply Theorem 4.1 separately on each side (the computation is the same on both sides, so we do not distinguish them in what follows).

(1) limx01cosxx2\displaystyle \lim_{x\to 0} \frac{1 - \cos x}{x^2}. Put f(x)=1cosxf(x) = 1-\cos x and g(x)=x2g(x) = x^2. For x0x \ne 0 we have g(x)=2x0g'(x) = 2x \ne 0, and f,g0f, g \to 0 as x0x \to 0. Now

f(x)g(x)=sinx2x\frac{f'(x)}{g'(x)} = \frac{\sin x}{2x}

is again of the form 0/00/0, so we apply the theorem once more with f1=sinxf_1 = \sin x and g1=2xg_1 = 2x. Here g1=20g_1' = 2 \ne 0, f1,g10f_1, g_1 \to 0, and f1/g1=cosx/21/2f_1'/g_1' = \cos x / 2 \to 1/2. Hence limx0sinx/(2x)=1/2\lim_{x\to0} \sin x/(2x) = 1/2, and one further application of the theorem gives

limx01cosxx2=12.\lim_{x\to 0}\frac{1-\cos x}{x^2} = \frac{1}{2} .

As a numerical check, at x=0.1x = 0.1 we get (10.99500417)/0.01=0.4995(1 - 0.99500417)/0.01 = 0.4995\ldots, close to 1/21/2.

(2) limx0xsinxx3\displaystyle \lim_{x \to 0}\frac{x - \sin x}{x^3}. We differentiate numerator and denominator three times, obtaining 1cosx3x2\dfrac{1 - \cos x}{3x^2}, then sinx6x\dfrac{\sin x}{6x}, then cosx6\dfrac{\cos x}{6}. At each stage, check that numerator and denominator both tend to 00 as x0x \to 0 (this holds for 1cosx1 - \cos x, 3x23x^2, sinx\sin x and 6x6x) and that the derivatives of the denominators, namely 3x23x^2, 6x6x and 66, are nonzero for x0x \ne 0. The last expression cosx/6\cos x/6 tends to 1/61/6 as x0x \to 0, so working backwards the limits at each stage are determined in turn, and

limx0xsinxx3=16.\lim_{x\to0}\frac{x - \sin x}{x^3} = \frac{1}{6} .

The actual value at x=0.1x = 0.1 is (0.10.09983342)/0.001=0.16658(0.1 - 0.09983342)/0.001 = 0.16658\ldots, close to 1/6=0.166661/6 = 0.16666\ldots.

(3) limx0(1x1sinx)\displaystyle \lim_{x\to 0}\left(\frac{1}{x} - \frac{1}{\sin x}\right). This is of the form \infty - \infty, but putting it over a common denominator turns it into 0/00/0:

1x1sinx=sinxxxsinx.\frac{1}{x} - \frac{1}{\sin x} = \frac{\sin x - x}{x \sin x} .

Numerator and denominator both tend to 00 as x0x \to 0. The derivative of the denominator is sinx+xcosx\sin x + x\cos x, which is nonzero for 0<x<10 < |x| < 1, since there xx and sinx\sin x have the same sign and cosx>0\cos x > 0. One application gives

cosx1sinx+xcosx,\frac{\cos x - 1}{\sin x + x \cos x} ,

again of the form 0/00/0; the derivative of this denominator is 2cosxxsinx2\cos x - x \sin x, which is positive for x<1|x| < 1. A second application gives

sinx2cosxxsinx02=0,\frac{-\sin x}{2\cos x - x \sin x} \to \frac{0}{2} = 0 ,

so the limit sought is 00. This agrees with the rough picture supplied by (2): sinxx\sin x - x is of the order of x3x^3 and xsinxx \sin x of the order of x2x^2, so the quotient is of the order of xx and goes to 00.

Remark 4.4Three traps in l'Hôpital's rule

Not checking that the form is indeterminate. We have limx0x+2x+1=2\lim_{x\to 0}\dfrac{x+2}{x+1} = 2, but differentiating numerator and denominator gives 1/1=11/1 = 1. Hypothesis 2 fails, so the theorem does not apply.

When the limit of f/gf'/g' fails to exist, nothing can be concluded. Put f(x)=x2sin(1/x)f(x) = x^2 \sin(1/x) for x0x \ne 0 and g(x)=xg(x) = x. From f(x)x2|f(x)| \le x^2 we get f0f \to 0 as x0x \to 0; also g0g \to 0 and g=10g' = 1 \ne 0. The original quotient is f(x)/g(x)=xsin(1/x)f(x)/g(x) = x\sin(1/x), and xsin(1/x)x0|x \sin(1/x)| \le |x| \to 0 gives convergence to 00 by squeezing. Yet

f(x)g(x)=2xsin1xcos1x\frac{f'(x)}{g'(x)} = 2x\sin\frac{1}{x} - \cos\frac{1}{x}

approaches 1-1 along xn=1/(2nπ)x_n = 1/(2n\pi) and +1+1 along xn=1/((2n+1)π)x_n' = 1/((2n+1)\pi), so it has no limit. Only hypothesis 3 of the theorem fails; the original limit exists perfectly well. “Not obtainable by l’Hôpital” does not mean “no limit”.

Circular reasoning. Applying l’Hôpital’s rule to limx0sinxx\lim_{x\to0}\dfrac{\sin x}{x} to get cosx/11\cos x/1 \to 1 is circular, because the proof that (sin)=cos(\sin)' = \cos itself uses the value 11 of this very limit (the fundamental trigonometric limit(Lemma 5.1)[The Derivative]).

The definition of differentiability can be read as saying that near aa the function ff is approximated by the affine function

T1(x)=f(a)+f(a)(xa)T_1(x) = f(a) + f'(a)(x-a)

with an error that goes to 00 faster than xa|x-a| (differentiability and linear approximation(Theorem 4.1)[The Derivative]). What if we want greater accuracy? Raising the degree and using a quadratic or cubic polynomial is the natural move. Two questions arise: which polynomial should we choose, and how large is the error?

Definition 5.1Taylor polynomial and remainder

Let II be an open interval, let aIa \in I, and let f:IRf : I \to \mathbb{R} be nn times differentiable at aa. The polynomial

Tn(x)=k=0nf(k)(a)k!(xa)k=f(a)+f(a)(xa)+f(a)2!(xa)2++f(n)(a)n!(xa)nT_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^n

is called the Taylor polynomial of ff of degree nn at aa. When a=0a = 0 it is called a Maclaurin polynomial. Further,

Rn(x)=f(x)Tn(x)R_n(x) = f(x) - T_n(x)

is called the remainder of order nn.

Remark 5.2Where the Taylor polynomial comes from

The polynomial TnT_n is not pulled out of a hat: it is the unique polynomial determined by the following condition. ”PP is a polynomial of degree at most nn satisfying P(j)(a)=f(j)(a)P^{(j)}(a) = f^{(j)}(a) for j=0,1,,nj = 0,1,\ldots,n.”

First, TnT_n satisfies this condition. Differentiating (xa)k(x-a)^k jj times and substituting x=ax = a gives 00 when j<kj < k (a positive power of xax-a survives), k!k! when j=kj = k, and 00 when j>kj > k. Hence Tn(j)(a)=f(j)(a)j!/j!=f(j)(a)T_n^{(j)}(a) = f^{(j)}(a) \cdot j!/j! = f^{(j)}(a).

Next, uniqueness. Let PP be another polynomial satisfying the condition and put Q=TnPQ = T_n - P, so that degQn\deg Q \le n and Q(j)(a)=0Q^{(j)}(a) = 0 for j=0,,nj = 0,\ldots,n. Writing QQ in powers of xax - a as Q(x)=k=0nbk(xa)kQ(x) = \sum_{k=0}^{n} b_k (x-a)^k (substituting x=(xa)+ax = (x-a) + a and expanding puts it in this form), the same computation gives Q(j)(a)=j!bjQ^{(j)}(a) = j!\, b_j, so bj=0b_j = 0 for every jj, that is, Q0Q \equiv 0 and P=TnP = T_n.

Theorem 5.3Taylor's theorem (Lagrange remainder)

Let II be an open interval, let aIa \in I, let n0n \ge 0 be an integer, and let f:IRf : I \to \mathbb{R} be n+1n+1 times differentiable on II. Then for every xIx \in I with xax \ne a there exists a real number cc strictly between aa and xx (that is, a<c<xa < c < x or x<c<ax < c < a) such that

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

The last term is called the Lagrange remainder.

Taking n=0n = 0, the assertion reads f(x)=f(a)+f(c)(xa)f(x) = f(a) + f'(c)(x-a), which is exactly Theorem 3.3. Taylor’s theorem is the higher-order version of the mean value theorem, and its proof likewise reduces to the mean value theorem (in Cauchy’s form).

Proof(Theorem 5.3)

We treat the case a<xa < x (for x<ax < a, read [x,a][x,a] everywhere in place of [a,x][a,x]; the same argument goes through verbatim).

As functions of t[a,x]t \in [a,x], put

F(t)=f(x)k=0nf(k)(t)k!(xt)k,G(t)=(xt)n+1.F(t) = f(x) - \sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!}(x-t)^k, \qquad G(t) = (x-t)^{n+1} .

Since ff is n+1n+1 times differentiable on II, each of f(0),,f(n)f^{(0)}, \ldots, f^{(n)} is differentiable and hence continuous. Therefore FF and GG are continuous on [a,x][a,x] and differentiable on (a,x)(a,x).

We compute FF'. By the product rule,

ddt[f(k)(t)k!(xt)k]=f(k+1)(t)k!(xt)kf(k)(t)(k1)!(xt)k1\frac{d}{dt}\left[\frac{f^{(k)}(t)}{k!}(x-t)^k\right] = \frac{f^{(k+1)}(t)}{k!}(x-t)^k - \frac{f^{(k)}(t)}{(k-1)!}(x-t)^{k-1}

(for k=0k = 0 the second term is absent and only f(t)f'(t) remains). Summing over k=0k = 0 to nn, the kk-th first term cancels against the (k+1)(k+1)-st second term, leaving

ddtk=0nf(k)(t)k!(xt)k=f(n+1)(t)n!(xt)n.\frac{d}{dt}\sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!}(x-t)^k = \frac{f^{(n+1)}(t)}{n!}(x-t)^{n} .

Hence

F(t)=f(n+1)(t)n!(xt)n,G(t)=(n+1)(xt)n.F'(t) = -\frac{f^{(n+1)}(t)}{n!}(x-t)^{n}, \qquad G'(t) = -(n+1)(x-t)^{n} .

For t(a,x)t \in (a,x) we have xt>0x - t > 0, so G(t)0G'(t) \ne 0, and the second part of Theorem 3.6 applies to F,GF, G on [a,x][a,x]. Thus for some c(a,x)c \in (a,x),

F(x)F(a)G(x)G(a)=F(c)G(c).\frac{F(x) - F(a)}{G(x) - G(a)} = \frac{F'(c)}{G'(c)} .

Computing the left-hand side: F(x)=f(x)f(x)=0F(x) = f(x) - f(x) = 0, G(x)=0G(x) = 0, F(a)=f(x)Tn(x)=Rn(x)F(a) = f(x) - T_n(x) = R_n(x) and G(a)=(xa)n+1G(a) = (x-a)^{n+1}, so it equals

0Rn(x)0(xa)n+1=Rn(x)(xa)n+1.\frac{0 - R_n(x)}{0 - (x-a)^{n+1}} = \frac{R_n(x)}{(x-a)^{n+1}} .

On the right-hand side the factor (xc)n0(x-c)^n \ne 0 cancels and

F(c)G(c)=f(n+1)(c)(xc)n/n!(n+1)(xc)n=f(n+1)(c)(n+1)!\frac{F'(c)}{G'(c)} = \frac{-f^{(n+1)}(c)(x-c)^n/n!}{-(n+1)(x-c)^n} = \frac{f^{(n+1)}(c)}{(n+1)!}

(we used n!(n+1)=(n+1)!n! \cdot (n+1) = (n+1)!). Equating the two and multiplying by (xa)n+1(x-a)^{n+1} gives

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

and the assertion follows from f(x)=Tn(x)+Rn(x)f(x) = T_n(x) + R_n(x).

Definition 5.4Landau's little-o notation

Let φ,ψ\varphi, \psi be functions defined on a punctured neighborhood of aa, with ψ\psi nonvanishing near aa. If

limxaφ(x)ψ(x)=0,\lim_{x \to a} \frac{\varphi(x)}{\psi(x)} = 0 ,

we write φ(x)=o(ψ(x)) (xa)\varphi(x) = o(\psi(x))\ (x \to a). It means that φ\varphi becomes small strictly faster than ψ\psi.

Remark 5.5The Peano form of the remainder

Let n1n \ge 1 and let ff be of class CnC^n on an open interval containing aa. Then

f(x)=Tn(x)+o((xa)n)(xa).f(x) = T_n(x) + o\bigl((x-a)^n\bigr) \qquad (x \to a) .

Applying Theorem 5.3 with n1n-1 in place of nn, there is a point cxc_x between aa and xx with

f(x)=Tn1(x)+f(n)(cx)n!(xa)n=Tn(x)+f(n)(cx)f(n)(a)n!(xa)n.f(x) = T_{n-1}(x) + \frac{f^{(n)}(c_x)}{n!}(x-a)^n = T_n(x) + \frac{f^{(n)}(c_x) - f^{(n)}(a)}{n!}(x-a)^n .

As xax \to a, the point cxc_x lies between aa and xx, so cxac_x \to a, and continuity of f(n)f^{(n)} gives f(n)(cx)f(n)(a)0f^{(n)}(c_x) - f^{(n)}(a) \to 0. Hence the last term divided by (xa)n(x-a)^n converges to 00, which is o((xa)n)o((x-a)^n) in the sense of Definition 5.4.

The Lagrange form is convenient when we want to pin the size of the error down to a concrete number, the Peano form when we only need to match orders in a limit computation. For instance, part (2) of Example 4.3 becomes a one-liner from sinx=xx3/6+o(x3)\sin x = x - x^3/6 + o(x^3):

xsinxx3=x3/6+o(x3)x316.\frac{x - \sin x}{x^3} = \frac{x^3/6 + o(x^3)}{x^3} \to \frac{1}{6} .

6. Maclaurin expansions of the basic functions

Section titled “6. Maclaurin expansions of the basic functions”

In what follows we compute TnT_n and RnR_n with a=0a = 0. In each example the procedure to check is the same. (i) Compute f(k)(0)f^{(k)}(0) and write down TnT_n. (ii) Estimate f(n+1)f^{(n+1)} and bound Rn(x)|R_n(x)|. (iii) Determine the range of xx for which Rn(x)0R_n(x) \to 0 as nn \to \infty.

Example 6.1The Maclaurin expansion of e^x

For f(x)=exf(x) = e^x we have f(k)(x)=exf^{(k)}(x) = e^x for every kk, hence f(k)(0)=1f^{(k)}(0) = 1. Therefore

Tn(x)=k=0nxkk!=1+x+x22!++xnn!.T_n(x) = \sum_{k=0}^{n} \frac{x^k}{k!} = 1 + x + \frac{x^2}{2!} + \cdots + \frac{x^n}{n!} .

By Theorem 5.3, for some cc between 00 and xx we have Rn(x)=ecxn+1/(n+1)!R_n(x) = e^{c}x^{n+1}/(n+1)!. Since cc lies between 00 and xx we have cxc \le |x|, and since ete^t is strictly increasing (because (et)=et>0(e^t)' = e^t > 0 and Corollary 3.4), it follows that ecexe^c \le e^{|x|}. Hence

Rn(x)exxn+1(n+1)!.|R_n(x)| \le e^{|x|}\,\frac{|x|^{n+1}}{(n+1)!} .

Now fix xx and let us show that an=xn+1/(n+1)!a_n = |x|^{n+1}/(n+1)! tends to 00. Choose a natural number NN with N2xN \ge 2|x|. For nNn \ge N,

an+1an=xn+2xN+2<12.\frac{a_{n+1}}{a_n} = \frac{|x|}{n+2} \le \frac{|x|}{N+2} < \frac{1}{2} .

Consequently anaN(1/2)nNa_n \le a_N (1/2)^{n-N} for nNn \ge N, and the right-hand side tends to 00 as nn \to \infty. Since an0a_n \ge 0, squeezing gives an0a_n \to 0 and therefore Rn(x)0R_n(x) \to 0. As xx was arbitrary, for every real xx

ex=k=0xkk!.e^x = \sum_{k=0}^{\infty}\frac{x^k}{k!} .

Numerical check. Taking x=1x = 1 and n=7n = 7,

T7(1)=1+1+0.5+0.1666667+0.0416667+0.0083333+0.0013889+0.0001984=2.7182540.T_7(1) = 1 + 1 + 0.5 + 0.1666667 + 0.0416667 + 0.0083333 + 0.0013889 + 0.0001984 = 2.7182540 .

The error bound is R7(1)e1/8!<3/40320=7.44×105|R_7(1)| \le e^{1}/8! < 3/40320 = 7.44 \times 10^{-5}. The difference from the true value e=2.7182818e = 2.7182818\ldots is 2.79×1052.79 \times 10^{-5}, comfortably inside the bound.

Example 6.2The Maclaurin expansion of sin x

The derivatives of f(x)=sinxf(x) = \sin x cycle with period 44 as cosx,sinx,cosx,sinx\cos x, -\sin x, -\cos x, \sin x. Their values at x=0x = 0 repeat as 0,1,0,10, 1, 0, -1, so all even-order terms vanish and

T2m+1(x)=j=0m(1)j(2j+1)!x2j+1=xx33!+x55!.T_{2m+1}(x) = \sum_{j=0}^{m}\frac{(-1)^j}{(2j+1)!}x^{2j+1} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots .

Since f(n+1)f^{(n+1)} is one of ±sin\pm\sin or ±cos\pm\cos, we have f(n+1)(t)1|f^{(n+1)}(t)| \le 1 for every tt. Hence Theorem 5.3 gives

Rn(x)xn+1(n+1)!,|R_n(x)| \le \frac{|x|^{n+1}}{(n+1)!} ,

and as shown in Example 6.1 the right-hand side tends to 00 as nn \to \infty for each xx. Therefore, for every real xx,

sinx=j=0(1)j(2j+1)!x2j+1.\sin x = \sum_{j=0}^{\infty}\frac{(-1)^j}{(2j+1)!}x^{2j+1} .

Numerical check. Approximating sin(0.1)\sin(0.1) by T3(x)=xx3/6T_3(x) = x - x^3/6 gives

T3(0.1)=0.10.0016=0.0998333333.T_3(0.1) = 0.1 - \frac{0.001}{6} = 0.0998333333 .

Here the error estimate admits a refinement. The coefficient of x4x^4 is 00, so T3=T4T_3 = T_4, and it pays to estimate with n=4n = 4:

R4(0.1)0.155!=105120=8.33×108.|R_4(0.1)| \le \frac{0.1^5}{5!} = \frac{10^{-5}}{120} = 8.33\times 10^{-8} .

Indeed sin(0.1)=0.0998334166\sin(0.1) = 0.0998334166\ldots, so the error is 8.33×1088.33 \times 10^{-8}, agreeing with the bound down to the digits. Raising nn up to the next degree whose coefficient vanishes in order to improve the bound is a standard practical device.

Example 6.3The Maclaurin expansion of log(1+x)

Consider f(x)=log(1+x)f(x) = \log(1+x) on (1,)(-1, \infty). We have f(x)=(1+x)1f'(x) = (1+x)^{-1}, and inductively

f(k)(x)=(1)k1(k1)!(1+x)k(k1)f^{(k)}(x) = \frac{(-1)^{k-1}(k-1)!}{(1+x)^{k}} \qquad (k \ge 1)

(the case k=1k = 1 is correct, and differentiating both sides gives (1)k1(k1)!(k)(1+x)k1=(1)kk!(1+x)(k+1)(-1)^{k-1}(k-1)!\cdot(-k)(1+x)^{-k-1} = (-1)^{k}k!(1+x)^{-(k+1)}, which is the case k+1k+1). Hence f(0)=0f(0) = 0 and f(k)(0)=(1)k1(k1)!f^{(k)}(0) = (-1)^{k-1}(k-1)!, so

Tn(x)=k=1n(1)k1(k1)!k!xk=xx22+x33+(1)n1nxn.T_n(x) = \sum_{k=1}^{n}\frac{(-1)^{k-1}(k-1)!}{k!}x^k = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots + \frac{(-1)^{n-1}}{n}x^n .

The remainder, with some cc between 00 and xx, is

Rn(x)=f(n+1)(c)(n+1)!xn+1=(1)nn!(1+c)n+1(n+1)!xn+1=(1)nn+1(x1+c)n+1.R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}x^{n+1} = \frac{(-1)^{n}n!}{(1+c)^{n+1}(n+1)!}x^{n+1} = \frac{(-1)^n}{n+1}\left(\frac{x}{1+c}\right)^{n+1} .

This is where the cases part company.

For 0x10 \le x \le 1. From 0<c<x0 < c < x we get 1+c>11 + c > 1, hence x/(1+c)<x1|x/(1+c)| < x \le 1 and therefore

Rn(x)1n+10.|R_n(x)| \le \frac{1}{n+1} \to 0 .

Note that this holds at x=1x = 1 as well.

For 1/2x<0-1/2 \le x < 0. From x<c<0x < c < 0 we get 1+c>1+x1/2>01 + c > 1 + x \ge 1/2 > 0, so

x1+c<x1+x1/21/2=1,\left|\frac{x}{1+c}\right| < \frac{|x|}{1+x} \le \frac{1/2}{1/2} = 1 ,

and again Rn(x)1/(n+1)0|R_n(x)| \le 1/(n+1) \to 0.

For 1<x<1/2-1 < x < -1/2. If cc is close to xx, then 1+c1 + c becomes arbitrarily small and x/(1+c)|x/(1+c)| exceeds 11. Putting q=x/(1+x)>1q = |x|/(1+x) > 1, the estimate above becomes qn+1/(n+1)q^{n+1}/(n+1) \to \infty and is useless. The Lagrange form of the remainder simply cannot handle this range. The conclusion itself is nevertheless correct: using the integral form of the remainder from the Appendix, one can show Rn(x)0R_n(x) \to 0 on all of 1<x<0-1 < x < 0.

Altogether,

log(1+x)=k=1(1)k1kxk(1<x1).\log(1+x) = \sum_{k=1}^{\infty}\frac{(-1)^{k-1}}{k}x^{k} \qquad (-1 < x \le 1) .

For x>1x > 1 the quantity xk/k|x|^k/k does not tend to 00, so the series itself diverges by the vanishing-terms criterion(Proposition 3.4)[級数と収束判定].

Numerical check. Taking x=0.5x = 0.5 and n=4n = 4,

T4(0.5)=0.50.125+0.04166670.015625=0.4010417.T_4(0.5) = 0.5 - 0.125 + 0.0416667 - 0.015625 = 0.4010417 .

The error bound is R4(0.5)(1/5)(0.5)5=6.25×103|R_4(0.5)| \le (1/5)(0.5)^5 = 6.25\times10^{-3}. Indeed log1.5=0.4054651\log 1.5 = 0.4054651\ldots, so the error is 4.42×1034.42\times10^{-3}, within the bound.

Convergence at x=1x = 1 is extremely slow. Against log2=0.6931\log 2 = 0.6931\ldots we have T10(1)=11/2+1/31/10=0.6456T_{10}(1) = 1 - 1/2 + 1/3 - \cdots - 1/10 = 0.6456\ldots: ten terms get only the first decimal place right, exactly as the bound Rn(1)1/(n+1)|R_n(1)| \le 1/(n+1) predicts. Actual numerical work uses faster-converging rearrangements such as log1+y1y=2(y+y3/3+y5/5+)\log\frac{1+y}{1-y} = 2(y + y^3/3 + y^5/5 + \cdots).

FunctionMaclaurin expansionRange where it converges to the function
exe^xk0xk/k!\sum_{k\ge0} x^k/k!all real numbers
sinx\sin xj0(1)jx2j+1/(2j+1)!\sum_{j\ge0}(-1)^j x^{2j+1}/(2j+1)!all real numbers
log(1+x)\log(1+x)k1(1)k1xk/k\sum_{k\ge1}(-1)^{k-1}x^k/k1<x1-1 < x \le 1

Remark 6.4A convergent series need not converge to the original function

The function defined by f(x)=e1/x2f(x) = e^{-1/x^2} for x0x \ne 0 and f(0)=0f(0) = 0 is known to be of class CC^\infty on R\mathbb{R} with f(k)(0)=0f^{(k)}(0) = 0 for every kk. Its Maclaurin series is then identically 00 and converges on all of R\mathbb{R}. But f(x)>0f(x) > 0 for x0x \ne 0, so the sum of the series does not agree with ff. The reason is that the remainder Rn(x)=f(x)R_n(x) = f(x) does not tend to 00.

In other words, “the Taylor series converges” and “its sum equals the original function” are two different assertions, and only an estimate of the remainder guarantees the second. For convergence tests for series themselves, see Series and convergence tests.

Exercise 7.1Standard

Show that p(x)=x33x+1p(x) = x^3 - 3x + 1 has exactly three distinct real roots. (Use the intermediate value theorem for existence and Theorem 3.1 for the upper bound on the number of roots.)

Solution

There are at least three. Being a polynomial, pp is continuous on R\mathbb{R}. Computing values,

p(2)=8+6+1=1<0,p(0)=1>0,p(1)=13+1=1<0,p(2)=86+1=3>0.p(-2) = -8 + 6 + 1 = -1 < 0,\quad p(0) = 1 > 0,\quad p(1) = 1 - 3 + 1 = -1 < 0,\quad p(2) = 8 - 6 + 1 = 3 > 0 .

By the intermediate value theorem, each of (2,0)(-2,0), (0,1)(0,1) and (1,2)(1,2) contains at least one zero of pp. These intervals are pairwise disjoint, so there are at least three distinct real roots.

There are not four or more. Suppose there were four distinct real roots r1<r2<r3<r4r_1 < r_2 < r_3 < r_4. For each ii we have p(ri)=p(ri+1)=0p(r_i) = p(r_{i+1}) = 0, and pp is continuous on [ri,ri+1][r_i, r_{i+1}] and differentiable on (ri,ri+1)(r_i,r_{i+1}), so Theorem 3.1 gives si(ri,ri+1)s_i \in (r_i, r_{i+1}) with p(si)=0p'(s_i) = 0. For i=1,2,3i = 1,2,3 the resulting points satisfy s1<r2<s2<r3<s3s_1 < r_2 < s_2 < r_3 < s_3 and are therefore distinct, so pp' would have at least three distinct zeros. But the zeros of p(x)=3x23=3(x1)(x+1)p'(x) = 3x^2 - 3 = 3(x-1)(x+1) are only x=±1x = \pm 1, two in number — a contradiction.

Hence there are exactly three roots.

Exercise 7.2Standard

Compute the following limits, verifying at each application that the hypotheses of the theorem are satisfied.

(1) limx0tanxxx3\displaystyle \lim_{x\to0}\frac{\tan x - x}{x^3}  (2) for a real number aa, limx0(1+ax)1/x\displaystyle \lim_{x\to0}(1+ax)^{1/x}

Solution

(1) Put f(x)=tanxxf(x) = \tan x - x and g(x)=x3g(x) = x^3. For 0<x<π/20 < |x| < \pi/2 both are differentiable, g(x)=3x20g'(x) = 3x^2 \ne 0 for x0x \ne 0, and f,g0f, g \to 0 as x0x \to 0. Using (tan)=1/cos2(\tan)' = 1/\cos^2,

f(x)=1cos2x1=1cos2xcos2x=sin2xcos2x=tan2x,f'(x) = \frac{1}{\cos^2 x} - 1 = \frac{1 - \cos^2 x}{\cos^2 x} = \frac{\sin^2 x}{\cos^2 x} = \tan^2 x ,

so

f(x)g(x)=tan2x3x2=13(tanxx)2.\frac{f'(x)}{g'(x)} = \frac{\tan^2 x}{3x^2} = \frac{1}{3}\left(\frac{\tan x}{x}\right)^2 .

Since tanxx=sinxx1cosx11=1\dfrac{\tan x}{x} = \dfrac{\sin x}{x}\cdot\dfrac{1}{\cos x} \to 1 \cdot 1 = 1, the product rule for limits gives f/g1/3f'/g' \to 1/3. By Theorem 4.1 (in the two-sided version of Remark 4.2),

limx0tanxxx3=13.\lim_{x\to0}\frac{\tan x - x}{x^3} = \frac{1}{3} .

(2) If a=0a = 0 the value is identically 11, so assume a0a \ne 0. For x|x| small enough we have 1+ax>01 + ax > 0, so we may write (1+ax)1/x=exp(log(1+ax)x)(1+ax)^{1/x} = \exp\bigl(\frac{\log(1+ax)}{x}\bigr). For the exponent, put f(x)=log(1+ax)f(x) = \log(1+ax) and g(x)=xg(x) = x; then f,g0f, g \to 0 as x0x \to 0, g=10g' = 1 \ne 0, and

f(x)g(x)=a1+axa.\frac{f'(x)}{g'(x)} = \frac{a}{1+ax} \to a .

Hence log(1+ax)/xa\log(1+ax)/x \to a. Since exp\exp is continuous, the rule for limits of composite functions gives

limx0(1+ax)1/x=ea.\lim_{x\to0}(1+ax)^{1/x} = e^{a} .

Taking a=1a = 1 yields limx0(1+x)1/x=e\lim_{x\to0}(1+x)^{1/x} = e, recovering the classical defining formula for ee.

Exercise 7.3Standard

Find the fourth-degree Maclaurin polynomial of cosx\cos x at 00 and estimate the error for x0.5|x| \le 0.5. Then compute the approximate value of cos(0.5)\cos(0.5) and compare it with the true value 0.87758256190.8775825619\ldots.

Solution

For f(x)=cosxf(x) = \cos x the higher derivatives at 00 are f(0)=1f(0) = 1, f(0)=sin0=0f'(0) = -\sin 0 = 0, f(0)=cos0=1f''(0) = -\cos 0 = -1, f(0)=sin0=0f'''(0) = \sin 0 = 0 and f(4)(0)=cos0=1f^{(4)}(0) = \cos 0 = 1. Hence

T4(x)=1x22+x424.T_4(x) = 1 - \frac{x^2}{2} + \frac{x^4}{24} .

The coefficient of x5x^5 is f(5)(0)=sin0=0f^{(5)}(0) = -\sin 0 = 0, so T4=T5T_4 = T_5 and it pays to estimate the error with n=5n = 5. Since f(6)(t)=cost1|f^{(6)}(t)| = |-\cos t| \le 1, Theorem 5.3 gives

R5(x)x66!0.56720=0.015625720=2.17×105(x0.5)|R_5(x)| \le \frac{|x|^6}{6!} \le \frac{0.5^6}{720} = \frac{0.015625}{720} = 2.17\times10^{-5} \qquad (|x| \le 0.5)

(estimating with n=4n = 4 would give 0.55/120=2.60×1040.5^5/120 = 2.60\times10^{-4}, a bound looser by one order of magnitude).

The approximate value at x=0.5x = 0.5 is

T4(0.5)=10.252+0.062524=10.125+0.0026042=0.8776042.T_4(0.5) = 1 - \frac{0.25}{2} + \frac{0.0625}{24} = 1 - 0.125 + 0.0026042 = 0.8776042 .

The difference from the true value is 0.87760420.8775826=2.16×1050.8776042 - 0.8775826 = 2.16\times10^{-5}, just inside the bound 2.17×1052.17\times10^{-5} above. Adding three terms has produced a value correct to four decimal places.

Exercise 7.4Hard

Let f:[0,)Rf : [0,\infty) \to \mathbb{R} be continuous on [0,)[0,\infty) and differentiable at every point of (0,)(0,\infty), with f(0)=0f(0) = 0 and with ff' nondecreasing on (0,)(0,\infty). Show that g(x)=f(x)/xg(x) = f(x)/x is nondecreasing on (0,)(0,\infty).

Solution

Let 0<x<y0 < x < y be arbitrary.

Since ff is continuous on [0,x][0,x] and differentiable on (0,x)(0,x), Theorem 3.3 gives some c1(0,x)c_1 \in (0,x) with

f(x)f(0)=f(c1)x.f(x) - f(0) = f'(c_1)\,x .

As f(0)=0f(0) = 0, this yields f(x)x=f(c1)\dfrac{f(x)}{x} = f'(c_1).

Similarly, ff is continuous on [x,y][x,y] and differentiable on (x,y)(x,y), so for some c2(x,y)c_2 \in (x,y)

f(y)f(x)=f(c2)(yx).f(y) - f(x) = f'(c_2)\,(y-x) .

Here c1<x<c2c_1 < x < c_2, and ff' is nondecreasing, so f(c1)f(c2)f'(c_1) \le f'(c_2). Combining this with yx>0y - x > 0,

f(y)=f(x)+f(c2)(yx)f(x)+f(c1)(yx)=f(x)+f(x)x(yx)=f(x)xy.f(y) = f(x) + f'(c_2)(y-x) \ge f(x) + f'(c_1)(y-x) = f(x) + \frac{f(x)}{x}(y-x) = \frac{f(x)}{x}\,y .

Dividing both sides by y>0y > 0,

f(y)yf(x)x,\frac{f(y)}{y} \ge \frac{f(x)}{x} ,

that is, g(y)g(x)g(y) \ge g(x). Since 0<x<y0 < x < y were arbitrary, gg is nondecreasing.

The hypothesis that ff' is nondecreasing means that ff is convex. This exercise establishes, using nothing but the mean value theorem, the geometrically natural fact that for a convex function through the origin the slope f(x)/xf(x)/x as seen from the origin is increasing.

  • T. Takagi, Kaiseki Gairon, revised 3rd ed., Iwanami Shoten, 1983 (in Japanese) — Chapter 2 (Differentiation). The classical treatment running from the mean value theorem to Taylor’s formula.
  • M. Sugiura, Kaiseki Nyūmon I, University of Tokyo Press, 1980 (in Japanese) — Chapter II (Differentiation). The various forms of the remainder (Lagrange, Cauchy, integral) are compared carefully.
  • W. Rudin, Principles of Mathematical Analysis, 3rd ed., McGraw-Hill, 1976 — Chapter 5 (Differentiation). Contains a proof treating the 0/00/0 and /\infty/\infty forms of l’Hôpital’s rule in a unified way.
  • M. Spivak, Calculus, 4th ed., Publish or Perish, 2008 — Chapter 20 (Approximation by Polynomial Functions). Several proofs of Taylor’s theorem and a discussion of the meaning of the remainder.
  • E. Hairer, G. Wanner, Analysis by Its History, Springer, 1996 — Chapter II. The historical circumstances in which Taylor expansions and l’Hôpital’s rule arose, presented in close contact with the original sources.

Appendix: The integral form of the remainder

Section titled “Appendix: The integral form of the remainder”

Let us settle the case 1<x<1/2-1 < x < -1/2 left open in Example 6.3. To that end we derive another representation of the remainder. Throughout, ff is of class Cn+1C^{n+1} on an open interval containing aa and xx (that is, f(n+1)f^{(n+1)} exists and is continuous).

By the fundamental theorem of calculus (the Newton–Leibniz formula(Theorem 5.4)[積分の基本定理と定積分] in The fundamental theorem of calculus and the definite integral),

f(x)f(a)=axf(t)dt.f(x) - f(a) = \int_a^x f'(t)\,dt .

Noting that the function (xt)-(x-t) of tt is an antiderivative of 11, integration by parts(Theorem 6.2)[積分の基本定理と定積分] gives

axf(t)dt=[(xt)f(t)]ax+ax(xt)f(t)dt=(xa)f(a)+ax(xt)f(t)dt.\int_a^x f'(t)\,dt = \Bigl[-(x-t)f'(t)\Bigr]_a^x + \int_a^x (x-t)f''(t)\,dt = (x-a)f'(a) + \int_a^x (x-t)f''(t)\,dt .

Repeating the same operation, induction yields

f(x)=k=0nf(k)(a)k!(xa)k+1n!ax(xt)nf(n+1)(t)dt.f(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k + \frac{1}{n!}\int_a^x (x-t)^n f^{(n+1)}(t)\,dt .

The inductive step is the integration by parts

1n!ax(xt)nf(n+1)(t)dt=f(n+1)(a)(n+1)!(xa)n+1+1(n+1)!ax(xt)n+1f(n+2)(t)dt,\frac{1}{n!}\int_a^x (x-t)^n f^{(n+1)}(t)\,dt = \frac{f^{(n+1)}(a)}{(n+1)!}(x-a)^{n+1} + \frac{1}{(n+1)!}\int_a^x (x-t)^{n+1}f^{(n+2)}(t)\,dt ,

which uses the fact that (xt)n+1/(n+1)!-(x-t)^{n+1}/(n+1)! is an antiderivative (in tt) of (xt)n/n!(x-t)^n/n!. The last integral is the integral form of the remainder.

We apply this to f(x)=log(1+x)f(x) = \log(1+x) with a=0a = 0 and 1<x<0-1 < x < 0. Since f(n+1)(t)=(1)nn!/(1+t)n+1f^{(n+1)}(t) = (-1)^n n!/(1+t)^{n+1},

Rn(x)=1n!0x(xt)n(1)nn!(1+t)n+1dt=(1)n0x(xt1+t)ndt1+t.R_n(x) = \frac{1}{n!}\int_0^x (x-t)^n \frac{(-1)^n n!}{(1+t)^{n+1}}\,dt = (-1)^n\int_0^x \left(\frac{x-t}{1+t}\right)^n \frac{dt}{1+t} .

For x<t<0x < t < 0 we have 1+t>1+x>01 + t > 1 + x > 0, and

xt1+t=tx1+tx.\left|\frac{x-t}{1+t}\right| = \frac{t-x}{1+t} \le |x| .

Indeed, this inequality is equivalent to txx(1+t)=x(1+t)t - x \le |x|(1+t) = -x(1+t), that is, to t(1+x)0t(1+x) \le 0, which follows from t0t \le 0 and 1+x>01 + x > 0. Therefore

Rn(x)x0xndt1+t=xn[log(1+t)]x0=xn(log(1+x)).|R_n(x)| \le \int_x^0 |x|^n\frac{dt}{1+t} = |x|^n\bigl[\log(1+t)\bigr]_x^0 = |x|^n\bigl(-\log(1+x)\bigr) .

Since x<1|x| < 1 we have xn0|x|^n \to 0, and log(1+x)-\log(1+x) is a constant independent of nn, so Rn(x)0R_n(x) \to 0. This justifies the expansion on all of 1<x<0-1 < x < 0 and completes the assertion of Example 6.3.

The Lagrange form can also be derived from the integral form. If f(n+1)f^{(n+1)} is continuous, then the mean value theorem for integrals(Proposition 4.2)[積分の基本定理と定積分] applies and, for some cc between aa and xx,

1n!ax(xt)nf(n+1)(t)dt=f(n+1)(c)n!ax(xt)ndt=f(n+1)(c)(n+1)!(xa)n+1.\frac{1}{n!}\int_a^x (x-t)^n f^{(n+1)}(t)\,dt = \frac{f^{(n+1)}(c)}{n!}\int_a^x (x-t)^n\,dt = \frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1} .

Note, however, that the integral form requires continuity of f(n+1)f^{(n+1)}, so the hypotheses of Theorem 5.3 are weaker.

Report an error in this article ・Operated by: Mugen Giken LLCPricingTermsLegal notice

© 2026 夢現技研合同会社 ・Feeding the text to an LLM is welcome. Code samples are MIT licensed.