9 7 Taylor Poly

Download Report

Transcript 9 7 Taylor Poly

9-7: Taylor Polynomials
Objectives:
1. To approximate a
function with a Taylor
polynomial
Assignment:
• P. 656-658: 13-21 odd,
25, 29, 41, 43, 45-48,
62, 64, 65
• Homework Supplement
Warm Up 1
Evaluate the following.
1. 3!
2. 𝑛!
3.
𝑛+1 !
𝑛!
Warm Up 2
1. Find the equation of the line tangent to the
graph of 𝑓 𝑥 = 𝑒 𝑥 at 𝑥 = 0.
𝑓 𝑥 = 𝑒𝑥
𝑓 0 = 𝑒0 = 1
𝑓′ 𝑥 = 𝑒 𝑥
𝑓′ 0 = 𝑒 0 = 1
𝑦 − 𝑦1 = 𝑚 𝑥 − 𝑥1
𝑦−1=1 𝑥−0
𝑦 =1+𝑥
Slope
Warm Up 2
2. Use your tangent line to approximate 𝑓 .5 .
𝑦 =1+𝑥
𝑦 .5 = 1 + .5
𝑦 .5 = 1.5
Warm Up 2
3. Does your approximation over- or
underestimate the actual value of
𝑓 .5 . Justify your answer.
𝑓 𝑥 = 𝑒𝑥
𝑓′ 𝑥 = 𝑒 𝑥
𝑓 ′′ 𝑥 = 𝑒 𝑥 > 0
Since 𝑓 𝑥 is concave
up, the tangent line is
below the curve, so
𝑦 .5 < 𝑓 .5 .
Warm Up 2
4. What is the error in
your approximation?
𝑓 .5 = 𝑒 .5
𝑓 .5 ≈ 1.649
− 𝑦 .5 = 1.5
Error = 0.149
Objective 1
You will be able to approximate
a function with a Taylor
polynomial
Approximation
Much of calculus is devoted to approximation,
whether that be the area under a curve or the value
of a transcendental function.
Approximation
Tangent lines to a curve at a particular point give a
reasonable approximation of a function around that
point, but the error in the approximation increases
as we move further away
from that point.
Tangent Line Approximation
A line tangent to a curve 𝑓 𝑥 at 𝑥 = 𝑐 shares the
point of tangency 𝑐, 𝑓 𝑐 with 𝑓 𝑥 and has the
same slope as 𝑓 𝑥 .
To improve the
approximation, we could
add the extra requirement
that our tangent polynomial
has the same concavity as
𝑓 𝑥 at 𝑥 = 𝑐.
Tangent Line Approximation
A line tangent to a curve 𝑓 𝑥 at 𝑥 = 𝑐 shares the
point of tangency 𝑐, 𝑓 𝑐 with 𝑓 𝑥 and has the
same slope as 𝑓 𝑥 .
To improve the
approximation, we could
add the extra requirement
that our tangent polynomial
has the same concavity as
𝑓 𝑥 at 𝑥 = 𝑐.
In other words, the second
derivatives at 𝑥 = 𝑐 are the
same for 𝑓 𝑥 and our
approximating polynomial.
Since a line has
no concavity, we
will have to
increase the
degree of our
approximating
polynomial…
Exercise 1a
Find the equation of the
second-degree
polynomial of the form
𝑃2 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐
whose slope, concavity,
and function value agree
with 𝑓 𝑥 = 𝑒 𝑥 at 𝑥 = 0.
Exercise 1b
Use 𝑃2 𝑥 to
approximate
𝑓 .5 = 𝑒 .5 . What
is the error of the
approximation?
𝑓 .5 = 𝑒 .5
𝑓 .5 ≈ 1.649
− 𝑃2 .5 = 1.625
Error = 0.024
Exercise 2a
Find the equation of the
third-degree polynomial of
the form
𝑃3 𝑥 = 𝑎𝑥 3 + 𝑏𝑥 2 + 𝑐𝑥 + 𝑑
whose function value, 1st,
2nd, and 3rd derivatives
agree with 𝑓 𝑥 = 𝑒 𝑥 at
𝑥 = 0.
Approximating Polynomial
1 2
𝑃2 𝑥 = 1 + 𝑥 + 𝑥
2
1 2 1 3
𝑃3 𝑥 = 1 + 𝑥 + 𝑥 + 𝑥
2
6
Notice that the
constant, linear,
and quadratic
terms of 𝑃3 𝑥
match those of
𝑃2 𝑥 . The only
thing that changed
was the new term.
Exercise 3a
Find the equation of the
fourth-degree polynomial
𝑃4 𝑥 whose function
value, 1st, 2nd, 3rd, and 4th
derivatives agree with
𝑓 𝑥 = 𝑒 𝑥 at 𝑥 = 0.
Coefficients!
When forming the
4th-degree
polynomial
approximation to
𝑓 𝑥 = 𝑒 𝑥 and 𝑥 = 0,
we essentially found
the 4th degree term
with factorials and
derivatives evaluated
at 𝑥 = 0.
𝑃𝑛 𝑥 = 𝑎𝑥 4 + 𝑏𝑥 3 + 𝑐𝑥 2 + 𝑑𝑥 + 𝑒
𝑃𝑛′ 𝑥 = 4𝑎𝑥 3 + 3𝑏𝑥 2 + 2𝑐𝑥 + 𝑑
𝑃𝑛′′ 𝑥 = 4 ∙ 3𝑎𝑥 2 + 3 ∙ 2𝑏𝑥 + 2 ∙ 1𝑐
Coefficients!
When forming the
4th-degree
polynomial
approximation to
𝑓 𝑥 = 𝑒 𝑥 and 𝑥 = 0,
we essentially found
the 4th degree term
with factorials and
derivatives evaluated
at 𝑥 = 0.
𝑃𝑛 𝑥 = 𝑎𝑥 4 + 𝑏𝑥 3 + 𝑐𝑥 2 + 𝑑𝑥 + 𝑒
𝑃𝑛′ 𝑥 = 4𝑎𝑥 3 + 3𝑏𝑥 2 + 2𝑐𝑥 + 𝑑
𝑃𝑛′′ 𝑥 = 4 ∙ 3𝑎𝑥 2 + 3 ∙ 2𝑏𝑥 + 2! 𝑐
𝑃𝑛′′′ 𝑥 = 4 ∙ 3 ∙ 2𝑎𝑥 + 3 ∙ 2 ∙ 1𝑏
Coefficients!
When forming the
4th-degree
polynomial
approximation to
𝑓 𝑥 = 𝑒 𝑥 and 𝑥 = 0,
we essentially found
the 4th degree term
with factorials and
derivatives evaluated
at 𝑥 = 0.
𝑃𝑛 𝑥 = 𝑎𝑥 4 + 𝑏𝑥 3 + 𝑐𝑥 2 + 𝑑𝑥 + 𝑒
𝑃𝑛′ 𝑥 = 4𝑎𝑥 3 + 3𝑏𝑥 2 + 2𝑐𝑥 + 𝑑
𝑃𝑛′′ 𝑥 = 4 ∙ 3𝑎𝑥 2 + 3 ∙ 2𝑏𝑥 + 2! 𝑐
𝑃𝑛′′′ 𝑥 = 4 ∙ 3 ∙ 2𝑎𝑥 + 3! 𝑏
𝑃𝑛
4
𝑥 = 4 ∙ 3 ∙ 2 ∙ 1𝑎
Coefficients!
When forming the
4th-degree
polynomial
approximation to
𝑓 𝑥 = 𝑒 𝑥 and 𝑥 = 0,
we essentially found
the 4th degree term
with factorials and
derivatives evaluated
at 𝑥 = 0.
𝑃𝑛 𝑥 = 𝑎𝑥 4 + 𝑏𝑥 3 + 𝑐𝑥 2 + 𝑑𝑥 + 𝑒
𝑃𝑛′ 𝑥 = 4𝑎𝑥 3 + 3𝑏𝑥 2 + 2𝑐𝑥 + 𝑑
𝑃𝑛′′ 𝑥 = 4 ∙ 3𝑎𝑥 2 + 3 ∙ 2𝑏𝑥 + 2! 𝑐
𝑃𝑛′′′ 𝑥 = 4 ∙ 3 ∙ 2𝑎𝑥 + 3! 𝑏
𝑃𝑛
4
𝑥 = 4! 𝑎 = 1
1
𝑓4 0
𝑎= =
4!
4!
Coefficients!
Similarly, to find the 5th-degree term of the
5th-degree polynomial:
Coefficient:
𝑃𝑛
5
𝑥 = 5 ∙ 4 ∙ 3 ∙ 2 ∙ 1𝑎
𝑃𝑛
5
𝑥 = 5! 𝑎 = 1
𝑓5 0
1
=
𝑎=
5!
5!
Term:
1 5 𝑓5 0 5
𝑥 =
𝑥
5!
5!
Coefficients!
To generalize, to find the 𝑛th-degree term of
𝑃𝑛 𝑥 :
Coefficient:
𝑃𝑛
𝑛
𝑥 = 𝑛 ∙ 𝑛 − 1 ⋯ 3 ∙ 2 ∙ 1𝑎
𝑃𝑛
𝑛
𝑥 = 𝑛! 𝑎 = 1
𝑓𝑛 0
1
=
𝑎=
𝑛!
𝑛!
Term:
1 𝑛 𝑓𝑛 0 𝑛
𝑥 =
𝑥
𝑛!
𝑛!
Left of Center
All of the previous polynomial approximations were
expanded about or centered about 𝑥 = 0. However,
we can center 𝑃𝑛 𝑥 at any 𝑥-value 𝑥 = 𝑐. In this
case the coefficient of the 𝑛th-term would be:
Coefficient:
𝑃𝑛
𝑛
𝑥 = 𝑛! 𝑎 = 𝑓
𝑛
𝑐
𝑓
𝑛
𝑐
𝑎=
𝑛!
Left of Center
Also, since our polynomial is now translated
to the right 𝑐 units from 𝑥 = 0, the 𝑛th-degree
term of 𝑃𝑛 𝑥 is:
Coefficient:
𝑃𝑛
𝑛
Term:
𝑥 = 𝑛! 𝑎 = 𝑓
𝑛
𝑓
𝑛
𝑎=
𝑛!
𝑐
𝑐
𝑓
𝑛
𝑛!
𝑐
𝑥−𝑐
𝑛
𝑃𝑛 𝑥 is
what is
called a
Taylor
polynomial.
𝑛th Taylor Polynomial
If 𝑓 has 𝑛 derivatives at 𝑐, then the
polynomial
𝑓′′ 𝑐
𝑃𝑛 𝑥 = 𝑓 𝑐 + 𝑓′ 𝑐 𝑥 − 𝑐 +
2!
𝑥−𝑐
2
+ ⋯+
𝑓
𝑛
𝑛!
𝑐
𝑥−𝑐
𝑛
is called the 𝒏th Taylor polynomial for 𝑓 at
𝑐.
Brook Taylor, c. 1715
nth Maclaurin Polynomial
If 𝑐 = 0, then
𝑓′′ 0 2
𝑓𝑛 0 𝑛
𝑃𝑛 𝑥 = 𝑓 0 + 𝑓′ 0 𝑥 +
𝑥 + ⋯+
𝑥
2!
𝑛!
is called the 𝒏th Maclaurin polynomial for
𝑓.
Colin Maclaurin, c. 1742
Exercise 4
Find the 𝑛th Maclaurin polynomial for 𝑓 𝑥 = 𝑒 𝑥 .
Writing Polynomials
In general, to write the 𝑛th Taylor or Maclaurin
polynomial for 𝑓 𝑥 :
Construct the
polynomial with the
Step
3 of the
𝑛th-term
being
Take the first
Step 1
𝑛 derivatives
of 𝑓 𝑥 .
Evaluate
each
Step 2
derivative at
𝑥 = 𝑐.
form
𝑓𝑛 𝑐
𝑛!
𝑥 − 𝑐 𝑛.
Exercise 5a
Find the Taylor polynomials 𝑃0 , 𝑃1 , 𝑃2 , 𝑃3 ,
and 𝑃4 for 𝑓 𝑥 = ln 𝑥 centered at 𝑐 = 1.
Exercise 5b
Use 𝑃4 to approximate 𝑓 1.1 = ln 1.1.
Calculate the error of the approximation.
Exercise 6a
Find the Maclaurin
polynomials 𝑃0 , 𝑃2 ,
𝑃4 , and 𝑃6 for
𝑓 𝑥 = cos 𝑥.
Notice that 𝑃𝑛
contains only
even powers,
since cos 𝑥 is an
even function.
Usually only
happens when
centered at 0.
Exercise 6b
Use 𝑃6 to approximate 𝑓 0.1 = cos 0.1.
Calculate the error of the approximation.
Exercise 7
Find the 3rd Taylor
polynomial for
𝑓 𝑥 = sin 𝑥
expanded about
𝜋
𝑐= .
6
Conclusions
Essentially, we have been using Taylor/Maclaurin
polynomials to approximate the value of a
transcendental function at a particular point.
As 𝑛 → ∞,
𝑃𝑛 𝑥 → 𝑓 𝑥
For 𝑓 𝑥 = 𝑒 𝑥 at 𝑥 = .5
𝑷𝟎 . 𝟓
𝑷𝟏 . 𝟓
𝑷𝟐 . 𝟓
𝑷𝟑 . 𝟓
𝑷𝟒 . 𝟓
𝑒 .5
1
1.649
1.5
1.649
1.625
1.649
1.646
1.649
1.648
1.649
Error
0.649
0.149
0.024
0.003
0.001
Approximation
becomes more
accurate for
higher degree
polynomials
Conclusions
Essentially, we have been using Taylor/Maclaurin
polynomials to approximate the value of a
transcendental function at a particular point.
For 𝑃4 𝑥 for 0 ≤ 𝑥 ≤ 2.5
𝒙
𝟎
𝟎. 𝟓
𝟏
𝟏. 𝟓
𝟐
𝟐. 𝟓
𝑃4 𝑥
1
1.6484
2.7083
4.3984
7
10.857
𝑒 .5
1
1.6487
2.7183
4.4817
7.3891
12.182
Error
0
0.00028
0.00995
0.08325
0.38906
1.3257
Conclusions
3
𝑓 𝑥 = 𝑒𝑥
𝑃4 𝑥 = 1 + 𝑥 +
𝑥2
2
+
𝑥3
6
Can you even see the error?
+
𝑥4
24
2.5
2
1.5
1
0.5
1
2
Conclusions
3
It’s a bit easier to see the
error in the graph of
𝑅4 = 𝑓 𝑥 − 𝑃4 𝑥 .
2.5
2
1.5
Approximation becomes
less accurate the farther
you move from 𝑐.
1
0.5
2
1
1
0.5
2
Remainder
𝑃𝑛 is only approximately equal to 𝑓 𝑥 :
𝑓 𝑥 ≈ 𝑃𝑛 𝑥
If we added a little something to our
approximation, we would arrive at the exact
value. That little something is called the
remainder.
Remainder
The difference between 𝑓 𝑥 and 𝑃𝑛 𝑥 is
called the remainder 𝑅𝑛 𝑥 :
𝑓 𝑥 = 𝑃𝑛 𝑥 + 𝑅𝑛 𝑥
Error
𝑅𝑛 𝑥 = 𝑓 𝑥 − 𝑃𝑛 𝑥
𝑅𝑛 𝑥
= 𝑓 𝑥 − 𝑃𝑛 𝑥
However, since 𝑃𝑛 𝑥 either over- or underestimates 𝑓 𝑥 ,
𝑅𝑛 𝑥 could be either positive or negative, so we usually
take the absolute value. This is called the error.
Remainder
By construction at 𝑥 = 𝑐, the nth derivative of
𝑓 𝑥 equals the 𝑛th derivative of 𝑃𝑛 𝑥 .
𝑛+1
However, since 𝑃𝑛
= 0:
𝑛+1
𝑅𝑛
𝑥
= 𝑓
𝑛+1
𝑥
Think of 𝑅𝑛 as the First
Neglected Term, what would
have been the 𝑛 + 1 th term.
This is used to
bound the error of
an approximation.
Taylor’s Theorem
If a function 𝑓 is differentiable through order
𝑛 + 1 in an interval 𝐼 containing 𝑐, then for
each 𝑥 in 𝐼, there exists 𝑧 between 𝑥 and 𝑐
such that
𝑓′′ 𝑐
𝑓 𝑥 = 𝑓 𝑐 + 𝑓′ 𝑐 𝑥 − 𝑐 +
2!
𝑥−𝑐
Lagrange form of the remainder
2
+ ⋯+
𝑓
𝑛
𝑐
𝑛!
𝑅𝑛 𝑥 =
𝑓
𝑥−𝑐
𝑛
+ 𝑅𝑛 𝑥
𝑛+1
𝑧
𝑥−𝑐
𝑛+1 !
𝑛+1
Taylor Inequality
Taylor showed that the one of his precious
polynomials could only be off the mark by:
𝑀 is the maximum value of the
𝑛 + 1 th derivative between 𝑥 and 𝑐.
𝑅𝑛 𝑥
≤
𝑀
𝑥−𝑐
𝑛+1 !
𝑛+1
Where 𝑥 is the value
you are trying to
approximate.
Lagrange Remainder
Lagrange showed that a Taylor polynomials
could only be off the mark by:
𝑓 𝑛+1 𝑧 is the maximum value of the
𝑛 + 1 th derivative between 𝑥 and 𝑐.
𝑅𝑛 𝑥
≤
𝑓
𝑥≤𝑧≤𝑐
𝑛+1
𝑧
𝑥−𝑐
𝑛+1 !
𝑛+1
𝑐≤𝑧≤𝑥
Error
We have been easily calculating the error as
𝑓 𝑥 − 𝑃𝑛 𝑥 since we knew the exact value
of 𝑓 𝑥 . However, we usually don’t know
𝑓 𝑥 ; that’s why we’re approximating it.
Taylor’s Inequality gives us a way to find out
how close our approximate answer is to the
actual answer.
Exercise 8
When we approximated 𝑒 .5 ≈ 1.646 using the
3rd Maclaurin polynomial, we calculated an
error of 0.003. Use the Lagrange remainder
to demonstrate this error.
Exercise 9
Using the 4th Taylor polynomial centered at
𝑐 = 1, we approximated ln 1.1 ≈ 0.09536 with
an error of 0.0000018. Demonstrate this
error using the Lagrange remainder.
9-7: Taylor Polynomials
Objectives:
1. To approximate a
function with a Taylor
polynomial
Assignment:
• P. 656-658: 13-21 odd,
25, 29, 41, 43, 45-48,
62, 64, 65
• Homework Supplement