Math 231E. Homework 3. Solutions.

Math 231E. Homework 3. Solutions.
Problem 1. Recall the Taylor series for ex at a = 0.
a. Find the Taylor polynomial of degree 4 for f (x) = ex about the point a = 0.
b. Use your answer to part (a) to estimate the value of e = e1 .
c. Compute the absolute and relative error in your approximation, up to three significant digits, given1 that
e = 2.718281828459045 · · ·
Solution:
a. T4 (x) = 1 + x +
x2 x3 x 4
+
+ .
2
6
24
b. Plugging in x = 1 gives
T4 (1) = 1 + 1 +
1 1
1
24 + 24 + 12 + 4 + 1
65
+ +
=
=
= 2.7083.
2 6 24
24
24
c. The absolute error is
T4 (1) − e = 2.7083 − 2.718281828459045 · · · ≈ −9.9485 × 10−3 .
The relative error is
T4 (1) − e −9.9485 × 10−3 −3
≈
2.718281828459045 = 3.6599 × 10 .
e
Problem 2. Let f (x) = x2 + 3x − 1.
a. Find the T0 (x), T1 (x), T2 (x), T3 (x), about the point a = 1.
b. Expand T2 (x) and simplify. Describe what you find, in one short sentence.
c. Compare T2 (x) and T3 (x). What do you see, and why is this so?
Solution:
1
For more digits, go to http://apod.nasa.gov/htmltest/gifcity/e.2mil.
a. We first compute
f 0 (x) = 2x + 3,
f 00 (x) = 2,
f 000 (x) = 0,
so
f (1) = 3,
f 0 (1) = 5,
f 00 (1) = 2,
f 000 (1) = 0,
so
T0 (x) = 3,
T1 (x) = 3 + 5(x − 1),
2
T2 (x) = 3 + 5(x − 1) + (x − 1)2 = 3 + 5(x − 1) + (x − 1)2 ,
2
2
0
T3 (x) = 3 + 5(x − 1) + (x − 1)2 + (x − 1)3 = 3 + 5(x − 1) + (x − 1)2 .
2
6
And, yes, T3 (x) = T2 (x).
b. We expand:
T2 (x) = 3 + 5(x − 1) + (x − 1)2 = 3 + 5x − 5 + x2 − 2x + 1 = x2 + 3x − 1.
We see that T2 (x) = f (x) exactly. (This is not surprising: the best quadratic approximation
to a quadratic polynomial should, of course, be itself!)
c. We see that they are the same. There are two way to describe “why” this is.
The first is to notice that f 000 (x) = 0, and, in fact, every higher-order derivative will be zero.
This means that once we pass the quadratic term, all further terms in the Taylor polynomials
will be zero, and we will add nothing by considering more terms.
Another way to see “why” is that we have already approximated the quadratic function
perfectly by T2 (x). We cannot do better than T2 (x). So the best cubic has to be T2 (x)
(because, note, every quadratic polynomial is also a cubic one with a term of the form 0x3 ).
Problem 3. What is the date and time of the second midterm? What percentage of the
final grade will it constitute?
Solution: The date and time of Midterm 2 is 7–9 on Thursday, October 13. It will be worth
15% of the final grade.
Problem 4. Use algebraic manipulation and known Taylor series from class to write down
Taylor series of the following functions about a = 0.
• Do not take any derivatives to do these problems!
• Your answer should give at least the first three non-zero terms of each series. For examP
x2
ple, we would write ex = 1 + x +
+ O(x3 ). You do not need to use “ ” notation.
2!
a. f (x) = x2 ex
b. f (x) = xe−x
2
c. f (x) =
sin(x)
x
d. f (x) =
1 − cos(x)
x2
e. f (x) = sin(2x)
f. f (x) = sin(x) cos(x)
Solution:
a. Writing
ex = 1 + x +
x2
+ O(x3 ),
2
we have
2 x
x e =x
2
x2
x4
3
1+x+
+ O(x ) = x2 + x3 +
+ O(x5 ) .
2
2
b. Writing
ex = 1 + x +
x2
+ O(x3 ),
2
and plugging in −x2 for x, we have
2
e−x = 1 − x2 +
x4
+ O(x6 ),
2
and so
−x2
xe
x5
x4
6
2
+ O(x ) = x − x3 +
+ O(x7 ) .
=x 1−x +
2
2
c. Writing
sin(x) = x −
x3
x5
+
+ O(x7 ),
6
120
we multiply by 1/x to obtain
sin(x)
1
=
x
x
x3
x5
x2
x4
7
x−
+
+ O(x ) = 1 −
+
+ O(x6 ) .
6
120
6
120
d. Writing
cos(x) = 1 −
x2 x4
x6
+
−
+ O(x8 ),
2
24 720
we have
− cos(x) = −1 +
x2 x4
x6
−
+
+ O(x8 ),
2
24 720
and
x6
x2 x4
x6
x2 x4
8
−
+
+ O(x ) =
−
+
+ O(x8 ).
1 − cos(x) = 1 + −1 +
2
24 720
2
24 720
Then
1 − cos(x)
1
= 2
2
x
x
x6
x2 x4
−
+
+ O(x8 )
2
24 720
=
1 x2
x4
−
+
+ O(x6 ) .
2 24 720
e. Writing
sin(x) = x −
x3
x5
+
+ O(x7 ),
6
120
we plug in 2x for x to obtain
sin(2x) = 2x −
(2x)3 (2x)5
4
4
+
+ O((2x)7 ) = 2x − x3 + x5 + O(x7 ) .
6
120
3
15
f. We have
sin(x) = x −
x3
x5
+
+ O(x7 ),
6
120
cos(x) = 1 −
x2 x 4
+
+ O(x6 ),
2
24
and
so
x3
x5
x2 x4
7
6
sin(x) cos(x) = x −
+
+ O(x ) · 1 −
+
+ O(x )
6
120
2
24
2
4
x
x
=x·1+x· −
+x·
2
24
3
3 2 3 4
x
x
x
x
x
+ −
·1+ −
· −
+ −
·
6
6
2
6
24
5
5 2 5 4
x
x
x
x
x
+
·1+
· −
+
·
120
120
2
120
24
3
5
3
5
5
x
x
x
x
x
=x−
+
−
+
+
+ O(x7 )
2
24
6
12 120
2
2
= x − x3 + x5 + O(x7 ) .
3
15
Problem 5. Recall the proof of the statement limx→3 x2 = 9 as shown in class, or in the
lecture notes, in lecture 2A.
a. First let f (x) be any differentiable function, and let f (0) = c and f 0 (0) = d > 0.
Let g(x) = c + (d/2)x. Show using Taylor series that for x > 0 sufficiently small,
g(x) < f (x).
√
b. Use this argument to show that if is sufficiently small, then 3 + /10 < 9 + .
Solution:
a. The first-order Taylor series of f (x) is
T1 (x) = f (0) + f 0 (0)x + O(x2 ) = c + dx + O(x2 )
This is close to f for x sufficiently small. Now we compute
g(x) − T1 (x) = c + (d/2)x − (c + dx + O(x2 )) = −(d/2)x + O(x2 )
So we want to show that
−(d/2)x + O(x2 ) < 0.
Dividing both sides by x gives the equivalent
−d/2 + O(x) < 0,
and clearly if x is sufficiently small, this sum is negative.
b. As we saw in class,
√
1
9 + = 3 + + O(2 ).
6
Notice that 1/10 < 1/6, so we have
√
9 + − (3 + /10) = (1/6 − 1/10) + O(2 ).
Since 1/6−1/10 = 1/15 > 0, we have an expression a+O(2 ) with a > 0. This is positive
if is small enough.