11.10 Taylor Series
11.10 Taylor Series
11.10 Taylor Series
10
for some coefficients cn , with positive radius of convergence. In practice, any formula
involving standard functions and operations defines an analytic function, provided
the formula gives real number values in a small interval around√x = a. For example
1
x−a is not analytic at x = a, because it gives ±∞ at x = a; and x−a is not analytic
at x = a because for x slightly smaller than a, it gives the square root of a negative
number.∗
Taylor Series Theorem: Let f (x) be a function which is analytic at x = a.
Then we can write f (x) as the following power series, called the Taylor
series of f (x) at x = a:
f 00 (a) f 000 (a) f 0000 (a)
f (x) = f (a)+f 0 (a) (x−a)+ (x−a)2 + (x−a)3 + (x−a)4 +· · · ,
2! 3! 4!
valid for x within a radius of convergence |x−a| < R with R > 0, or
convergent for all x.
If we write the nth derivative of f (x) as f (n) (x), this becomes:
∞
X f (n) (a)
f (x) = cn (x−a)n with coefficients cn = .
n!
n=0
Note that T1 (x) = f (a) + f 0 (a)(x − a) is just the linear approximation near x = a,
whose graph is the tangent line (Calculus I §2.9). We can improve this approximation
of f (x) in two ways:
• Take the center a close to x, giving small (x−a) and tiny (x−a)n .
Example: sine function. To find Taylor series for a function f (x), we must de-
termine f (n) (a). This is easiest for a function which satisfies a simple differential
equation relating the derivatives to the original function. For example, f (x) = sin(x)
satisfies f 00 (x) = −f (x), so coefficients of the Maclaurin series (center a = 0) are:
n 0 1 2 3 4 5 6 7
f (n) (x) sin(x) cos(x) − sin(x) − cos(x) sin(x) cos(x) − sin(x) − cos(x)
f (n) (0) 0 1 0 −1 0 1 0 −1
f (n) (0)
cn = n! 0 1 0 − 3!1 0 1
5! 0 − 7!1
That is:
∞
x3 x5 x7 X x2n+1
sin(x) = x − + − + ··· = (−1)n .
3! 5! 7! (2n+1)!
n=0
for any fixed x 6= 0. Since L = 0 < 1 regardless of x, the series converges for all x.
This formula for sin(x) astonishes because the right side is a simple algebraic series
having no apparent relation to trigonometry. We can try to understand and check the
series by graphically comparing sin(x) with its Taylor polynomial approximations:
• The Taylor polynomial T1 (x) = x (in red) is just the linear approximation or
tangent line of y = sin(x) at the center point x = 0. The curve and line are
close (to within a couple of decimal places) near the point of tangency and up
to about |x| ≤ 0.5. Once they veer apart, the approximation is useless.
3
• The next Taylor polynomial T3 (x) = x − x3! = x − 16 x3 (in green) matches
y = sin(x) in its first three derivatives at x = 0, and stays close to the original
curve up to about |x| ≤ 1.5 .
3 5
• The next T5 (x) = x − x3! + x5! = x − 16 x3 + 120
1 5
x is even closer to f (x) for even
larger x. Taking enough terms in the Taylor series will give a good approxima-
tion for any x, since the series converges everywhere.
It turns out this is correct to 5 decimal places (underlined), using only two non-zero
terms of the Taylor series and a good estimate for π. We could verify this by taking
more terms and seeing that these 5 digits do not change, or by applying the Lagrange
Remainder estimates in §11.11.
√
Example:
√ square roots. Compute 2 to 5 decimal places.† First, we must consider
√
2 to be an output of the function f (x) = x at x = 2. Next, we must choose the
center a for its Taylor series.
√
• a = 0 does not give a series because x is not analytic at x = 0. Indeed, if
√ 2
√ Taylor series x = c0 + c1 x + c22x + · · · , we could plug
there were a convergent
in x = −0.1 to get: −0.1 = c0 + c1 (−0.1) + c2 (−0.1) + · · · , a real value for
the square root of a negative number!
• a = 1 is too far from x = 2: it turns out |x−a| = |2−1| = 1 is beyond the radius
of convergence of the Taylor series.
• A useful choice of a requires: a > 0 so that the Taylor series exists; a is close
√
to x = 2, making |x−a| small so the series converges quickly; and f (a) = a
is easy to compute so we can find the coefficients. A value satisfying all three
conditions is: a = 94 .
Now we have:
n 0 1 2 3 4
f (n) (x) x1/2 1
2 x−1/2 − 1·1
2·2 x
−3/2 1·1·3
2·2·2 x−5/2 − 2·2·2·2
1·1·3·5 −7/2
x
f (n) ( 94 ) 3
2
1
3
2
− 27 4
81
40
− 729
f (n) ( 94 ) 3 1 1 2 5
cn = n! 2 3 − 27 243 − 2187
Hence:
√ 3 9 2 9 3 9 4
x = 2 + 13 (x− 49 ) − 1
27 (x− 4 ) + 2
243 (x− 4 ) − 5
2187 (x− 4 ) + ···
∞
2n−1
(−1)n−1 (2n−3)!!
X
= 3
2 + 13 (x− 94 ) + n! 32n−1
(x− 49 )n ,
n=2
where we use the odd-factorial notation (2n−3)!! = (1)(3)(5) · · · (2n−3). For x = 2,
we have x− 49 = − 14 , so:
√
2 = 23 + 13 (− 14 ) − 27
1
(− 14 )2 + 243
2
(− 41 )3 − 2187
5
(− 14 )4 + · · ·
3 1 1 1 1 2 1 5 1
≈ 2 − 3 4 − 27 42 − 243 43 − 2187 44 ≈ 1.4142143 ,
1
We multiply by b! to clear denominators up to the b! term:
b! b! b! a
b! + + + · · · + + b!Rb = b! e = b! = (b−1)! a .
1! 2! b! b
b! b!
The terms b! , 1! , 2! , . . . , b!
b! on the left are whole numbers, and (b−1)! a on the right is
a whole number, so the remainder b!Rb must also be a whole number. But it must
also be very small, as we can see from a simple geometric series comparison:‡
∞
P b! 1 1 1
b!Rb = n! = b+1 + (b+1)(b+2) + (b+1)(b+2)(b+3) + ···
n=b+1
1 1 1
< b+1 + (b+1)2
+ (b+1)3
+ ···
1 1 1 b+1 1
= b+1 1−( 1 ) = b+1 b+1−1 = b < 1.
b+1
Thus, we have constructed a positive number b!Rb which is both a whole number and
less than 1, which is impossible. Therefore the original assumption e = a/b must also
be impossible.
‡
Here we do not need the powerful Lagrange remainder formula from §11.11.