Skip to content
Topos Uranos

The Taylor remainder and its applications

Summary

The lesson on the Taylor polynomial proved that the remainder Rn,a(x)=f(x)−Pn,a(x)R_{n,a}(x) = f(x) - P_{n,a}(x) is negligible compared with (x−a)n(x - a)^n as xx tends to aa, but warned that an equivalence is not a bound: it does not say how large the error is for a given xx. This lesson gives three exact expressions for the remainder. Lagrange’s writes it as the following term of the polynomial, with the derivative of order n+1n + 1 computed at an unknown intermediate point; Cauchy’s, with another distribution of the factors, bounds the error better when the intermediate point may be close to xx; and the integral form, which requires the continuity of that derivative, writes it without unknown points. All three come from a single auxiliary function and from the mean value theorems of Cauchy and of Lagrange, or from integration by parts. With them the promises of Calculus I are kept: the constant M2\frac{M}{2} in the error of the tangent line, the explanation of the errors of the differential, the bound for the error of the parabola of the cosine, the inequalities between the exponential and its polynomials, an explicit form of the higher-order derivative test and the quadratic convergence of the Newton-Raphson method. The problems approximate values with a guaranteed error and choose the order that ensures it.

Learning objectives

  1. Prove Taylor’s formulas with the remainders of Lagrange, of Cauchy and in integral form, with their exact hypotheses.
  2. Bound the remainder in order to approximate values with a guaranteed error, and choose the order of the polynomial that ensures a given precision.
  3. Deduce from the remainder the bound M2(x−a)2\frac{M}{2} (x - a)^2 for the error of the tangent line and a form of the higher-order derivative test valid on a whole interval.
  4. Prove the quadratic convergence of the Newton-Raphson method near a simple root and use it to estimate the number of iterations needed.

The Lagrange and Cauchy remainders

The lesson on the Taylor polynomial fixed the notation that follows: if ff is defined on an open interval II and is nn times differentiable at a point aa of II, the Taylor polynomial of order nn is Pn,a(x)=∑k=0nf(k)(a)k!(x−a)kP_{n,a}(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!} (x - a)^k, and the remainder is Rn,a(x)=f(x)−Pn,a(x)R_{n,a}(x) = f(x) - P_{n,a}(x), for xx in II; with a=0a = 0 one writes PnP_n and RnR_n. The theorem of Taylor’s formula with Peano remainder, from that lesson, says that, if n≥1n \geq 1 and ff is moreover n−1n - 1 times differentiable on II, then Rn,a(x)=o⁡((x−a)n)R_{n,a}(x) = \operatorname{o}\left((x - a)^n\right) as xx tends to aa: a statement about a limit. To obtain a value of the remainder at each xx, the idea is to fix xx and move the point at which the expansion is made.

LemmaThe auxiliary function of the remainder

Let n≥0n \geq 0 be an integer, II an open interval, ff a function n+1n + 1 times differentiable on II and xx a point of II, and let FF be the function defined on II by the following formula:

F(t)=f(x)−∑k=0nf(k)(t)k!(x−t)kF(t) = f(x) - \sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!} (x - t)^k

Then FF is differentiable on II, F(x)=0F(x) = 0, F(a)=Rn,a(x)F(a) = R_{n,a}(x) for every aa in II, and for every tt in II:

F′(t)=−f(n+1)(t)n!(x−t)nF'(t) = -\frac{f^{(n + 1)}(t)}{n!} (x - t)^n

The number F(t)F(t) is the remainder at xx of the Taylor polynomial of order nn expanded at the moving point tt. On differentiating with respect to tt, each term produces two summands, which cancel with those of the neighboring terms, and only the last one remains.

