You are on page 1of 6

Calculus 3

Lia Vas

Taylor Series and Polynomials


Taylor polynomial. Recall that the line which approximates a function f (x) at a point (a, f (a))
has the slope f 0 (a). By point-slope equation, the equation of this line is

y −f (a) = f 0 (a)(x−a) ⇒ y = f (a)+f 0 (a)(x−a).

The expression f (a)+f 0 (a)(x−a) is the linear


approximation of f (x) at x = a.

f (x) ≈ f (a) + f 0 (a)(x − a)

Note that the function value and the value of


the first derivative is the same for a function
and its linear approximation.

In applications, you can think of the value f (a) as of the present value, the value f (x) then
represents the future value, (x − a) the time lapsed and f 0 (a) the change rate. Thus

f (x) ≈ f (a) + f 0 (a) (x − a)


future ≈ present + change time
value value rate elapsed

Assume now that we want to increase the accuracy of the approximation by approximating the
function with a parabola y = a2 (x − a)2 + a1 (x − a) + a0 in such a way that the function value and
the value of the first and the second derivatives are the same for f (x) and parabola y when
x = a. The condition f (a) = y(a) implies that a0 = f (a). The condition that f 0 (a) = y 0 (a) implies
that f 0 (a) = 2a2 (x − a) + a1 |x=a = 0 + a1 so that a1 = f 0 (a).

The condition f 00 (a) = y 00 (a) implies that


00
f 00 (a) = 2a2 ⇒ a2 = f 2(a) .
This produces the formula for polynomial of
second degree that approximates the function
f (x) at x = a.

f 00 (a)
f (x) ≈ f (a) + f 0 (a)(x − a) + 2
(x − a)2

1
Similarly, if we are to approximate the formula of a polynomial of third degree y = a3 (x − a)3 +
a2 (x − a)2 + a1 (x − a) + a0 which approximates function f (x) at x = a, we obtain that a0 = f (a),
00 000
a1 = f 0 (a), a2 = f 2(a) , and, equating f 000 (a) with y 000 (a) ⇒ f 000 (a) = 2 · 3a3 = 6a3 so that a3 = f 6(a) .
0 00
Note that the values in the denominators of the expressions a0 = f (a) = f (a) 1
, a1 = f 1(a) , a2 = f 2(a) ,
000
and a3 = f 6(a) , match the values of the factoriel function of 0, 1, 2 and 3. Recall that the product
1 · 2 · . . . n is written shortly as n! and is called the factoriel of n. Thus 1! = 1, 2! = 1 · 2 = 2,
3! = 1 · 2 · 3 = 6, 4! = 1 · 2 · 3 · 4 = 24, 5! = 1 · 2 · 3 · 4 · 5 = 120 and so on. 0! is defined to be 1.
Continuing in this way, we obtain the formula for approximating f (x) with a polynomial of n-th
degree to be
n
0 f 00 (a) 2 f 000 (a) 3 f (n) (a) n f (i) (a)
(x−a)i
X
f (x) ≈ f (a)+f (a)(x−a)+ (x−a) + (x−a) +. . .+ (x−a) =
2! 3! n! i=0 i!

The polynomial on the right is called the Taylor polynomial of f (x) at x = a of order n. The
Taylor polynomial centered at 0 is sometimes called Maclaurin polynomial.
Approximating a function using its Taylor polynomial is particularly useful when certain phe-
nomena is modeled by a function which is either
• too complex to be manipulated or

• such that its exact formulas is not known.


but its value and the value of its derivatives are known at a point. Calculators and software appli-
cations (including Matlab for example) manipulate many functions using their Taylor polynomials.
Taylor Series. If a function f (x) can be expressed as a power series f (x) = ∞ n=0 an (x − a)
n
P

centered at a, continuing the process of equating value of the derivatives of function and the power
(n)
series at x = a as above, we obtain that an = f n!(a) . Thus,

f (n) (a)
(x − a)n
X
f (x) =
n=0 n!

This series is called the Taylor series for f (x) centered at a. The sum of the first n + 1 terms of
the Taylor series is the Taylor polynomial of n-th degree at x = a.
Differentiation and Integration of Power Series. For the x-values in the interval of con-
vergence of the power series ∞ n
n=1 an (x − a) , you can differentiate and integrate the series by
P

differentiating and integrating each term.


∞ ∞
!
d X n
an n(x − a)n−1
X
an (x − a) =
dx n=1 n=1

