Building the polynomial
The degree-n Taylor polynomial of f centered at a is
Pn(x) = f(a) + f′(a)(x − a) + f″(a)(x − a)2/2! + … + f(n)(a)(x − a)n/n!
Each coefficient is chosen so that Pn and f have the same value and the same first n derivatives at a. Degree 0 is a flat line at the right height, degree 1 is the tangent line, degree 2 also matches the bending, and so on. When a = 0 it is called a Maclaurin polynomial.
Some terms are zero. Around a = 0, sin x is odd, so all its even-power terms vanish: P3 and P4 are the same polynomial. Press + and watch nothing change on those steps.
The interval of convergence
Letting n → ∞ gives the Taylor series. For sin x, cos x and ex it converges to the function for every x. The other three only converge within a distance R, the radius of convergence, of the center:
- 1/(1 − x) blows up at x = 1, so R = |1 − a|. Neither endpoint is included.
- ln(1 + x) breaks down at x = −1, so R = 1 + a. The right endpoint is included (there the series is an alternating harmonic-type series); the left one, at −1, is not.
- arctan x looks perfectly smooth on the number line, yet R = √(1 + a2). The trouble is hidden off the line: its derivative 1/(1 + x2) blows up at the complex numbers ±i, and R is the distance from a to them. Both endpoints are included.
Outside the interval, adding terms makes things worse, not better. Try 1/(1 − x) at x = −1.5 and press + a few times.
How big is the error?
Taylor’s theorem (Lagrange form) says the remainder Rn(x) = f(x) − Pn(x) equals f(n+1)(z)(x − a)n+1/(n + 1)! for some z between a and x. If |f(n+1)| ≤ M there, then
|Rn(x)| ≤ M|x − a|n+1/(n + 1)!
For sin and cos every derivative is at most 1, so M = 1. For ex, M is e raised to the larger of a and x. The page shows that bound next to the true error so you can see that the bound is always at least as big.
For ln(1 + x) to the right of the center, and for arctan x centered at 0 with |x| ≤ 1, the series alternates with shrinking terms, so the alternating series bound applies: the error is at most the size of the first term left out. For 1/(1 − x) the page shows the exact remainder, because the series is geometric.
Check yourself
- Write the Maclaurin polynomial P5 for sin x and use it to estimate sin 1.
Answer
P5(x) = x − x3/3! + x5/5!, so sin 1 ≈ 1 − 1/6 + 1/120 ≈ 0.841667. The true value is 0.841471, an error of about 0.000196, under the Lagrange bound 1/6! ≈ 0.00139.
- What is the interval of convergence of the Taylor series for 1/(1 − x) centered at a = −1?
Answer
The distance from −1 to the blow-up at 1 is R = 2, so the series converges on (−3, 1). It is the geometric series Σ (x + 1)k/2k+1, and at both endpoints its terms do not shrink to 0.
- Why can no number of terms of the Maclaurin series for ln(1 + x) approximate ln 4?
Answer
ln 4 = ln(1 + 3) needs x = 3, which is outside the interval (−1, 1]. There the terms (−1)k−13k/k grow without bound, so the partial sums swing wider and wider. Move the center to a = 2 (then R = 3) and x = 3 lies inside.
A bit of history: Brook Taylor published the general series in his Methodus incrementorum (1715); James Gregory had found series like the one for arctan x decades earlier, and Colin Maclaurin made the case a = 0 popular in 1742. Joseph-Louis Lagrange gave the remainder formula used above in 1797.