Maclaurin Series

Section 9.7 and 9.10: Taylor
Polynomials and
Approximations/Taylor and
Maclaurin Series
Power Series for Functions
We can create a Power Series (or polynomial series) that
can approximate a function around a certain value of the
function.
In order to approximate the function, we force the series
to match the function at its value through many
derivatives.
π‘₯2
2
Example: 𝑇2 (π‘₯) = 1 + π‘₯ + approximates 𝑓 π‘₯ = 𝑒 π‘₯ at
π‘₯ = 0 because
𝑓 0 = 𝑇2 0 = 1
𝑓′ 0 = 𝑇2 β€²(0) = 1
𝑓′′ 0 = 𝑇2 β€²β€²(0) = 1
Taylor Series Generated by f at x=0
Also known as a Maclaurin Series
generated by 𝑓.
Let 𝑓 be a function with derivatives of all orders throughout
some open interval containing 0. Then the Taylor series
generated by 𝒇 at 𝒙 = 𝟎 is:
β€²β€² 0
𝑛 0
𝑓
𝑓
𝑓 0 + 𝑓′ 0 βˆ™ π‘₯ +
π‘₯2 + β‹― +
π‘₯𝑛 + β‹―
2!
𝑛!
∞
𝑓 π‘˜ (0) π‘˜
π‘₯
π‘˜!
π‘˜=0
Verifying the Maclaurin Series
Justify that the Taylor Series centered at π‘₯ = 0 matches any
function at its value through all of its derivatives at π‘₯ = 0.
β€²β€² 0
β€²β€²β€² 0
𝑛 0
𝑓
𝑓
𝑓
𝑓 0 + 𝑓′ 0 βˆ™ π‘₯ +
π‘₯2 +
π‘₯3 + β‹― +
π‘₯𝑛 + β‹―
2!
3!
𝑛!
β€²β€² 0
β€²β€²β€² 0
𝑛 0
𝑓
𝑓
𝑓
02 +
03 + β‹― +
0𝑛 + β‹―
If π‘₯ = 0, does 𝑓 0 + 𝑓 β€² 0 βˆ™ 0 +
2!
3!
𝑛!
the series
equal 𝑓(0)?
If π‘₯ = 0, does
the
derivative of
the series
equal 𝑓′(0)?
= 𝑓 0 Yes!
β€²
Derivative: 0 + 𝑓 0 + 𝑓
β€²β€²
0 π‘₯
𝑓′′′ 0
+
2!
𝑓 β€²β€²β€² 0
π‘₯ = 0: 0 + 𝑓 β€² 0 + 𝑓 β€²β€² 0 βˆ™ 0 + +
= 𝑓′ 0
Yes!
2!
2
π‘₯ +
𝑓𝑛 0
β‹―+
(π‘›βˆ’1)!
𝑓𝑛 0
02 … +
𝑛 βˆ’ 1!
π‘₯ π‘›βˆ’1 + β‹―
0π‘›βˆ’1 + β‹―
Verifying the Maclaurin Series
Justify that the Taylor Series centered at π‘₯ = 0 matches any
function at its value through all of its derivatives at π‘₯ = 0.
β€²β€² 0
β€²β€²β€² 0
𝑛 0
𝑓
𝑓
𝑓
𝑓 0 + 𝑓′ 0 βˆ™ π‘₯ +
π‘₯2 +
π‘₯3 + β‹― +
π‘₯𝑛 + β‹―
2!
3!
𝑛!
If π‘₯ = 0, does
the second
derivative of
the series
equal
𝑓′′(0)?
2nd
Deriv: 0 + 0 +
𝑓 β€²β€²
0 +
𝑓 β€²β€²β€²
0 π‘₯+
𝑓𝑛 0
β‹―+
(π‘›βˆ’2)!
𝑓𝑛 0
π‘₯ = 0: 0 + 0 + 𝑓 β€²β€² 0 + 𝑓 β€²β€²β€² 0 βˆ™ 0 + β‹― +
(𝑛 βˆ’ 2)!
π‘₯ π‘›βˆ’2 + β‹―
0π‘›βˆ’2 + β‹―
= 𝑓′′ 0 Yes!
This pattern will continue. If π‘₯ = 0, then the nth derivative of the
series will equal 𝑓 𝑛 0 . The Taylor Series meets the defined
requirements.
Taylor Series v Taylor Polynomial
Taylor Polynomial: Have a finite number of terms
and are approximations of the function around a
value of π‘₯.
β€²β€² 0
𝑛 0
𝑓
𝑓
𝑓 0 + 𝑓′ 0 βˆ™ π‘₯ +
π‘₯2 + β‹― +
π‘₯𝑛
2!
𝑛!
Taylor Series: Have a infinite number of terms and
are equivalent to the function for values of π‘₯.
β€²β€²
𝑛
𝑓
0
𝑓
0 𝑛
β€²
2
𝑓 0 +𝑓 0 βˆ™π‘₯+
π‘₯ + β‹―+
π‘₯ +β‹―
2!
𝑛!
Maclaurin Series to Memorize
1
1βˆ’π‘₯
∞
𝑛
𝑛=0 π‘₯
= 1 + π‘₯ + π‘₯2 + π‘₯3 + β‹― + π‘₯𝑛 + β‹― =
π‘₯
𝑒 =1+π‘₯+
π‘₯2
2!
+
π‘₯3
3!
+β‹―+
π‘₯𝑛
𝑛!
for π‘₯ < 1
𝑛
∞ π‘₯
𝑛=0 𝑛!
+β‹―=
for π‘₯ < 1
Odd degree powers and sin π‘₯ is an odd function
sin π‘₯ = π‘₯ βˆ’
π‘₯3
3!
+
π‘₯5
5!
βˆ’ β‹― + βˆ’1
2𝑛+1
𝑛 π‘₯
+
2𝑛+1 !
β‹―=
∞
𝑛=0
βˆ’1
2𝑛+1
𝑛 π‘₯
2𝑛+1 !
Starts at 0 because sin 0 = 0
for all
real π‘₯
Even degree powers and cos π‘₯ is an even function
cos π‘₯ = 1 βˆ’
π‘₯2
2!
+
π‘₯4
4!
βˆ’ β‹― + βˆ’1
Starts at 1 because cos 0 = 1
2𝑛
𝑛 π‘₯
+
2𝑛 !
β‹―=
∞
𝑛=0
βˆ’1
2𝑛
𝑛 π‘₯
2𝑛 !
for all
real π‘₯
We will discuss the interval of convergence later.
Example 1
Suppose 𝑔 is a function with derivatives of all orders for
real numbers. Assume 𝑔 0 = βˆ’4, 𝑔′ 0 = 2, 𝑔′′ 0 = 6,
and 𝑔′′′ 0 = βˆ’8. Write the second-degree the Taylor
polynomial for g at π‘₯ = 0, and use it to approximate 𝑔(0.5).
Notice the degree required.
Substitute π‘₯ = 0.5 into the polynomial to
approximate the function 𝑔:
Use the Formula for a second-degree
polynomial:
2
βˆ’4
+
2
βˆ™
0.5
+
3
βˆ™
0.5
β€²β€² 0
𝑔
β€²
2
𝑔 0 +𝑔 0 βˆ™π‘₯+
2!
6 2
βˆ’4 + 2 βˆ™ π‘₯ + π‘₯
2!
βˆ’4 + 2π‘₯ + 3π‘₯ 2
π‘₯
βˆ’2.25
Example 2
Find the Taylor series for 𝑓 π‘₯ = (1 + π‘₯)3 at π‘₯ = 0.
Find the function and derivatives of 𝑓(π‘₯):
Find the value of the function and
each derivative if π‘₯ = 0:
𝑓 π‘₯ = (1 + π‘₯)3
𝑓 0 =1
𝑓′ π‘₯ = 3(1 + π‘₯)2
𝑓′ 0 = 3
1
𝑓′′ π‘₯ = 6(1 + π‘₯)
𝑓′′′ π‘₯ = 6
All future
derivatives
will be zero.
𝑓 (4) π‘₯ = 0
𝑓′′ 0 = 6
𝑓′′′ 0 = 6
𝑓′′′ 0 = 0
Substitute into the formula:
6 2 6 3
1 + 3 βˆ™ π‘₯ + π‘₯ + π‘₯ = 1 + 3π‘₯ + 3π‘₯ 2 + π‘₯ 3
2!
3!
Notice: A Taylor series for a polynomial function IS the polynomial function in
standard form.
Example 3
Find the Maclaurin series for 𝑓 π‘₯ = π‘₯ 2 𝑒 π‘₯ .
Find the function and derivatives of 𝑓(π‘₯):
𝑓 π‘₯ = π‘₯2𝑒 π‘₯
𝑓 β€² (π‘₯) = π‘₯ 2 𝑒 π‘₯ + 2π‘₯𝑒 π‘₯
𝑓 β€²β€² (π‘₯) = π‘₯ 2 𝑒 π‘₯ + 4π‘₯𝑒 π‘₯ + 2𝑒 π‘₯
𝑓′′′ π‘₯ = π‘₯ 2 𝑒 π‘₯ + 6π‘₯𝑒 π‘₯ + 6𝑒 π‘₯
𝑓 (4) (π‘₯) = π‘₯ 2 𝑒 π‘₯ + 8π‘₯𝑒 π‘₯ + 12𝑒 π‘₯
𝑓 (5) (π‘₯) = π‘₯ 2 𝑒 π‘₯ + 10π‘₯𝑒 π‘₯ + 20𝑒 π‘₯
𝑓
6
(π‘₯) = π‘₯ 2 𝑒 π‘₯ + 12π‘₯𝑒 π‘₯ + 30𝑒 π‘₯
Substitute into the formula:
Find the value of the function and
each derivative if π‘₯ = 0:
Not
enough
terms to
see a
pattern.
𝑓 0 =0
𝑓′ 0 = 0
𝑓′′ 0 = 2
𝑓′′′ 0 = 6
𝑓 (4) (0) = 12
𝑓 (5) (0) = 20
𝑓
6
(0) = 30
4
5
𝑛+2
π‘₯
π‘₯
2 2 6 3 12 3 20 4 30 5
π‘₯
+
+ β‹―+
0 + 0 βˆ™ π‘₯ + π‘₯ + π‘₯ + π‘₯ + π‘₯ + π‘₯ + β‹― = π‘₯2 + π‘₯3 +
+β‹―
2! 3!
2!
3!
4!
5!
6!
𝑛!
There are several method for
generating new Taylor Series
from known ones: integrate term
by term, differentiate term by
term, using algebra, or using
substitution.
Example 3: Method 2
Find the Maclaurin series for 𝑓 π‘₯ = π‘₯ 2 𝑒 π‘₯ .
We know the Maclaurin
series for 𝑒 π‘₯ :
We know the Maclaurin
series for π‘₯ 2 :
1+π‘₯+
π‘₯2
2!
+
π‘₯3
3!
+ β‹―+
π‘₯𝑛
𝑛!
∞
+β‹―=
𝑛=0
π‘₯𝑛
𝑛!
π‘₯2
Multiply the Maclaurin series for 𝑒 π‘₯ by the Maclaurin series for π‘₯ 2 :
2
3
𝑛
π‘₯
π‘₯
π‘₯
π‘₯ 2 (1 + π‘₯ + + + β‹― +
+β‹―)
2! 3!
𝑛!
4
5
𝑛+2
π‘₯
π‘₯
π‘₯
2
3
π‘₯ + π‘₯ + + + β‹―+
+β‹―=
2! 3!
𝑛!
∞
𝑛=0
π‘₯ 𝑛+2
𝑛!
Example 4
Find the Maclaurin series for 𝑓 π‘₯ =
Find the function and derivatives of 𝑓(π‘₯):
𝑓 π‘₯ =
𝑓 β€² (π‘₯)
𝑓′′ π‘₯ =
𝑓 β€²β€²β€² (π‘₯)
=
=
2
βˆ’π‘₯
𝑒
2
3
βˆ’π‘₯
βˆ’8π‘₯ 𝑒
2
βˆ’π‘₯
βˆ’ 2𝑒
+
2
2
βˆ’π‘₯
12π‘₯𝑒
2
𝑓 (4) (π‘₯) = 16π‘₯ 4 𝑒 βˆ’π‘₯ βˆ’ 48π‘₯ 2 𝑒 βˆ’π‘₯ + 12𝑒 βˆ’π‘₯
2
Find the value of the function and
each derivative if π‘₯ = 0:
𝑓 0 =1
Not
enough 𝑓′ 0 = 0
terms to
see a 𝑓 β€²β€² 0 = βˆ’2
pattern.
2
βˆ’π‘₯
βˆ’2π‘₯𝑒
2
2
βˆ’π‘₯
4π‘₯ 𝑒
2
5
π‘₯ = βˆ’32π‘₯ 5 𝑒 βˆ’π‘₯ + 160π‘₯ 3 𝑒 βˆ’π‘₯ βˆ’ 120π‘₯𝑒 βˆ’π‘₯
𝑓
6
π‘₯ = 64π‘₯ 6 𝑒 βˆ’π‘₯ βˆ’ 480π‘₯ 4 𝑒 βˆ’π‘₯ + 720π‘₯ 2 𝑒 βˆ’π‘₯ βˆ’ 120𝑒 βˆ’π‘₯
2
1+0βˆ™π‘₯+
Substitute into
the formula:
2
βˆ’2 2
π‘₯
2!
+
0 3
π‘₯
3!
𝑓′′′ 0 = 0
𝑓 (4) 0 = 12
𝑓 (5) 0 = 0
𝑓 (6) 0 = βˆ’120
2
𝑓
2
2
βˆ’π‘₯
𝑒 .
+
2
2
12 4
π‘₯
4!
+
4
6
π‘₯
π‘₯
1 βˆ’ π‘₯2 + βˆ’ + β‹― +
2! 3!
0 5
π‘₯
5!
+
βˆ’120 6
π‘₯
6!
+β‹―
(βˆ’1)𝑛 π‘₯ 2𝑛
+β‹―=
𝑛!
∞
𝑛=0
(βˆ’1)𝑛 π‘₯ 2𝑛
𝑛!
There are several method for
generating new Taylor Series
from known ones: integrate term
by term, differentiate term by
term, using algebra, or using
substitution.
Example 4: Method 2
Find the Maclaurin series for 𝑓 π‘₯ =
2
βˆ’π‘₯
𝑒 .
We know the Maclaurin series for 𝑒 π‘₯ :
2
3
𝑛
π‘₯
π‘₯
π‘₯
1 + π‘₯ + + + β‹―+
+β‹―=
2! 3!
𝑛!
∞
𝑛=0
π‘₯𝑛
𝑛!
Substitute βˆ’π‘₯ 2 for π‘₯ in the Maclaurin series for 𝑒 π‘₯ :
2 2
2 3
2 𝑛
(βˆ’π‘₯
)
(βˆ’π‘₯
)
(βˆ’π‘₯
)
2
1 + (βˆ’π‘₯ ) +
+
+ β‹―+
+β‹―
2!
3!
𝑛!
1 βˆ’ π‘₯2 +
π‘₯4
2!
βˆ’
π‘₯6
3!
∞
𝑛 2𝑛
+ β‹―+
(βˆ’1) π‘₯
𝑛!
+β‹―=
𝑛=0
(βˆ’1)𝑛 π‘₯ 2𝑛
𝑛!
Finding ANY Taylor Series
It should be possible to approximate functions around values other than
π‘₯ = 0. How should we change the Maclaurin Series to make a Taylor
Series centered at any π‘₯ = π‘Ž? Remember it must still match the function
at its value through all of its derivatives at π‘₯ = π‘Ž.
Change
Change the 0 to an π‘Ž:
β€²β€²
𝑛
𝑓
π‘Ž
𝑓
π‘Ž 𝑛
β€²
2
𝑓 π‘Ž +𝑓 π‘Ž βˆ™π‘₯+
π‘₯ + β‹―+
π‘₯ +β‹―
2!
𝑛!
the π‘₯ to
π‘₯ βˆ’ π‘Ž.
β€²β€²β€² π‘Ž
𝑛 π‘Ž
If π‘₯ = π‘Ž,
𝑓
𝑓
β€²
β€²β€²
2
π‘›βˆ’1 + β‹―
β‰  𝑓′ π‘Ž
does the 0 + 𝑓 π‘Ž + 𝑓 π‘Ž βˆ™ π‘Ž + + 2! π‘Ž … + 𝑛 βˆ’ 1! π‘Ž
series equal
No…
𝑓(π‘Ž)?
After substituting π‘Ž for π‘₯, we need these values
to be 0 in order for the sum to equal 𝑓′(π‘Ž).
β€²β€² π‘Ž
𝑛 π‘Ž
𝑓
𝑓
𝑓 π‘Ž + 𝑓 β€² π‘Ž βˆ™ (π‘₯ βˆ’ π‘Ž) +
(π‘₯ βˆ’ π‘Ž)2 + β‹― +
(π‘₯ βˆ’ π‘Ž)𝑛 + β‹―
2!
𝑛!
Finding ANY Taylor Series
It should be possible to approximate functions around values other than
π‘₯ = 0. How should we change the Maclaurin Series to make a Taylor
Series centered at any π‘₯ = π‘Ž? Remember it must still match the function
at its value through all of its derivatives at π‘₯ = π‘Ž.
Change
Change the 0 to an π‘Ž:
the π‘₯ to
π‘₯ βˆ’ π‘Ž.
β€²β€²
𝑛
𝑓
π‘Ž
𝑓
π‘Ž
β€²
2
𝑓 π‘Ž + 𝑓 π‘Ž βˆ™ (π‘₯ βˆ’ π‘Ž) +
(π‘₯ βˆ’ π‘Ž) + β‹― +
(π‘₯ βˆ’ π‘Ž)𝑛 + β‹―
2!
𝑛!
If π‘₯ = π‘Ž, Deriv: 0 + 𝑓 β€² π‘Ž + 𝑓 β€²β€² π‘Ž (π‘₯ βˆ’ π‘Ž) + 𝑓′′′ π‘Ž (π‘₯ βˆ’ π‘Ž)2 + β‹― + 𝑓 𝑛 π‘Ž (π‘₯ βˆ’ π‘Ž)π‘›βˆ’1 + β‹―
2!
(π‘›βˆ’1)!
does the
derivative
β€²β€²β€² π‘Ž
𝑛 π‘Ž
𝑓
𝑓
of the π‘₯ = π‘Ž: 0 + 𝑓 β€² π‘Ž + 𝑓 β€²β€² π‘Ž (π‘Ž βˆ’ π‘Ž) +
(π‘Ž βˆ’ π‘Ž)2 + β‹― +
(π‘Ž βˆ’ π‘Ž)π‘›βˆ’1 + β‹―
2!
(𝑛 βˆ’ 1)!
series
equal
= 𝑓′ π‘Ž
𝑓′(π‘Ž)?
YES!
Taylor Series Generated by f at x=a
Let 𝑓 be a function with derivatives of all orders throughout
some open interval containing π‘Ž. Then the Taylor series
generated by 𝒇 at 𝒙 = 𝒂 is:
β€²β€² π‘Ž
𝑛 π‘Ž
𝑓
𝑓
𝑓 π‘Ž + 𝑓 β€² π‘Ž βˆ™ (π‘₯ βˆ’ π‘Ž) +
(π‘₯ βˆ’ π‘Ž)2 + β‹― +
(π‘₯ βˆ’ π‘Ž)𝑛 + β‹―
2!
𝑛!
∞
π‘˜=0
𝑓
π‘˜
(π‘Ž)
(π‘₯ βˆ’ π‘Ž)π‘˜
π‘˜!
Example
Consider 𝑓 π‘₯ = 𝑒 π‘₯ .
(a) Find the fourth degree Taylor Polynomial for 𝑓 π‘₯ = 𝑒 π‘₯
centered at 𝑐 = 1.
Find the function and derivatives of 𝑓(π‘₯):
Find the value of each derivative if
π‘₯ = 1:
𝑓 π‘₯ = 𝑒π‘₯
𝑓 1 = 𝑒1
𝑓′ π‘₯ = 𝑒 π‘₯
𝑓′ 1 = 𝑒1
𝑓′′ π‘₯ = 𝑒 π‘₯
𝑓′′ 1 = 𝑒1
𝑓′′′ π‘₯ = 𝑒 π‘₯
𝑓′′′ 1 = 𝑒1
𝑓 (4) π‘₯ = 𝑒 π‘₯
𝑓 (4) 1 = 𝑒1
Substitute into
the formula for
4 terms:
𝑒1
+
𝑒1
βˆ™ (π‘₯ βˆ’ 1) +
𝑒
2
𝑒1
(π‘₯
2!
βˆ’
1
𝑒
1)2 +
3!
𝑒
6
(π‘₯ βˆ’
1
𝑒
1)3 +
4!
𝑒 + 𝑒(π‘₯ βˆ’ 1) + (π‘₯ βˆ’ 1)2 + (π‘₯ βˆ’ 1)3 +
(π‘₯ βˆ’ 1)4
𝑒
(π‘₯
24
βˆ’ 1)4
Example
Consider 𝑓 π‘₯ = 𝑒 π‘₯ .
(b) Approximate 𝑒1.5 and 𝑒10 with the Taylor Polynomial.
Substitute π‘₯ = 1.5, 10 into the Taylor polynomial:
𝑒 + 𝑒(1.5 βˆ’ 1) +
𝑒
(1.5
2
βˆ’
𝑒
2
1) + (1.5 βˆ’
6
𝑒
3
1) + (1.5
24
βˆ’ 1)4
= 4.481
𝑒 + 𝑒(10 βˆ’ 1) +
𝑒
(10
2
βˆ’ 1)
2
𝑒
+ (10
6
βˆ’ 1)
3
𝑒
+ (10
24
βˆ’ 1)4
= 1210.655
Since 𝑒1.5 β‰ˆ 4.481 and 𝑒10 β‰ˆ 22026.466, the Taylor polynomial is a
better approximation when it is closer to center value.
Extension
Find the Maclaurin series for 𝑓 π‘₯ = 𝑒 𝑖π‘₯ .
We know the Maclaurin
series for 𝑒 π‘₯ :
Substitute
𝑖π‘₯ for π‘₯ in
the
Maclaurin
series for
𝑒 π‘₯:
π‘₯2 π‘₯3 π‘₯4 π‘₯5
π‘₯𝑛
1 + π‘₯ + + + + …+
+β‹―
2! 3! 4! 5!
𝑛!
𝑖π‘₯ 2
𝑖π‘₯ 3
𝑖π‘₯ 4
𝑖π‘₯ 5
1 + 𝑖π‘₯ +
+
+
+
+β‹―
2!
3!
4!
5!
𝑖2π‘₯2 𝑖3π‘₯3 𝑖4π‘₯4 𝑖5π‘₯5
1 + 𝑖π‘₯ +
+
+
+
+β‹―
2!
3!
4!
5!
βˆ’π‘₯ 2 βˆ’π‘–π‘₯ 3 π‘₯ 4 𝑖π‘₯ 5
1 + 𝑖π‘₯ +
+
+ +
+β‹―
2!
3!
4!
5!
βˆ’π‘₯ 2 π‘₯ 4
βˆ’π‘₯ 3 π‘₯ 5
(1 +
+ + β‹― ) + 𝑖(π‘₯ +
+ + β‹―)
2!
4!
3!
5!
cos π‘₯ + 𝑖 sin π‘₯
Extension Continued
Find the Maclaurin series for 𝑓 π‘₯ = 𝑒 𝑖π‘₯ .
Therefore:
Let
π‘₯ = πœ‹:
𝑖π‘₯
= cos π‘₯ + 𝑖 sin π‘₯
π‘–πœ‹
= cos πœ‹ + 𝑖 sin πœ‹
𝑒
𝑒
𝑒
An equation relating the 5
most important numbers in
mathematics!
π‘–πœ‹
𝑒
= βˆ’1 + 0
π‘–πœ‹
+1=0