∞ ∞
(x − a)n+1
Z x !
n
X X
an (x − a) dx = an
a n=1 n=1 n+1

Using this fact, the power series can also be used for evaluating integrals which cannot be expressed
in terms of elementary functions (i.e. functions whoseR antiderivatives are not elementary functions).
R 2 x
Examples of such integrals include ex dx, sinx x dx, ex dx etc.
R

2
Example. Find the power series expansion centered at 0 for ex . Use the Taylor polynomial of
degree 4 to approximate the value of e with a fraction. Compare with the calculator answer.
If f (x) = ex , then f 0 = f 00 = f 000 = . . . = ex . The value of f and its derivatives at 0 is 1 and so
x2 x3
ex = ∞ 1 n
P
n=0 n! x = 1 + x + 2 + 6 + . . . .
2 3 4
The Taylor polynomial of degree 4 is p4 (x) = 1 + x + x2 + x6 + x24 . The x-value 1 corresponds to
2 3 14
the y-value e of ex . So, ex is can be approximated by p4 (1) = 1 + 1 + 12 + 16 + 24 = 48+12+4+1
24
= 65
24
.
65
Note that e = 2.718... and that 24 = 2.708... So, using the polynomial approximation of just degree
4, the approximation of e has the first two digits matching the exact value.

Practice Problems.

1. Find the power series expansion of the following functions centered at given point.

(a) x2 − 2x + 1; x=0 (b) x2 − 2x + 1; x=1 (c) ex ; x=1

1
(d) e2x ; x=0 (e) xe2x ; x=0 (f) 1−x
; x=0

1 1 x
(g) 1−x2
; x=0 (h) 1+x
; x=0 (i) 1+x2
; x=0

(j) sin x; x=0 (k) sin 3x; x=0 (l) cos x; x=0

2. Find the power series expansion of the following functions centered at given point.
1
(a) (1−x)2
; x=0 (b) ln(1 − x); x=0

3. Evaluate the following integrals as infinite series.


R x x2 R x sin x
(a) 0 e dx (b) 0 x
dx

4. Find the Taylor polynomial of the given degree n centered at given point a for function f (x).

(a) f (x) = ex ; a = 0; n = 4. Use to approximate e with a rational number.


(b) f (x) = ex ; a = 1; n = 4.
(c) f (x) = sin x; a = 0; n = 4. Use to approximate sin(.2) with a rational number.
(d) f (x) = ex sin x; a = 0; n = 3. Use to approximate e1/2 sin 21 with a rational number.

5. (a) If f (2) = 5, f 0 (2) = 3 and f 00 (2) = 1, approximate f (2.1).


(b) If f (2) = 5, f 0 (2) = 3, f 00 (2) = 1, and f 000 (x) = 1
2
for all x, approximate f (1.9).
(c) If f (1) = f 0 (1) = −1, f 00 (1) = f 000 (1) = 0 and f (1) = 2, approximate f (1.01).
iv

hv
6. (“PChem problem”) Approximate the function e kT − 1 by its Taylor polynomial of the second
degree in terms of v.

3
7. (“ Physics problem”) The magnitude of the electric field E of a single charge q can be described
by E = kq
r2
where r is the distance between the field and the charge and k is a proportionality
constant. If two opposite charges on distance d from each other create an electric dipole
moment, this formula changes to
kq kq kq kq
E= − = 2 d 2 − 2
(r − d)2 (r + d)2 r (1 − r ) r (1 + dr )2
1
Use the Taylor polynomial of the second degree of the function f (x) = (1−x)2 (see problem 2

(a)) to show that the magnitude of the electric field E can be approximated as

4kqd
E≈
r3
d
This approximation is accurate if r is much larger than d so that the quotient r
is small.

Solutions.

1. (a) Let f (x) = x2 −2x+1. Then f (0) = 1, f 0 (0) = −2 and f 00 (0) = 2. All the other derivatives
are 0. So, the Taylor series is 1 − 2x + 22 x2 + 0 + 0 + . . . = 1 − 2x + x2 . Note that this is
the same polynomial as f (x).
This answer should not be surprising. In fact, any polynomial is equal to its Taylor series
expansion centered at 0.
(b) Let f (x) = x2 − 2x + 1. Then f (1) = 0 = f 0 (1) and f 00 (1) = 2. So, the Taylor series
expansion centered at 1 is 0 + 0 + 22 (x − 1)2 + 0 + 0 + . . . = (x − 1)2 . Note that (x − 1)2
foils as x2 − 2x + 1.
P∞ e
(c) Let f (x) = ex . Then f (n) (x) = ex for any n and f (n) (1) = e. So, ex = n=0 n! (x − 1)n =
(x−1)n
e ∞
P
n=0 n!
.
n
(d) Use that ex = ∞ x 2x
P
n=0 n! . To get the expansion for e , substitute x with 2x in the expansion
(2x)n P∞ 2n xn
of ex . Thus e2x = ∞
P
n=0 n! = n=0 n! .