Proof

  1. F(x)=f(x)−f(x)=0,F(a)=f(x)−Pn,a(x)=Rn,a(x)F(x) = f(x) - f(x) = \resaltar{0}, \qquad F(a) = f(x) - P_{n,a}(x) = \resaltar{R_{n,a}(x)}

    With t=xt = x, the terms of index k≥1k \geq 1 vanish because of the factor (x−x)k(x - x)^k, and the one of index 00 is f(x)f(x). With t=at = a, the sum is Pn,a(x)P_{n,a}(x), by the definition of the Taylor polynomial and remainder, from the lesson on the Taylor polynomial.

  2. ddt(f(k)(t)k!(x−t)k)=f(k+1)(t)k!(x−t)k−f(k)(t)(k−1)!(x−t)k−1\dato{term}{\frac{\mathrm{d}}{\mathrm{d}t}\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}}

    Let kk be an integer with 1≤k≤n1 \leq k \leq n. Since ff is n+1n + 1 times differentiable on II, the function f(k)f^{(k)} is differentiable on II. By the proposition on powers with an integer exponent, from the lesson on differentiation rules, and the theorem of the chain rule, from the lesson on the chain rule, the derivative of (x−t)k(x - t)^k with respect to tt is −k (x−t)k−1-k \, (x - t)^{k - 1}, with (x−t)0=1(x - t)^0 = 1, also at t=xt = x; the theorem of the product rule, from the lesson on differentiation rules, gives the derivative of the term of index kk. That of the term of index 00 is f′(t)f'(t).

  3. ddt(∑k=0nf(k)(t)k!(x−t)k)=A0(t)+∑k=1n(Ak(t)−Ak−1(t))=An(t)→F′(t)=−f(n+1)(t)n!(x−t)n\frac{\mathrm{d}}{\mathrm{d}t}\left(\sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!} (x - t)^k\right) = A_0(t) + \sum_{k=1}^{n} \left(A_k(t) - A_{k - 1}(t)\right) = A_n(t) \rightarrow \resaltar{F'(t) = -\frac{f^{(n + 1)}(t)}{n!} (x - t)^n}

    Let Ak(t)=f(k+1)(t)k!(x−t)kA_k(t) = \frac{f^{(k + 1)}(t)}{k!} (x - t)^k for 0≤k≤n0 \leq k \leq n. The derivative of the term of index 00 is A0(t)A_0(t), and that of the term of index k≥1k \geq 1 is Ak(t)−Ak−1(t)A_k(t) - A_{k - 1}(t). By the theorem on the derivative of a linear combination, from the lesson on differentiation rules, and the theorem of the telescoping sum, from the lesson on summations, progressions and induction, the derivative of the sum is An(t)A_n(t); since f(x)f(x) does not depend on tt, one obtains F′F'.

The auxiliary function equals the sought remainder at aa and equals 00 at xx, and its derivative contains only the derivative of order n+1n + 1. A mean value theorem between aa and xx turns this information into an equality for the remainder. The synthesis of the unit on the applications of derivatives, in Calculus I, announced that the remainder would be bounded with the theorems of Rolle and of Cauchy: Cauchy’s mean value theorem, which was proved with Rolle’s, gives the Lagrange form.

TheoremTaylor’s formula with Lagrange remainder

Let n≥0n \geq 0 be an integer, II an open interval, aa a point of II and ff a function n+1n + 1 times differentiable on II. For every xx in II different from aa, there exists a number cc strictly between aa and xx such that:

f(x)=∑k=0nf(k)(a)k!(x−a)k+f(n+1)(c)(n+1)!(x−a)n+1,Rn,a(x)=f(n+1)(c)(n+1)!(x−a)n+1f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!} (x - a)^k + \frac{f^{(n + 1)}(c)}{(n + 1)!} (x - a)^{n + 1}, \qquad R_{n,a}(x) = \frac{f^{(n + 1)}(c)}{(n + 1)!} (x - a)^{n + 1}

The remainder has the form of the following term of the polynomial, with the derivative computed at an unknown point cc instead of aa. Cauchy’s mean value theorem compares the auxiliary function with the power (x−t)n+1(x - t)^{n + 1}, which also vanishes at xx.

