Matching derivatives instead of matching points
Most approximation schemes force a polynomial through several points on a curve. Taylor's does something different: it forces the polynomial to agree with the function at one point, but to agree there in value, slope, curvature and every higher derivative up to order N. All the information is gathered at a single place, which is why the result is superb near that place and can be terrible far from it.
Degree 1 is a familiar object: f(a) + f′(a)(x − a) is exactly the tangent line. Degree 2 adds f″(a)(x − a)²/2 and bends the line into the parabola with the right curvature. Each further degree pins down one more derivative.
The factorials are not decoration. Differentiating (x − a)ⁿ exactly n times produces n!, so dividing by n! in the coefficient cancels it and leaves f⁽ⁿ⁾(a) standing alone. Every other term either vanishes or still carries a factor of (x − a) that dies at the centre. That is the whole design.
When the centre is zero the construction is called a Maclaurin series, which is not a different idea — just the common case, and the one that gives the tidy expansions of e^x, sin x and cos x that everyone memorises.
How big the error is, and what controls it
Taylor's theorem does not merely assert that the polynomial is close; it gives the error exactly. The remainder after degree N is f⁽ᴺ⁺¹⁾(ξ)(x − a)^(N+1)/(N+1)! for some unknown point ξ between the centre and your evaluation point. Bounding the unknown derivative by its maximum on that span turns the equality into the usable inequality this calculator reports.
Three things control the error. The distance from the centre, raised to the power N + 1, which is why accuracy collapses as you move away. The factorial in the denominator, which grows extremely fast and is why raising the degree helps so much near the centre. And the size of the next derivative, which is a property of the function you cannot change.
For e^x about zero evaluated at 1, the next derivative is e^ξ with ξ between 0 and 1, so the maximum is e = 2.71828. At degree 4 the bound is 2.71828 × 1⁵/120 = 0.0226524. The measured error is 0.0099485, comfortably below it. As always, the bound assumes the worst case at every point and the true error does better.
Convergence is not guaranteed everywhere. The Maclaurin series for 1/(1 − x) converges only for |x| < 1, and the radius of convergence is exactly the distance from the centre to the nearest singularity. Outside it, adding terms makes the approximation worse rather than better; the radius of convergence calculator finds that boundary.
Worked example: the Maclaurin polynomial of e^x to degree 4, evaluated at x = 1
This is the default setup.
- Derivatives. Every derivative of
e^xise^x, sof⁽ⁿ⁾(0) = 1for every n. - Coefficients.
cₙ = 1/n!, giving1, 1, 1/2, 1/6, 1/24. - The polynomial.
P₄(x) = 1 + x + x²/2 + x³/6 + x⁴/24. - Evaluate at x = 1.
1 + 1 + 0.5 + 0.1666667 + 0.0416667 = 2.7083333. - Compare.
e = 2.7182818, so the error is0.0099485— about four parts in a thousand. - Bound it.
max|f⁽⁵⁾| = e = 2.7182818on[0, 1], soR₄ ≤ 2.7182818 × 1/120 = 0.0226524. The measured error sits below the bound.
Now watch the degree work. Adding the degree-5 term contributes 1/120 = 0.0083333, taking the partial sum to 2.7166667 and the error to 0.0016152. Degree 6 adds 1/720 = 0.0013889, reaching 2.7180556 with an error of 0.0002263. Each extra term divides the error by roughly the next integer, which is the factorial at work.
And watch the distance work against you. The same degree-4 polynomial evaluated at x = 3 gives 1 + 3 + 4.5 + 4.5 + 3.375 = 16.375 against a true e³ = 20.0855369, an error of 3.7105369. The distance tripled and the error grew by a factor of about 373, because the error carries (x − a)⁵ and 3⁵ = 243, with the larger fifth derivative on [0, 3] supplying the rest.
How to read the term table
The derivative column is the raw material. These are f⁽ᵏ⁾(a), the numbers a hand calculation spends most of its time producing. For sin x about zero they cycle through 0, 1, 0, −1; for e^x they are all 1.
The coefficient column divides by k factorial. Notice how fast it shrinks even when the derivatives do not: by k = 8 the factorial is 40320, so a derivative of order one contributes only 0.0000248 per unit of (x − a)⁸.
The term column includes the distance factor. A term is small either because its coefficient is small or because (x − a) is small. Near the centre the second effect dominates; far from it, the first cannot rescue you.
The partial sum column is the answer at each degree. Reading down it shows the approximation converging, and the size of the last change is a practical error estimate — often a better one than the Lagrange bound, which is deliberately pessimistic. If the partial sums are not settling, your point is probably outside the radius of convergence.
Standard Maclaurin series
| Function | Maclaurin series | Converges for |
|---|---|---|
e^x | 1 + x + x²/2! + x³/3! + x⁴/4! + … | all x |
sin x | x − x³/3! + x⁵/5! − x⁷/7! + … | all x |
cos x | 1 − x²/2! + x⁴/4! − x⁶/6! + … | all x |
1/(1 − x) | 1 + x + x² + x³ + x⁴ + … | |x| < 1 |
ln(1 + x) | x − x²/2 + x³/3 − x⁴/4 + … | −1 < x ≤ 1 |
arctan x | x − x³/3 + x⁵/5 − x⁷/7 + … | |x| ≤ 1 |
(1 + x)^k | 1 + kx + k(k−1)x²/2! + … | |x| < 1 for non-integer k |
sinh x | x + x³/3! + x⁵/5! + … | all x |
cosh x | 1 + x²/2! + x⁴/4! + … | all x |
The sine and cosine series contain only odd and only even powers respectively, which is the algebraic statement that one function is odd and the other even. The hyperbolic pair are the same series with every sign made positive.
Where Taylor expansions go wrong
- Forgetting the factorial. Writing
f⁽ⁿ⁾(a)(x − a)ⁿwithout dividing byn!destroys the whole construction; the polynomial then matches none of the derivatives beyond the first. - Using powers of x when the centre is not zero. The variable of a Taylor polynomial is
(x − a), notx. Expanding abouta = 4and writingx⁴instead of(x − 4)⁴gives a completely different function. - Evaluating outside the radius of convergence. The series for
1/(1 − x)diverges atx = 2no matter how many terms you take. More terms make it worse, not better. - Assuming higher degree always helps. It helps near the centre. Far from it, the distance factor
(x − a)^(N+1)can grow faster than the factorial shrinks, at least until N becomes large. - Treating the Lagrange bound as the error. It is an upper bound built from the worst case of the next derivative, and the true error is usually well below it.
- Expanding about a point where a derivative fails to exist.
ln xhas no Maclaurin series because it is undefined at zero; the natural centre isa = 1, which is why the standard series is written forln(1 + x).
What Taylor polynomials are actually used for
Evaluating functions. Underneath every library implementation of a transcendental function is a polynomial or rational approximation, usually a refined descendant of a Taylor expansion, chosen because a processor multiplies and adds and does nothing else.
Resolving indeterminate limits. Substituting series is often faster and clearer than repeated differentiation. (1 − cos x)/x² becomes (x²/2 − x⁴/24 + …)/x², which visibly tends to 1/2. Compare that with L'Hôpital's rule, which needs two rounds of differentiation to reach the same answer.
Linearising models. Physics and engineering are full of small-angle and small-signal approximations, and every one of them is a truncated Taylor series: sin θ ≈ θ for the pendulum, (1 + x)^k ≈ 1 + kx for relativistic and thermodynamic corrections.
Deriving numerical methods. Finite-difference formulas, Euler's method, Runge-Kutta and Newton's method are all constructed by truncating Taylor expansions, and their orders of accuracy are the orders of the terms discarded.
Integrating the unintegrable. e^(−x²) has no elementary antiderivative, but its series does: integrate term by term and you get a series for the error function that converges rapidly near zero.