(e) To get the expansion for xe2x , multiply the expansion for e2x from the previous problem
2n xn P∞ 2n xn+1
by x. So, xe2x = x ∞
P
n=0 n! = n=0 n!
.
1
(f) Let f (x) = 1−x . Then f 0 = (1−x)
1
2, f
00 2
= (1−x) 3, f
000 2·3
= (1−x) 4 , ... f
(n) 1·2·3·...·n
= (1−x) n+1 =
n!
(1−x)n+1
.
(n) 1 P ∞ n! n P ∞ n
So f (0) = n! and hence the expansion is 1−x = n=0 n! x = n=0 x .
P∞ 1
Alternatively, note that the formula for the sum of geometric series n=0 rn = 1−r
gives
the same answer if you put x for r.
1 1 1
(g) To get the expansion for 1−x2
, substitute x2 for x in the expansion for 1−x
. So, 1−x2
=
P∞ 2 n P∞ 2n
n=0 (x ) = n=0 x .
1 1 1
(h) To get the expansion for 1+x , substitute −x for x in the expansion for 1−x
. So, 1+x
=
P∞ n P∞ n n
n=0 (−x) = n=0 (−1) x .
x 2 1
(i) To get the expansion for 1+x 2 , substitute x for x in the expansion for 1+x
and multiply
x P∞ n 2 n P ∞ n 2n+1
it by x So, 1+x 2 = x n=0 (−1) (x ) = n=0 (−1) x .

4
(j) Note that f (x) = sin x ⇒ f 0 (x) = cos x ⇒ f 00 (x) = − sin x ⇒ f 000 (x) = − cos x ⇒
f (4) (x) = sin x ⇒ f (5) (x) = cos x and the cycle continues. The values at 0 are: 0, 1, 0,
−1, 0 ,1 . . . So, all the terms with even power of x have zero coefficient. The expansion is
3 5 7 (−1)n x2n+1
sin x = x − x3! + x5! − x7! + . . . = ∞
P
n=0 (2n+1)! .

(k) To get the expansion for sin 3x, substitute 3x for x in the expansion of sin x. Hence
3 3 5 5 7 7 (−1)n 32n+1 x2n+1
sin 3x = 3x − 3 3!x + 3 5!x − 3 7!x + . . . = ∞
P
n=0 (2n+1)!
.
(l) Similar to finding expansion for sin x. In this case, all the terms with odd power of x have
2 4 6 (−1)n x2n
zero coefficient. The expansion is cos x = 1 − x2! + x4! − x6! + . . . = ∞
P
n=0 (2n)!
.
1 1 0
2. (a) Let f (x) = (1−x) 2 . Note that f (x) is the derivative of function g(x) = 1−x (since g (x) =

(−1)(1 − x)−2 (−1) = (1−x) 1


2 = f (x)) for which we already have the power series expansion. So,

instead of finding the expansion of f using the formula for Taylor series, it is more efficient
1 1
= ∞ n 0
n=0 x ⇒ f (x) = g (x) =
P
to differentiate the series for g(x) = 1−x . So, g(x) = 1−x
d
( ∞ n ∞ n−1
P P
dx n=0 x ) = n=0 nx .
−1 P∞ Rx P∞
(b) Let f (x) = ln(1 − x). Then f 0 (x) = 1−x
= − n=0 xn ⇒ f (x) = 0 (− n=0 xn ) dx =
Rx n P∞ xn+1
− ∞ n=0 0 x dx = −
P
n=0 n+1 .

