When 0 will not do
A Maclaurin series is built from a function’s value and derivatives at x = 0. ln x has no value there: as x shrinks toward 0, ln x falls without limit. Its derivatives, , , , …, have no value at 0 either. So ln x has no Maclaurin series.
The way out is to measure somewhere else. At x = 1 everything is known exactly: ln 1 = 0, and each derivative is a whole number. A series built at x = 1 is called the Taylor series of ln x about 1, and 1 is its center.
The same formula, a new center
The Taylor series of f about a is . Term n is : the nth derivative at a, times the nth power of x − a, divided by n factorial.
It works for the same reason as at 0. Every power of x − a is 0 at x = a, so at x = a the polynomial equals f(a). Take the term with and differentiate it n times: it becomes : the n! from the power cancels the n! underneath. The terms with lower powers have been differentiated away by then, and the higher ones still carry a factor of x − a, which is 0 at a. So at a the polynomial and the function have the same value, the same gradient, and the same derivatives as far as the polynomial goes.
Everything in the series is measured at a. The powers are powers of x − a, the distance from the center, and not of x.
The series of ln x about 1
Differentiate ln x four times: , , and . At x = 1 these are 1, −1, 2 and −6, and ln 1 = 0.
Divide each by its factorial: , , and . So . Write u for x − 1 and this is , the series for ln(1 + u), as it must be, since x = 1 + u.
Check at x = 1.1, where x − 1 = 0.1. The running totals are 0.1, 0.095, 0.095333 and 0.095308, and ln 1.1 = 0.095310. At x = 1.5 they are 0.5, 0.375, 0.416667 and 0.401042, against ln 1.5 = 0.405465: further from the center, more terms are needed for the same accuracy.
The gold curve is y = ln x, and the plain one is the first two terms, . They touch at (1, 0) and bend the same way there. At x = 1.5 the two terms give 0.375 against 0.405465, at x = 2 they give 0.5 against 0.693147, and at x = 3 they give 0 against 1.098612.
Near the center and far from it
Two terms match the value, the gradient and the bend of ln x at 1, and nothing more. Close to 1 that is enough; further off the curve and the parabola drift apart, on both sides: at x = 0.5 the two terms give −0.625, and ln 0.5 = −0.693147.
More terms carry the agreement further, but only so far. The series is the ln(1 + u) series with u = x − 1, which converges for , so the Taylor series of ln x about 1 converges for . The stretch reaches from the center 1 to the point 0 where ln x breaks down, and the same distance on the other side.
Choosing the center
Put a = 0 and every power of x − a becomes a power of x, every derivative is taken at 0, and the Taylor series is the Maclaurin series. The Maclaurin series is the Taylor series about 0.
Any center will do where the function and its derivatives are known. The best center is one close to the x you need, so that x − a is small and few terms are enough.
For example, has no gradient at 0, since its derivative has no value there, but at 4 everything is easy. f(4) = 2, , and the second derivative is , which is at x = 4. Dividing that by 2! gives , so near 4.
At x = 4.2, x − 4 = 0.2, and the polynomial gives 2 + 0.05 − 0.000625 = 2.049375, against . At x = 5, further from the center, it gives 2.234375 against .
The usual mistakes
Using powers of x instead of powers of x − a. About 1, the second term of ln x is , not .
Taking the derivatives at 0. Every derivative is measured at the center a; derivatives at 0 build the Maclaurin series, and for ln x they do not exist.
Leaving out the factorials. The third derivative of ln x at 1 is 2, but the coefficient of is .
Starting with a constant of 1. The constant term is f(a), and for ln x about 1 that is ln 1 = 0.
A controller calibrated at 20 degrees
In the application below, a controller knows a setting time and its first two derivatives only at 20 degrees Celsius. So the polynomial is built about 20, in powers of T − 20, and then read at 23 degrees.
Worked example: A Yogurt Incubator Read Away from Its Calibration Point: A Taylor Series About 20 Degrees
Question A dairy's controller knows a batch's setting time only at its calibration temperature of 20 degrees Celsius. The true setting time at T degrees is S(T) = 600T minutes for T between 18 and 30, and the controller stores only S(20) = 30 minutes, S'(20) = −1.5 minutes per degree and S''(20) = 0.15 minutes per degree squared. (a) Estimate the setting time at 23 degrees from the Taylor polynomial of degree 2 about 20 degrees. (b) Use the Lagrange error bound to say how far that estimate can be from the true time.
1.Write the Taylor polynomial of degree 2 about T = 20: S(T) ≈ S(20) + S'(20)(T − 20) + S''(20)2(T − 20)2. The center is 20, not 0, so every power is a power of T − 20.
The center is 20 degrees, so every power is a power of T − 20. 2.Put the stored numbers in, with 0.152 = 0.075: S(T) ≈ 30 − 1.5(T − 20) + 0.075(T − 20)2.
The polynomial is 30 − 1.5(T − 20) + 0.075(T − 20)2, since 0.152 = 0.075. 3.(a) At T = 23 the step from the center is T − 20 = 3, so the estimate is 30 − 1.5 × 3 + 0.075 × 9 = 30 − 4.5 + 0.675 = 26.175 minutes.
(a) At T = 23 the step is 3: 30 − 4.5 + 0.675 = 26.175 minutes. 4.For the error, the Lagrange bound after the degree 2 term is M|T − 20|33!, where M bounds the third derivative between 20 and 23. Here S'''(T) = −3600T4, and 3600T4 is largest at the left end, so M = 3600204 = 3600160000 = 0.0225.
S'''(T) = −3600T4, largest in size at T = 20, so M = 0.0225. 5.(b) The bound is 0.0225 × 336 = 0.60756 = 0.101 minutes, about 6 seconds, so the estimate of 26.175 minutes is within 0.101 minutes of the truth. It is: the exact time is 60023 = 26.087 minutes, and the estimate is out by 0.088 minutes.
(b) The bound is 0.0225 × 276 = 0.101 minutes, and the true gap is 0.088.
Answer: (a) About 26.175 minutes; (b) within 0.101 minutes, about 6 seconds, and the exact time is 60023 = 26.087 minutes, so the estimate is out by 0.088 minutes
Common mistakes
- Putting T = 23 into the powers instead of T − 20. The polynomial is written in the step away from the center, so the terms take 3: using 23 gives 30 − 34.5 + 39.675 = 35.175 minutes, which is nowhere near a setting time.
- Taking the third derivative at the center and stopping there. The Lagrange bound needs a value that holds right across the interval from the center to the point, so M is the largest 3600T4 for T between 20 and 23. Here that happens to be at T = 20, but for a point below the center it would be at the far end instead.