Taylor Series
Build the Taylor polynomial of a standard function to any order, and see how far it is from the truth.
eˣ converges on all x
1 + x + 0.5x² + 0.166667x³ + 0.041667x⁴ + 0.008333x⁵
| k | f⁽ᵏ⁾(a) ÷ k! | Contribution at x |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| 2 | 0.5 | 0.5 |
| 3 | 0.16666667 | 0.16666667 |
| 4 | 0.04166667 | 0.04166667 |
| 5 | 0.00833333 | 0.00833333 |
A Taylor polynomial approximates a function near a point by matching its derivatives there. Each term adds one more derivative, so the fit improves as the order rises: eˣ to order 5 about 0 is 1 + x + x²/2 + x³/6 + x⁴/24 + x⁵/120.
Matching derivatives, one at a time
The construction is simple once you see what each term does. The constant term matches the function’s value at the centre. The linear term matches its slope. The quadratic term matches its curvature, and so on — the coefficient of (x − a)ⁿ is exactly f⁽ⁿ⁾(a) ÷ n!, chosen so the nth derivative of the polynomial agrees with the function’s at that point.
Because everything is anchored at the centre, the approximation is excellent nearby and deteriorates as you move away. Doubling the distance from the centre multiplies the leading error term by 2ⁿ⁺¹, which is why a fifth-order polynomial that is near-perfect at x = 0.2 can be visibly wrong at x = 2.
Why the factorial is there
Differentiating (x − a)ⁿ n times produces n!, so dividing by n! is what makes the nth derivative of the term come out as f⁽ⁿ⁾(a) exactly rather than n! times too large. It also explains why the terms shrink so fast for functions like eˣ and sine — the factorial in the denominator outruns any fixed power in the numerator, which is why those series converge everywhere.
a Maclaurin series is the same thing with a = 0
- 1 Pick the centre. Expanding eˣ about a = 0 makes every derivative equal to e⁰ = 1.
- 2 Work out the derivatives at that point. For eˣ every derivative is itself, so f⁽ⁿ⁾(0) = 1 for all n.
- 3 Divide each by n!. That gives coefficients 1, 1, 1/2, 1/6, 1/24, 1/120 for orders 0 to 5.
- 4 Attach the powers. 1 + x + x²/2 + x³/6 + x⁴/24 + x⁵/120.
- 5 Check the error at a point. At x = 1 this gives 2.716667 against e = 2.718282 — accurate to three decimal places already.
How the error falls with order
Approximating e¹ = 2.718282 with the Maclaurin polynomial of eˣ.
| Order | Value at x = 1 | Absolute error |
|---|---|---|
| 1 | 2 | 0.718282 |
| 2 | 2.5 | 0.218282 |
| 3 | 2.666667 | 0.051615 |
| 4 | 2.708333 | 0.009948 |
| 5 | 2.716667 | 0.001615 |
| 8 | 2.718279 | 0.0000031 |
Where the approximation stops working
Two things limit it. The first is the interval of convergence: ln(1 + x) and 1/(1 − x) only converge for |x| < 1, so no number of terms makes them usable at x = 2 — the series diverges rather than converging slowly. The second is distance from the centre: even for eˣ, which converges everywhere, a low-order polynomial is only useful close to a.
The remainder term quantifies this. Lagrange’s form bounds the error of an order-n polynomial by M·|x − a|ⁿ⁺¹ ÷ (n + 1)!, where M bounds the (n + 1)th derivative between a and x. For an alternating series such as sine there is a simpler bound still: the error is no larger than the first omitted term.
The coefficients here come from the closed form of each function’s derivatives rather than from numerical differentiation, so the polynomial is exact to the precision shown. That is also why the list of functions is curated: an arbitrary expression would need symbolic differentiation, and estimating high derivatives numerically is unreliable enough that the answer would not be trustworthy.