Proof

  1. (F(β)−F(α))G′(c)=(G(β)−G(α))F′(c)\dato{cau}{\left(F(\beta) - F(\alpha)\right) G'(c) = \left(G(\beta) - G(\alpha)\right) F'(c)}

    Let FF be the auxiliary function of the lemma, with this xx, and G(t)=(x−t)n+1G(t) = (x - t)^{n + 1} for tt in II, differentiable by the proposition on powers with an integer exponent and the chain rule. Let α\alpha be the smaller and β\beta the larger of the numbers aa and xx; since II is an interval, [α,β]⊆I\icc{\alpha}{\beta} \subseteq I. By the theorem according to which differentiable implies continuous, from the lesson on the derivative as a limit, FF and GG are continuous on [α,β]\icc{\alpha}{\beta}, and they are differentiable on (α,β)\ioo{\alpha}{\beta}. Cauchy’s mean value theorem, from the lesson on the theorems of Fermat, Rolle, Lagrange and Cauchy, gives a cc in (α,β)\ioo{\alpha}{\beta} with the equality below.

  2. (F(x)−F(a))G′(c)=(G(x)−G(a))F′(c)\dato{ord}{\left(F(x) - F(a)\right) G'(c) = \left(G(x) - G(a)\right) F'(c)}

    If a<xa < x, then α=a\alpha = a and β=x\beta = x, and the equality is the one below. If x<ax < a, then α=x\alpha = x and β=a\beta = a, and the equality reads (F(a)−F(x))G′(c)=(G(a)−G(x))F′(c)\left(F(a) - F(x)\right) G'(c) = \left(G(a) - G(x)\right) F'(c), which multiplied by −1-1 is the same. In both cases, cc lies strictly between aa and xx.

  3. (n+1) Rn,a(x) (x−c)n=f(n+1)(c)n!(x−a)n+1(x−c)n\dato{sus}{(n + 1) \, R_{n,a}(x) \, (x - c)^n = \frac{f^{(n + 1)}(c)}{n!} (x - a)^{n + 1} (x - c)^n}

    By the lemma, F(x)=0F(x) = 0, F(a)=Rn,a(x)F(a) = R_{n,a}(x) and F′(c)=−f(n+1)(c)n!(x−c)nF'(c) = -\frac{f^{(n + 1)}(c)}{n!} (x - c)^n; moreover, G(x)=0G(x) = 0, G(a)=(x−a)n+1G(a) = (x - a)^{n + 1} and G′(c)=−(n+1) (x−c)nG'(c) = -(n + 1) \, (x - c)^n. On substituting, the signs of the two sides cancel.

  4. Rn,a(x)=f(n+1)(c)(n+1)!(x−a)n+1\resaltar{R_{n,a}(x) = \frac{f^{(n + 1)}(c)}{(n + 1)!} (x - a)^{n + 1}}

    Since c≠xc \neq x, the factor (x−c)n(x - c)^n is not zero; dividing by it and by n+1n + 1, and since (n+1)⋅n!=(n+1)!(n + 1) \cdot n! = (n + 1)!, the formula follows.

With n=0n = 0, the formula reads f(x)−f(a)=f′(c) (x−a)f(x) - f(a) = f'(c) \, (x - a): it is Lagrange’s mean value theorem, and Taylor’s formula with Lagrange remainder extends it to all orders. The point cc depends on xx and on nn, and in general it is not known; the solved problem “The intermediate point of a rational function” computes it in one case. The hypotheses are stronger than those of the Peano remainder, which only requires n−1n - 1 derivatives on II and the one of order nn at aa, but they do not include the continuity of f(n+1)f^{(n + 1)}. For x>ax > a, the same formula is obtained from the lemma of the iterated Cauchy theorem, from the lesson on numerical integration, with Rn,a(a+u)R_{n,a}(a + u) in place of F(u)F(u), on [0,x−a]\icc{0}{x - a}, with G(u)=un+1G(u) = u^{n + 1} and m=p=n+1m = p = n + 1; the auxiliary function avoids the iteration and treats both sides of aa at once.

TheoremTaylor’s formula with Cauchy remainder

Under the hypotheses of Taylor’s formula with Lagrange remainder, for every xx in II different from aa there exists a number cc strictly between aa and xx such that:

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

Lagrange’s mean value theorem, applied directly to the auxiliary function, gives another form of the remainder, in which the distance from cc to xx appears separately.