2 2 P∞ x2n
3. (a) Find the power series expansion of ex using the expansion of ex first. ex = n=0 n! . Then
2 x2n+1
integrate the power series to get 0x ex dx = ∞
R P
n=0 n!(2n+1) .
sin x
(b) Divide the expansion for sin x by x to obtain the expansion for x
and then integrate
R x
R x sin x R x P∞ (−1)n x2n P∞ (−1)n x2n dx P∞ (−1)n x2n+1
term by term. So, 0 x
dx = 0 n=0 (2n+1)! dx = n=0
0
(2n+1)!
= n=0 (2n+1)!(2n+1) =
x3 x5 x7
x− 3·3!
+ 5·5!
− 7·7!
+ ...
2 3 4
4. (a) The Taylor polynomial is ex ≈ 1 + x + x2 + x6 + x24 . Then substitute 1 for x to approximate
e = e1 . Obtain 1 + 1 + 21 + 16 + 24
1
= 24+24+12+4+1
24
65
= 24 = 2.7083. Comparing with the calculator
answer e ≈ 2.7183, you can see that just first five terms compute the first two digits correctly.
(b) ex ≈ e + e(x − 1) + 2e (x − 1)2 + 6e (x − 1)3 + e
24
(x − 1)4
3
(c) The Taylor polynomial is sin x ≈ x − x6 Substitute 0.2 = 15 for x to approximate sin 15 .
1
Obtain 15 − 750 = 149
750
≈ .198666... Comparing with the calculator answer sin 51 ≈ .198669, you
can see that the first five decimals are correct.
(d) Let f (x) = ex sin x. Find the first three derivatives f 0 (x) = ex sin x + ex cos x ⇒ f 00 (x) =
ex sin x + ex cos x + ex cos x − ex sin x = 2ex cos x ⇒ f 000 (x) = 2ex cos x − 2ex sin x. Plug 0 and get
3
f (0) = 0, f 0 (0) = 1, f 00 (0) = 2 and f 000 (0) = 2. Thus ex sin x ≈ 0 + 1x + 22 x2 + 26 x3 = x + x2 + x3 .
To approximate e1/2 sin 21 substitute 12 for x in the Taylor polynomial. Obtain 1
2
+ 1
4
+ 1
24
=
19
24
≈ .7917. Compare with the calculator answer e1/2 sin 12 ≈ .7904.

5. (a) Let x = 2.1 and a = 2. The Taylor polynomial of degree 2 gives you f (2.1) ≈ f (2) +
00
f 0 (2)(2.1 − 2) + f 2(2) (2.1 − 2)2 = 5 + 3(.1) + 12 (.1)2 = 5.305.
00 (2) 000 (2)
(b) Let x = 1.9 and a = 2. Then f (1.9) ≈ f (2)+f 0 (2)(1.9−2)+ f 2
(1.9−2)2 + f 6
(1.9−2)3 =
5 + 3(−.1) + 12 (−.1)2 + 12
1
(−.1)3 = 4.705.

5
00 (1) 000 (1)
(c) Let x = 1.01 and a = 1. Then f (1.01) ≈ f (1)+f 0 (1)(1.01−1)+ f 2
(1.01−1)2 + f 6
(1.01−
f (4) (1) 2
1)3 + 24
(1.01 − 1)4 = −1 − 1(.01) + 24
(.01)4 = −1.00999 ≈ −1.01.

6. The problem is asking you to find the second order Taylor polynomial centered at v = 0. Let
hv hv 2 hv
f (v) = e kT − 1. Then f 0 (v) = kT e and f 00 (v) = k2hT 2 e kT . Thus f (0) = 1 − 1 = 0, f 0 (0) = kT
h kT h
,
2 2 v2 hv(2kT +hv)
and f 00 (0) = k2 T 2 . So f (v) ≈ kT + 2k2 T 2 = 2k2 T 2 .
h hv h

1 ∞ n−1 P
7. Recall that in problem 2 (a) we determined that (1−x)2 = n=0 nx so the second degree
1 2 1
approximation is (1−x)2 ≈ 1 + 2x + 3x . Substituting x with −x we obtain that (1+x) 2 =
1 2 2 d
(1−(−x)2
≈ 1 + 2(−x) + 3(−x) = 1 − 2x + 3x . By taking r to be x, we obtain that E =
 2
 2
  2 2

kq
r2 (1− dr )2
− 2 kq d 2 ≈ kq
r2
1 + 2 dr + 3 dr2 − 1 − 2 dr + 3 dr2 = kq
r2
1 + 2 dr + 3 dr2 − 1 + 2 dr − 3 dr2 =
  r (1+ r )
kq
r2
4 dr = 4kqd
r3
.

You might also like