The Taylor polynomial
Idea. Near a point a, a smooth function is close to the polynomial that matches its value and first n derivatives at a:
Tn(x)=f(a)+f′(a)(x−a)+2!f′′(a)(x−a)2+⋯+n!f(n)(a)(x−a)n.
With a=0 this is the Maclaurin polynomial. If the remainder tends to 0 as n→∞, the infinite sum is the Taylor series, and it equals f.
Why the factorials. Differentiating (x−a)k exactly k times gives k!. Dividing by k! makes the k-th derivative of Tn at a equal to f(k)(a).
Remainder (Lagrange form).
f(x)−Tn(x)=(n+1)!f(n+1)(c)(x−a)n+1for some c between a and x.
So if ∣f(n+1)∣≤M on the interval, the error is at most (n+1)!M∣x−a∣n+1.
Series to know by heart
| Function | Maclaurin series | Valid for |
|---|
| ex | 1+x+2!x2+3!x3+… | all x |
| sinx | x−3!x3+5!x5−… | all x |
| cosx | 1−2!x2+4!x4−… | all x |
| 1−x1 | 1+x+x2+x3+… | ∣x∣<1 |
| ln(1+x) | x−2x2+3x3−… | −1<x≤1 |
| (1+x)α | 1+αx+2!α(α−1)x2+… | ∣x∣<1 |
| arctanx | x−3x3+5x5−… | ∣x∣≤1 |
| tanx | x+3x3+152x5+… | ∣x∣<2π |
| sinhx, coshx | like sin and cos, but with all signs + | all x |
Patterns.
- sin is odd and contains only odd powers. cos is even and contains only even powers.
- The derivative of the ex series is itself. The derivative of the sin series is the cos series.
- Substituting x→−x in 1−x1 gives 1+x1=1−x+x2−…. Integrating that gives ln(1+x).
- Substituting x→x2 in 1+x1 and integrating gives arctanx.
Computing Taylor expansions
Example 1: ex about a=1. Every derivative equals e at 1, so
ex=e[1+(x−1)+2!(x−1)2+…].
Example 2: lnx about a=1. f(1)=0, f′(1)=1, f′′(1)=−1 and f′′′(1)=2. So
lnx=(x−1)−2(x−1)2+3(x−1)3−…
This is the ln(1+t) series with t=x−1.
Example 3: approximate 4.1. Take f(x)=x and a=4.
- f(4)=2.
- f′(x)=2x1, so f′(4)=41.
- f′′(x)=−4x3/21, so f′′(4)=−321.
4.1≈2+40.1−321⋅20.01=2+0.025−0.00015625=2.02484375.
The true value is 2.0248457…. The first-order (linear) approximation 2.025 is already within 1.6×10−4.
Example 4: an error bound. Approximate e0.5 by T3=1+0.5+0.125+0.02083=1.64583.
- Every derivative of ex on [0,0.5] is at most e0.5<1.65.
- So the error is at most 4!1.65×0.54=241.65×0.0625≈0.0043.
The true error is 1.64872−1.64583≈0.0029, within the bound.