Proof

  1. F(x)−F(a)=F′(c) (x−a)\dato{lag}{F(x) - F(a) = F'(c) \, (x - a)}

    Let FF, α\alpha and β\beta be as in the preceding proof. The function FF is continuous on [α,β]\icc{\alpha}{\beta} and differentiable on (α,β)\ioo{\alpha}{\beta}, and Lagrange’s mean value theorem, from the lesson on the theorems of Fermat, Rolle, Lagrange and Cauchy, gives a cc in (α,β)\ioo{\alpha}{\beta} with F(β)−F(α)=F′(c) (β−α)F(\beta) - F(\alpha) = F'(c) \, (\beta - \alpha). If a<xa < x, this is the equality below; if x<ax < a, it reads F(a)−F(x)=F′(c) (a−x)F(a) - F(x) = F'(c) \, (a - x), which multiplied by −1-1 is the same.

  2. Rn,a(x)=f(n+1)(c)n!(x−c)n(x−a)\resaltar{R_{n,a}(x) = \frac{f^{(n + 1)}(c)}{n!} (x - c)^n (x - a)}

    By the lemma, the left-hand side is −Rn,a(x)-R_{n,a}(x), and F′(c)=−f(n+1)(c)n!(x−c)nF'(c) = -\frac{f^{(n + 1)}(c)}{n!} (x - c)^n; multiply by −1-1.

The two points cc are, in general, different. If one writes c=a+θ (x−a)c = a + \theta \, (x - a), with 0<θ<10 < \theta < 1, the Cauchy remainder is f(n+1)(c)n!(1−θ)n(x−a)n+1\frac{f^{(n + 1)}(c)}{n!} (1 - \theta)^n (x - a)^{n + 1}: it has the factor (1−θ)n(1 - \theta)^n, which is small when cc is close to xx, precisely where a bound for f(n+1)(c)f^{(n + 1)}(c) may be poor. The solved problem “The Cauchy remainder where the Lagrange remainder falls short” exploits this difference. To bound the error, on the other hand, the Lagrange form almost always suffices.

CorollaryBound for the Taylor remainder

Let n≥0n \geq 0 be an integer, II an open interval, aa and xx points of II and ff a function n+1n + 1 times differentiable on II. If MM is a number such that ∣f(n+1)(t)∣≤M\abs{f^{(n + 1)}(t)} \leq M for every tt strictly between aa and xx, then:

∣Rn,a(x)∣≤M(n+1)!∣x−a∣n+1\abs{R_{n,a}(x)} \leq \frac{M}{(n + 1)!} \abs{x - a}^{n + 1}

A bound for the derivative of order n+1n + 1 between aa and xx gives a bound for the error, without knowing the intermediate point.

Proof

  1. ∣Rn,a(x)∣=∣f(n+1)(c)∣(n+1)!∣x−a∣n+1≤M(n+1)!∣x−a∣n+1\abs{R_{n,a}(x)} = \frac{\abs{f^{(n + 1)}(c)}}{(n + 1)!} \abs{x - a}^{n + 1} \leq \resaltar{\frac{M}{(n + 1)!} \abs{x - a}^{n + 1}}

    If x=ax = a, the remainder is zero, because Pn,a(a)=f(a)P_{n,a}(a) = f(a), and the inequality reads 0≤00 \leq 0. If x≠ax \neq a, the point cc of Taylor’s formula with Lagrange remainder lies strictly between aa and xx, and the bound for the derivative holds at it.

If the bound MM holds on a whole interval containing aa, the bound for the error holds for all xx in that interval at once, and the order nn is chosen so that the bound is smaller than the desired precision, as in the solved problem “Seven digits of the cosine on an eighth of a turn”. The sign of the remainder can also be read off the Lagrange formula. For example, by the theorem on derivatives of order nn of powers and of the exponential, from the lesson on higher-order derivatives and the differential, all the derivatives of exe^x are exe^x, and Pn(x)=∑k=0nxkk!P_n(x) = \sum_{k=0}^{n} \frac{x^k}{k!}. If x>0x > 0, the remainder is ec(n+1)!xn+1\frac{e^c}{(n + 1)!} x^{n + 1} with 0<c<x0 < c < x, and since the exponential is strictly increasing, 1<ec<ex1 < e^c < e^x. Hence, for every x>0x > 0 and every integer n≥0n \geq 0:

∑k=0nxkk!<ex<∑k=0nxkk!+exxn+1(n+1)!\sum_{k=0}^{n} \frac{x^k}{k!} < e^x < \sum_{k=0}^{n} \frac{x^k}{k!} + \frac{e^x x^{n + 1}}{(n + 1)!}

and if moreover xn+1<(n+1)!x^{n + 1} < (n + 1)!, solving for exe^x gives ex<Pn(x)1−xn+1(n+1)!e^x < \frac{P_n(x)}{1 - \frac{x^{n + 1}}{(n + 1)!}}. With x=110x = \frac{1}{10} and n=2n = 2 one obtains 1.105<e0.1<1.1051−16000=66305999=1.10518…1.105 < e^{0.1} < \frac{1.105}{1 - \frac{1}{6000}} = \frac{6630}{5999} = 1.10518\ldots. The first inequality is the one that the lesson on monotonicity obtained by differentiating sequences of inequalities, when it announced that those polynomials were Taylor’s and that their error would be studied here; the second says how far short of the function they fall.