Taylor polynomials
Pick a function and slide the degree n. The orange curve is the Taylor polynomial Tₙ(x): the polynomial that matches the function's value and its first n derivatives at x = 0. The shaded band is where Tₙ stays within 0.1 of the function. Drag the black dot along the curve to read off the exact error at any x. For ln(1 + x) and 1/(1 − x), notice the two dashed walls at x = ±1: however many terms you add, the polynomial never gets through them.
Mission. Pick eˣ and drag the dot to x = 1. Before you move the degree slider, predict the smallest n for which Tₙ(1) is within 0.001 of e ≈ 2.71828. Then slide n and check.
Answer
n = 6. T₅(1) = 2.71667 misses by 0.0016, and T₆(1) = 2.71806 misses by 0.00023. The error after n terms is roughly the next term, 1/(n + 1)!, and 1/7! = 0.0002 is the first that drops below 0.001. Extension: now drag the dot to x = 3. The terms 3ᵏ/k! grow up to 4.5 (at k = 2 and k = 3) before they start to shrink, so the error on the readout falls much more slowly: it is still above 1 at n = 5, and you need n = 12 to get within 0.001.
What's going on
A Taylor polynomial is built one derivative at a time. T₀ is the constant f(0). T₁ adds the tangent line. T₂ bends it to match the curvature, and so on. Each coefficient is f⁽ᵏ⁾(0)/k!, so for eˣ, whose derivatives are all 1 at zero, the coefficients are 1, 1, 1/2, 1/6, 1/24, … For sin x the even derivatives vanish and the odd ones alternate in sign, which is why only odd powers appear and the signs flip.
Near x = 0 every extra term improves the fit, and the shaded band of agreement grows. For eˣ, sin x and cos x it grows without bound: push n to 15 and the band swallows the whole screen for eˣ, and reaches about ±6 for sin x and cos x. The coefficients shrink like 1/k!, which beats any power of x eventually.
ln(1 + x) and 1/(1 − x) are different. Their coefficients shrink like 1/k or not at all, so the series stops converging once |x| is bigger than 1. The dashed red walls mark that radius of convergence. Inside the walls more terms help; outside, the polynomial swings ever more wildly. The function 1/(1 − x) blows up at x = 1, and a power series centred at 0 cannot see past the nearest trouble spot, in any direction. ln(1 + x) blows up at x = −1, and that single bad point on the left also kills the series on the right, just past x = 1, where ln(1 + x) is perfectly finite.
Sheet: Where the power series come from.