Taylor's theorem with remainder
Statement
Let \( n \in \mathbb{N} \cup \{0\} \), let \( I \subseteq \mathbb{R} \) be an interval, and let \( a, x \in I \) with \( a \ne x \). Suppose \( f : I \to \mathbb{R} \) is such that the derivatives \( f, f', \dots, f^{(n)} \) all exist and are continuous on the closed interval with endpoints \( a \) and \( x \), and \( f^{(n+1)} \) exists at every point of the open interval between \( a \) and \( x \). Then there exists a point \( \xi \) strictly between \( a \) and \( x \) such that \[ f(x) \;=\; \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}\,(x-a)^{k} \;+\; \frac{f^{(n+1)}(\xi)}{(n+1)!}\,(x-a)^{n+1}. \] The polynomial \( T_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k \) is the degree-\(n\) Taylor polynomial of \( f \) at \( a \), and \( R_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1} \) is the Lagrange form of the remainder.
Why it matters
Taylor's theorem is the bridge between the local and the global: it converts knowledge of finitely many derivatives at a single point into a quantitative statement about \( f \) on a whole interval, with an error term that is not merely "small" but explicitly controlled by one higher derivative at one unknown point. It is the engine behind every truncation-error estimate in numerical analysis, every big-\(\mathcal{O}\) asymptotic expansion, the second-derivative test, and the standard proofs that concrete series (for \( e^x \), \( \sin \), \( \cos \), \( \ln \)) actually converge to their functions.
Conceptually, it generalises the Mean Value Theorem (the case \( n = 0 \)) up the ladder of derivatives, and it isolates precisely what smoothness buys you: polynomial approximation of controllable quality — while its famous failure cases (such as \( e^{-1/x^2} \)) mark the exact boundary between smoothness and analyticity.
Hypotheses
Proof
Result
Reading. A function with \( n+1 \) derivatives is its degree-\(n\) Taylor polynomial exactly, up to an error that looks like the "next term" of the series — except that the \((n+1)\)-st derivative is evaluated not at \( a \) but at some unknown intermediate point \( \xi \). You never learn where \( \xi \) is; you only learn it exists, which is enough whenever you can bound \( f^{(n+1)} \) on the whole interval.
Scope. Real-valued functions of one real variable, on an interval containing both the expansion point \( a \) and the evaluation point \( x \), with \( f^{(n)} \) continuous up to and including both endpoints and \( f^{(n+1)} \) existing (no continuity needed) at every interior point between them. The point \( \xi \) depends on \( x \), on \( a \), and on \( n \). For complex- or vector-valued \( f \) the Lagrange form fails; only the weaker bound \( |R_n(x)| \le \frac{\sup |f^{(n+1)}|}{(n+1)!}|x-a|^{n+1} \) and the integral form survive.
Corollaries & converses
- Mean Value Theorem. The case \( n = 0 \) reads \( f(x) = f(a) + f'(\xi)(x-a) \): Taylor's theorem is the MVT's higher-order generalisation, and the proof above degenerates to the standard MVT proof when \( n = 0 \).
- The workhorse estimate. If \( |f^{(n+1)}| \le M_{n+1} \) on the interval, then \( |f(x) - T_n(x)| \le \dfrac{M_{n+1}}{(n+1)!}|x-a|^{n+1} \). If moreover \( \dfrac{M_{n+1}\,|x-a|^{n+1}}{(n+1)!} \to 0 \) as \( n \to \infty \) (as for \( e^x, \sin, \cos \) on any bounded set), the Taylor series converges to \( f \).
- Polynomial rigidity. If \( f^{(n+1)} \equiv 0 \) on an interval, then \( f \) is a polynomial of degree at most \( n \) there (the remainder vanishes identically; see Problem 4).
- Second-derivative test, quantitatively. With \( n = 1 \): if \( f'(a) = 0 \) and \( f'' \ge m \gt 0 \) near \( a \), then \( f(x) \ge f(a) + \frac{m}{2}(x-a)^2 \) near \( a \) — a strict quantitative local minimum.
- Peano's form is a different theorem. If merely \( f^{(n)}(a) \) exists (no hypotheses away from \( a \)), then \( f(x) = T_n(x) + o\!\left((x-a)^n\right) \); weaker conclusion, weaker hypotheses. Neither subsumes the other.
- Converse fails. Being approximable to order \( o((x-a)^n) \) by a polynomial does not imply \( n \)-fold differentiability: \( f(x) = x^3 \sin(1/x) \), \( f(0)=0 \), satisfies \( |f(x)| \le |x|^3 = o(x^2) \), so the zero polynomial is a degree-2 approximation of Peano quality at \( 0 \); but \( f''(0) \) does not exist, since \( \frac{f'(h)-f'(0)}{h} = 3h\sin(1/h) - \cos(1/h) \) has no limit as \( h \to 0 \).
Fails without
- Differentiability missing at one interior point. \( f(t) = |t| \) on \( [-1,1] \), \( n = 0 \), \( a = -1 \), \( x = 1 \): the conclusion demands \( \xi \) with \( f'(\xi)\cdot 2 = f(1) - f(-1) = 0 \), i.e. \( f'(\xi) = 0 \); but \( f'(t) = 1 \) for \( t \gt 0 \), \( f'(t) = -1 \) for \( t \lt 0 \), and \( f'(0) \) does not exist. No such \( \xi \). One point of non-differentiability, strictly inside the interval, destroys the theorem.
- Real-valuedness dropped. \( f(t) = e^{it} \) on \( [0, 2\pi] \), \( n = 0 \): \( f(2\pi) - f(0) = 0 \), so the Lagrange form would force \( f'(\xi) = i e^{i\xi} = 0 \) for some \( \xi \) — impossible, since \( |ie^{i\xi}| = 1 \). The same failure occurs for the vector-valued \( t \mapsto (\cos t, \sin t) \). Rolle's theorem, and with it the pointwise-\( \xi \) form of the remainder, is an artefact of the total order on \( \mathbb{R} \).
- Domain not an interval. \( f(t) = 1/t \), \( a = -1 \), \( x = 1 \), \( n = 0 \): every derivative of \( f \) exists at every point of its domain, yet \( f(1) - f(-1) = 2 \) while \( f'(\xi) = -1/\xi^2 \lt 0 \) for all \( \xi \). The hypotheses require the entire closed segment from \( a \) to \( x \) to lie in the domain; \( 0 \) is missing.
- Endpoint continuity dropped. \( n = 0 \), \( f(t) = 0 \) on \( [0,1) \), \( f(1) = 1 \): \( f' \equiv 0 \) on \( (0,1) \) but \( f(1) - f(0) = 1 \). Continuity on the closed interval is where the extreme value theorem (inside Rolle) earns its keep.
Common errors
- Treating \( \xi \) as a constant. \( \xi \) depends on \( x \), on \( a \), and on \( n \). Writing \( \xi \) outside a quantifier, differentiating an identity in \( x \) that contains \( \xi(x) \), or reusing "the same \( \xi \)" for two different \( n \) are all invalid moves.
- "Smooth implies the series converges to \( f \)". False: \( f(x) = e^{-1/x^2} \) (with \( f(0) = 0 \)) is \( C^\infty \) with every \( f^{(k)}(0) = 0 \), so its Taylor series at \( 0 \) is identically zero and converges everywhere — to the wrong function. Taylor's theorem never asserts \( R_n \to 0 \); that must be proved separately, and can be false.
- Off-by-one in the remainder. Writing \( \frac{f^{(n+1)}(\xi)}{n!} \) instead of \( \frac{f^{(n+1)}(\xi)}{(n+1)!} \), or evaluating the \((n+1)\)-st derivative at \( a \) rather than at \( \xi \). The remainder is the "\( (n+1) \)-st term with a displaced evaluation point".
- Using the Lagrange form under Peano hypotheses. If you only know \( f^{(n)}(a) \) exists (nothing about a neighbourhood), the Lagrange form is unavailable; you get only \( T_n(x) + o((x-a)^n) \). Conversely, quoting "\( R_n = o((x-a)^n) \)" and then bounding it numerically at a fixed \( x \) is meaningless — little-\( o \) says nothing at any fixed point.
- Applying the pointwise form to vector-valued functions. For \( f : \mathbb{R} \to \mathbb{R}^m \), there is in general no single \( \xi \) that works for all coordinates simultaneously (see the circle example above). Use the integral remainder or a norm estimate instead.
- Bounding \( f^{(n+1)}(\xi) \) by its value at \( a \) or at \( x \). You must bound \( \sup |f^{(n+1)}| \) over the whole interval between \( a \) and \( x \), since \( \xi \) is unknown.
Discussion
Brook Taylor published the expansion without any remainder in his Methodus Incrementorum (1715), deriving it formally from finite differences; as stated it was a heuristic about infinite series, silent on convergence. The theorem as a tool of rigour is really Lagrange's: in the Théorie des fonctions analytiques (1797) he introduced the remainder term that now bears his name, precisely because he wanted to found calculus on power series and needed to control truncation. Cauchy later gave his own form of the remainder and the integral form, and — decisively — the counterexample \( e^{-1/x^2} \), which shattered Lagrange's programme by showing that a \( C^\infty \) function is not determined by its derivatives at a point.
The right way to read the theorem is as a family of statements, one for each \( n \), about a fixed function on a fixed interval — not as a statement about infinite series. For a single \( n \) it is a finite, exact identity, as concrete as the MVT. Questions about the Taylor series (does \( T_n \to f \)?) are questions about the behaviour of \( R_n \) as \( n \to \infty \), and the theorem's role there is to hand you \( R_n \) in a form you can estimate. This division of labour — exact identity first, limit analysis second — is the pattern for most of hard analysis.
The theorem also marks the boundary between real and complex analysis. On \( \mathbb{R} \), infinite smoothness and analyticity are far apart: by Borel's theorem, every sequence of reals \( (c_k) \) is the derivative sequence \( f^{(k)}(0) \) of some \( C^\infty \) function, so Taylor series at a point carry no convergence information whatsoever. On \( \mathbb{C} \), a single complex derivative on an open set forces analyticity and the Taylor series converges automatically on discs. Taylor's theorem with remainder is exactly the tool real analysis has instead of that miracle.
There is a whole family of remainders beyond Lagrange's. Applying the Cauchy MVT to the auxiliary function \( g \) of the proof against \( \varphi(t) = (x-t)^p \) for any \( p \gt 0 \) yields the Schlömilch–Roche remainder \( R_n(x) = \frac{f^{(n+1)}(\xi)}{p \cdot n!}(x-\xi)^{n+1-p}(x-a)^{p} \); the choice \( p = n+1 \) recovers Lagrange, and \( p = 1 \) gives the Cauchy form \( R_n(x) = \frac{f^{(n+1)}(\xi)}{n!}(x-\xi)^{n}(x-a) \), which is sharper for functions like \( (1+x)^{\alpha} \) near the edge of the interval of convergence. If \( f^{(n+1)} \) is additionally continuous, repeated integration by parts gives the integral form \( R_n(x) = \frac{1}{n!}\int_a^x (x-t)^n f^{(n+1)}(t)\,dt \), which — unlike the Lagrange form — survives verbatim for maps into any Banach space and is the correct statement in \( \mathbb{R}^m \), on manifolds, and in the calculus of variations. Finally, under the weakest hypothesis (only \( f^{(n)}(a) \) exists), Peano's form \( R_n(x) = o((x-a)^n) \) holds, proved by \( n-1 \) applications of L'Hôpital plus the definition of the derivative.
Common misconceptions. The theorem does not say the Taylor series converges, nor that it converges to \( f \) when it does converge (\( e^{-1/x^2} \)); it does not tell you where \( \xi \) is, only that it exists; and "the remainder is the next term" is a mnemonic, not a fact — the next term has \( f^{(n+1)}(a) \), the remainder has \( f^{(n+1)}(\xi) \), and the gap between those is the whole content.
Worked examples
Example 1 — computing \( e \) to within \( 10^{-3} \), with certainty.
Reading. Seven terms of the exponential series pin \( e \) to within \( 6 \times 10^{-4} \), and — because the remainder is manifestly positive — we even know the approximation is an underestimate. (True value: \( e = 2.71828\ldots \))
Scope. The same template bounds \( e^x \) for any fixed \( x \), with \( 3 \) replaced by \( e^{|x|} \le 3^{\lceil |x| \rceil} \).
Example 2 — the inequality \( \sin x \gt x - \dfrac{x^3}{6} \) for all \( x \gt 0 \).
Reading. The cubic Taylor polynomial of \( \sin \) is a genuine global lower bound on the positive half-line — the remainder's sign, not just its size, is readable from the Lagrange form.
Scope. The same technique gives the interlacing \( T_{4m+3}(x) \lt \sin x \lt T_{4m+1}(x) \) for \( x \gt 0 \), and by oddness the reversed inequalities for \( x \lt 0 \).
Problems
- Write down the Taylor polynomial \( T_3 \) of \( f(x) = \ln(1+x) \) at \( a = 0 \) and its Lagrange remainder, and bound the error of \( T_3(0.5) \) as an approximation to \( \ln 1.5 \). Is \( T_3(0.5) \) an over- or under-estimate?
Solution
By induction, \( f^{(k)}(x) = \dfrac{(-1)^{k-1}(k-1)!}{(1+x)^k} \) for \( k \ge 1 \), so \( f^{(k)}(0) = (-1)^{k-1}(k-1)! \) and \[ T_3(x) = x - \frac{x^2}{2} + \frac{x^3}{3}, \qquad R_3(x) = \frac{f^{(4)}(\xi)}{4!}x^4 = -\frac{x^4}{4(1+\xi)^4}, \quad \xi \in (0,x). \] All hypotheses hold on \( [0, 0.5] \) since \( f \) is \( C^\infty \) on \( (-1, \infty) \). At \( x = 0.5 \): since \( 0 \lt \xi \lt 0.5 \) we have \( 1 \lt (1+\xi)^4 \), so \[ |R_3(0.5)| = \frac{(0.5)^4}{4(1+\xi)^4} \lt \frac{1}{64} = 0.015625, \] and \( R_3(0.5) \lt 0 \), so \( T_3(0.5) = 0.5 - 0.125 + \frac{1}{24} = \frac{5}{12} = 0.41\overline{6} \) is an overestimate: \[ \frac{5}{12} - \frac{1}{64} \lt \ln 1.5 \lt \frac{5}{12}. \] (Indeed \( \ln 1.5 = 0.405465\ldots \)) - Let \( f \) be twice differentiable on an interval \( I \) with \( f''(t) \ge 0 \) for all \( t \in I \). Prove that the graph of \( f \) lies above every tangent line: \( f(x) \ge f(a) + f'(a)(x-a) \) for all \( a, x \in I \).
Solution
If \( x = a \) the claim is an equality. Otherwise apply Taylor's theorem with \( n = 1 \) on the interval between \( a \) and \( x \): the hypotheses hold because \( f'' \) exists everywhere on \( I \), which forces \( f' \) to be differentiable, hence continuous, on all of \( I \) (and \( f \) likewise). So there is \( \xi \) strictly between \( a \) and \( x \) with \[ f(x) = f(a) + f'(a)(x-a) + \frac{f''(\xi)}{2}(x-a)^2. \] Since \( f''(\xi) \ge 0 \) and \( (x-a)^2 \gt 0 \), the last term is \( \ge 0 \), which is the claim. (If \( f'' \gt 0 \) throughout, the inequality is strict for \( x \ne a \): tangent lines touch the graph only at the point of tangency.) - How many terms of the Taylor expansion of \( \cos \) at \( 0 \) suffice to compute \( \cos(0.2) \) with error at most \( 10^{-8} \)? Justify with the Lagrange remainder, and exploit the vanishing odd-degree terms.
Solution
Every derivative of \( \cos \) is \( \pm\sin \) or \( \pm\cos \), so \( |\cos^{(m)}(t)| \le 1 \) for all \( m, t \), and the hypotheses of the theorem hold on \( [0, 0.2] \) for every \( n \). Thus \[ |\cos(0.2) - T_n(0.2)| \le \frac{(0.2)^{n+1}}{(n+1)!}. \] Take \( n = 7 \). Because all odd Taylor coefficients of \( \cos \) vanish, \( T_7 = T_6 = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720} \), and \[ |\cos(0.2) - T_6(0.2)| = |\cos(0.2) - T_7(0.2)| \le \frac{(0.2)^8}{8!} = \frac{2.56 \times 10^{-6}}{40320} \lt 6.4 \times 10^{-11} \lt 10^{-8}. \] So the four terms through degree \( 6 \) suffice (comfortably: even the cruder bound \( (0.2)^7/7! \lt 2.6 \times 10^{-9} \) applied to \( T_6 \) directly already beats \( 10^{-8} \)). Numerically \( T_6(0.2) = 1 - 0.02 + \frac{0.0016}{24} - \frac{0.000064}{720} = 0.98006657\ldots \) - Prove: if \( f^{(n+1)}(t) = 0 \) for every \( t \) in an interval \( I \), then \( f \) restricted to \( I \) is a polynomial of degree at most \( n \).
Solution
Fix \( a \in I \) and let \( x \in I \), \( x \ne a \). Since \( f^{(n+1)} \) exists on all of \( I \), the derivative \( f^{(n)} \) is differentiable, hence continuous, on \( I \), and likewise all lower derivatives are continuous; so the hypotheses of Taylor's theorem hold on the interval between \( a \) and \( x \). Therefore there is \( \xi \) between \( a \) and \( x \) with \[ f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k + \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1} = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k, \] because \( f^{(n+1)}(\xi) = 0 \) by hypothesis. As \( x \in I \) was arbitrary (and the identity is trivial at \( x = a \)), \( f \) coincides on \( I \) with the fixed polynomial \( T_n \), which has degree at most \( n \). Note the converse is immediate, so \( f^{(n+1)} \equiv 0 \) on an interval characterises polynomials of degree \( \le n \) — and note also that connectedness of \( I \) is essential: on \( (0,1) \cup (2,3) \) a function can be two different polynomials. - (Harder.) Use Taylor's theorem for \( e^x \) to prove that \( e \) is irrational.
Solution
As in Worked Example 1, for every \( n \in \mathbb{N} \) there is \( \xi_n \in (0,1) \) with \[ e = \sum_{k=0}^{n}\frac{1}{k!} + \frac{e^{\xi_n}}{(n+1)!}, \qquad\text{hence}\qquad 0 \lt e - \sum_{k=0}^{n}\frac{1}{k!} \lt \frac{3}{(n+1)!}. \] Suppose for contradiction \( e = p/q \) with \( p, q \in \mathbb{N} \). Choose \( n \ge \max(q, 3) \) and multiply the displayed inequalities by \( n! \): \[ 0 \;\lt\; n!\,e - \sum_{k=0}^{n}\frac{n!}{k!} \;\lt\; \frac{3\,n!}{(n+1)!} = \frac{3}{n+1} \;\le\; \frac{3}{4} \;\lt\; 1. \] Now \( n!\,e = n!\,p/q \) is an integer because \( q \mid n! \) (as \( q \le n \)), and each \( n!/k! = n(n-1)\cdots(k+1) \) is an integer for \( k \le n \). So the middle quantity is an integer lying strictly between \( 0 \) and \( 1 \) — a contradiction. Hence \( e \) is irrational. (The strict positivity of the remainder, which the Lagrange form hands us for free since \( e^{\xi_n} \gt 0 \), is exactly what rules out the integer \( 0 \).)