Start with the tangent
Near x = 0, the curve is close to its tangent there. The curve passes through (0, 1), because , and its gradient there is also , so the tangent is y = 1 + x.
At x = 0.1 the tangent gives 1.1, and . At x = 0.5 it gives 1.5, against . The tangent matches the curve's height and gradient at 0, and nothing more, so it drifts away as x moves off 0.
Match the bend as well
The tangent is straight, but bends upward. To follow the bend, add a term in : try 1 + x + cx², and choose c so that this polynomial has the same second derivative at 0 as .
The second derivative of 1 + x + cx² is 2c, and the second derivative of is , which is 1 at 0. So 2c = 1 and , giving .
At x = 0.5 this gives 1 + 0.5 + 0.125 = 1.625, against the true 1.648721: out by 0.023721, where the tangent alone was out by 0.148721.
The gold curve , with the plain straight line y = 1 + x and the plain parabola . All three pass through (0, 1). The parabola stays with the curve further from 0 than the line does.
The general term
Carry on, one term per derivative. Term n is : the nth derivative of the function at 0, times , divided by n factorial. Written out, , and this is the Maclaurin series of f.
The factorial is there to make the derivatives match. Differentiate total of n times and it becomes n × (n − 1) × … × 1 = n!. So the nth derivative of the term is exactly . Every other term has either vanished by then or still carries a power of x, which is 0 at x = 0. So at 0 the polynomial and the function agree in height, gradient, second derivative, and every derivative the polynomial includes.
Everything in the series is measured at zero. The function's values anywhere else are not used.
The series for
Every derivative of is , and at 0 each of them equals 1. So every coefficient is , and , which is with the factorials worked out.
Put in x = 1 and add one term at a time. The sums are 1, then 2, then 2.5, then 2.666667 after four terms, 2.708333 after five, 2.716667 after six, and 2.718056 after seven. The true value is e = 2.718282, so seven terms are out by 0.000226.
At x = 0.5 the same four terms, 1 + 0.5 + 0.125 + 0.020833, give 1.645833, out by 0.002888 from 1.648721. Closer to 0, fewer terms are needed for the same accuracy.
The series for sin x
Differentiate sin x again and again: cos x, then −sin x, then −cos x, then sin x, and round again. At 0 these are 1, 0, −1, 0, and sin 0 = 0 itself. So the terms in even powers vanish, and the odd ones alternate in sign: , which is
The first term alone says for small x, measured in radians. That is the small-angle approximation. At x = 0.5 it gives 0.5; two terms give 0.5 − 0.020833 = 0.479167; three give 0.479427. The true value is sin 0.5 = 0.479426.
At x = 1 the sums are 1, then 0.833333, then 0.841667, then 0.841468 with a fourth term, against sin 1 = 0.841471.
The same series settles a limit. Divide by x: , and every term after the 1 shrinks to 0 as x shrinks, so tends to 1 as x tends to 0.
P3 stays within 0.01 of sin x for |x| ≤ 1.04: each extra degree matches one more derivative at 0, so the polynomial hugs the curve further before it flies away
Step the degree until the polynomial stays within 0.01 of sin x out to π
The plain curve is y = sin x and the gold one is the series stopped at the term, . The shaded band is where the two differ by less than 0.01: out to about |x| = 1.04. Drag N to add terms: with the term the band reaches about 1.76, and with the term about 2.50.
The usual mistakes
Leaving out the factorial. The term of is , not : its coefficient is .
Putting the wrong factorial under a term. 3! = 6 belongs to the term; the term divides by 2! = 2.
Getting the sign of the term of sin x wrong. It is ; the minus bends the line y = x back down toward the curve.
Using degrees. The derivatives of sin x and cos x are the ones above only when x is in radians, so the series needs x in radians.
The cosine, and a pendulum
Differentiating cos x gives −sin x, −cos x, sin x, cos x, which at 0 are 0, −1, 0, 1, and cos 0 = 1. So , which is
In the application below, a pendulum 2 meters long is drawn aside through 0.2 radians, and the series for cos x up to the term gives how far the bob rises.
Worked example: A Pendulum Drawn Aside Through a Small Angle: How Far the Bob Rises, from a Series
Question A pendulum 2 meters long is drawn aside until its string makes an angle of x = 0.2 radians with the vertical. The bob then rises h = 2(1 − cos x) meters. (a) Write the Maclaurin series for cos x as far as the term in x4, and use it to estimate cos 0.2. (b) Find how far the bob rises, and say how far out the two-term estimate 1 − x22 would leave it.
1.Differentiate the cosine at zero, one order at a time: cos 0 = 1, then −sin 0 = 0, then −cos 0 = −1, then sin 0 = 0, then cos 0 = 1. Divide each by the factorial of its order to get the coefficients.
The derivatives of cos x at zero run 1, 0, −1, 0, 1, and each is divided by the factorial of its order. 2.(a) So cos x ≈ 1 − x22 + x424, every odd term vanishing. At x = 0.2: 1 − 0.02 + 0.001624 = 1 − 0.02 + 0.0000667 = 0.980067 to six decimal places.
(a) So cos x ≈ 1 − x22 + x424, and at x = 0.2 that is 1 − 0.02 + 0.0000667. 3.Put that into the height: h = 2(1 − 0.980067) = 2 × 0.019933 = 0.039867 m.
That gives cos 0.2 ≈ 0.980067, so h = 2(1 − 0.980067) = 0.039867 m. 4.(b) So the bob rises about 39.87 mm.
(b) The bob rises about 39.87 mm. 5.Now stop the series at two terms: cos 0.2 ≈ 1 − 0.02 = 0.98, which gives h = 2 × 0.02 = 0.04 m, or 40 mm.
Stopping at two terms gives cos 0.2 ≈ 0.98 and h = 0.04 m, or 40 mm: the lower curve pulls away much sooner. 6.The two-term estimate is therefore 40 − 39.87 = 0.13 mm too high. Check: the term left out is x424 = 0.0000667, and 2 × 0.0000667 = 0.000133 m, which is that 0.13 mm.
The two-term answer is 0.13 mm too high, and the term left out, 2 × 0.2424 = 0.000133 m, is exactly that.
Answer: (a) cos 0.2 ≈ 0.980067; (b) the bob rises about 39.87 mm, and the two-term estimate leaves it 0.13 mm too high
Common mistakes
- Reading 0.2 as a measure in degrees. The series is built from the derivatives of cos x with x in radians, and at 0.2 degrees the bob would rise only about 0.012 mm, out by a factor of more than three thousand.
- Keeping only the first term, cos x ≈ 1. That gives h = 0 and says the bob does not rise at all; the series needs the x2 term before it says anything about the height.