ECON 120C UCSD Threats to the Validity of a Regression Study Reflection 1. What were the most important 1-2 new things you learnt from the lecture and/orre

ECON 120C UCSD Threats to the Validity of a Regression Study Reflection 1. What were the most important 1-2 new things you learnt from the lecture and/orreadings that you did not know before class? Describe one way in which what youlearnt connects to either a different subject/topic you are interested in, or a personalexperience.2. What were 1-2 points discussed in lecture/readings that you are still confused/unclearabout and would like some further clarification on?3. What topics/questions would you like to learn more about or discuss more based oncontent covered in the lecture/readings?The reflection should be concise and not longer than 1 page (letter format, 12points, double spacing). SECTION 10.8: TAYLOR AND MACLAURIN SERIES
1. The Concept of Taylor Series
We are interested in find power series expansions for functions that we know about. So
let f be an infinitely differentiable function and suppose that f has a power series form:
f (x) =
∞
X
an x n = a0 + a1 x + a2 x 2 + · · ·
n=0
So the question is: what are the coefficients an ? First if we plug in x = 0, we see that
f (0) = a0 . So if we know how to calculate f (0), we can figure out the zeroth coefficient for
the power series.
Now using the fact that plugging in x = 0 makes most of the terms disappear is rather
convenient, but without getting rid of the x in the term we want, we can’t use this. But we
do have a way of getting rid of the x’s: differentiating. So if we take the derivative of f and
plug in x = 0, we see:
f 0 (0) = a1 + 2a2 0 + 3a3 02 + 4a4 03 + · · · = a1
So we have that f 0 (0) = a1 . So now we need to know some information about the derivative
of f , but we can figure out the first term of the power series.
We can differentiate again and plug in x = 0, but this time things don’t work as nicely
as they have in the past two cases:
f 00 (0) = 2a2 + 3 · 2a3 · 0 + 4 · 3a4 · 02 + 5 · 4a5 · 03 + · · · = 2a2 .
f 00 (0)
So by dividing by 2, we see that
= a2 . Now we have this 2 that we are dividing, but
2
at least we can still figure out the second term of the power series.
But why did this 2 appear? In this case, because the original power series a2 was attached
to x2 , when we differentiated the function, the power rule brought down the 2. So we had
to account for this to recover the coefficient.
But things get a little more complicated in the next term. If we differentiate again and
plug in x = 0, we get:
f 000 (0) = 3 · 2a3 + 4 · 3 · 2a4 · 0 + 5 · 4 · 3a5 · 02 + 6 · 5 · 4 · 3a6 03 + · · · = 3 · 2a3 .
When we differentiated the first time, we brought down the 3 from the x3 , but then it became
x2 . So when differentiated again, we brought down the 2 from x2 . So that’s why we have an
f 000 (0)
extra factor of 3 · 2. So the formula for the third term of the power series is: a3 =
.
3·2
Hopefully the pattern is clear at this point. When we differentiate a higher power say
x9 , we are going to differentiate 9 times and each time it will bring down a power: 9, 8, 7,
1
2
SECTION 10.8: TAYLOR AND MACLAURIN SERIES
6, 5, 4, 3, 2, 1. So we will have an extra factor of 9! and as a result we will have:
f (9) (0) = 9!a9
Note that f (n) is our notation for the nth derivative of f .
In general, this means that the nth coefficient of a power series is given by
f (n) (0)
an =
n!
or if we use a power series centered at c
an =
f (n) (c)
n!
If we go ahead and put it back into the series, we have
Definition. For an infinitely-differentiable function f , the Taylor series of f centered at
x = c is the power series:
∞
X
f (n) (c)
(x − c)n .
n!
n=0
A Taylor series centered at x = 0 is called a Maclaurin series.
2. Examples of Taylor Series
In order to find the Taylor series for a function, we need to be able to compute all of its
derivatives, at least at a single point. The best candidates for this is where the derivatives
are predictable.
Take for instance the function ex . Since ex is its own derivative, we know its derivatives:
f (n) (x) = ex . In particular, we have f (n) (0) = e0 = 1. So the Maclaurin series (i.e. Taylor
series at x = 0) for f (x) = ex is:
∞
∞
X
1 n X xn
e =
x =
,
n!
n!
n=0
n=0
x
which, as we saw before, converges for all x.
The exponential function is the best example we will have. The trigonometric functions
sin(x) and cos(x) are more difficult, but we notice a nice pattern emerging when we take
enough derivatives. First, if we consider f (x) = sin(x):
f (0) = sin(0) = 0
f 0 (0) = cos(0) = 1
f 00 (0) = − sin(0) = 0
f 000 (0) = − cos(0) = −1
f (4) (0) = sin(0) = 0
We see that the fourth derivative of f is the same as the original function, and so this
pattern will repeat for all the derivatives.
SECTION 10.8: TAYLOR AND MACLAURIN SERIES
3
So if we compute the first few terms of the Maclaurin series, we see that
sin(x) =
0
1
0
−1 3 0 4 1 5
x
x3 x5 x7 x9
+ x + x2 +
x + x + x + ··· = −
+
−
+
− ···
0! 1!
2!
3!
4!
5!
1!
3!
5!
7!
9!
So we have a series where there are only odd powers of x and so that the terms alternate
in sign. The general formula for the Maclaurin series is
∞
X
(−1)n x2n+1
sin(x) =
(2n + 1)!
n=0
f (x) = cos(x) works in a similar fashion:
f (0) = cos(0) = 1
0
f (0) = − sin(0) = 0
f 00 (0) = − cos(0) = −1
f 000 (0) = sin(0) = 0
f (4) (0) = cos(0) = 1
This time only the even powers of x remain:
cos(x) =
0
−1 2 0 3 1 4
x2 x4 x6
1
+ x+
x + x + x + ··· = 1 −
+
−
+ ···
0! 1!
2!
3!
4!
2!
4!
6!
So the Maclaurin series of cos(x) is given by
cos(x) =
∞
X
(−1)n x2n
n=0
(2n)!
We can use the ratio test to see that both Maclaurin series converge for all x.
3. Another Example
When we take the Taylor series of a polynomial, since the derivatives of a polynomial are
eventually all equal to 0, we get a finite sum. So we have an identity that applies for all x.
Suppose we want to find the Taylor’s series of f (x) = x2 + x + 1 at x = 1. so first we
need to find the derivatives:
f (1) = 12 + 1 + 1 = 3
f 0 (1) = 2 · 1 + 1 = 3
f 00 (1) = 2
f 000 (1) = 0
So we have that
3
2
(x − 1) + (x − 1)2
1!
2!
= 3 + 3(x − 1) + (x − 1)2 .
x2 + x + 1 = 3 +
4
SECTION 10.8: TAYLOR AND MACLAURIN SERIES
4. Power Series are Taylor Series
We note that even though a Taylor series is technically a separate thing, if a function
has a power series expansion then that power series is the Taylor series.
For example, the geometric series
∞
X
1
=
xn
1 − x n=0
1
.
1−x
This means that we can find the Taylor series of various functions using the composition
method explained last week without computing derivatives.
is the Maclaurn series of
For example, to find the Maclaurin series of f (x) = e−x , we can just plug in −x for x in
the Taylor series for ex :
∞
∞
X
(−x)n X (−1)n xn
−x
e =
=
n!
n!
n=0
n=0
Another thing is that we can multiply and divide by polynomials to obtain the power
sin(x)
series. For example, to find the Taylor series for
:
x
∞
∞
∞
1 X (−1)n x2n+1 X (−1)n x2n+1 X (−1)n x2n
sin(x)
=
=
=
x
x n=0 (2n + 1)!
x(2n
+
1)!
(2n + 1)!
n=0
n=0
We can combine these ideas. For example to find the Taylor series for x cos(x2 ):
∞
∞
∞
X
X
X
(−1)n x2·2n
(−1)n x4n
(−1)n (x2 )2n
2
=x
=x
x cos(x ) = x
(2n)!
(2n)!
(2n)!
n=0
n=0
n=0
=
∞
X
(−1)n x · x4n
n=0
(2n)!
=
∞
X
(−1)n x4n+1
n=0
(2n)!
.
On the opposite side of the spectrum, every power series is a Taylor series. What I mean
by this is that the formula for nth coefficient can actually tell us something about the f (n) (0).
For example, say we wanted to compute f (5) (0), where f (x) = x cos(x2 ). We can on the one
hand, go through the mess of using product rule and chain rule multiple times and find the
5th derivative and then plug in x = 0, or we can look at the coefficient of x5 in the above
(i.e. n = 1). So by the formula for coefficient of the Taylor’s series:
−1 · 5!
f (5) (0)
(−1)1
=
or f (5) (0) =
= −60.
5!
2!
2
5. Exercises
Find the following Taylor series with given centers. Remember that it may be useful
to find Taylor series using algebraic methods instead of by taking derivatives as explained
above.
SECTION 10.8: TAYLOR AND MACLAURIN SERIES
1. f (x) = x3 + x2 − 2x + 3 centered at a = −1.
2. sin(x) centered at a = π/2.
3. f (x) =
ex − e−x
centered at a = 0.
2
2
4. e−x centered at a = 0.
Z x
cos(t2 ) dt centered at a = 0.
5. f (x) =
0
5
SECTION 10.9: ESTIMATING SERIES WITH PARTIAL SUMS
MIN RO
Strictly speaking this is not quite the same as Section 10.9 of your textbook. It includes
some material from 10.6 on alternating series and excludes the issue of whether a function
actually converges to its Taylor series.
I talk a little extensively on the issue of approximation, which I hope is useful. And
grouping all the error estimation material into one is probably more useful than recalling it
after forgetting about it.
I omitted the stuff about using Taylor’s estimate to show that a function converges to its
Taylor series, because for pure mathematicians, there’s a better answer and for practically
minded people, they’re never not equal.
1. Approximations and Error Estimation
If we have a series and through one of the tests we have learned, we figured out it was
convergent, then we know that we can add our infinite list of numbers together to get a real
actual sum.
The next question is what number do we get? In fact, we will often get answers more
complicated than the general terms of the series might suggest. Sometimes we get numbers
which we can’t characterize in terms of other well-known numbers.
So if we can’t figure out the exact value of these numbers, we can, at least, find an
approximation for the number, like how we know that π is endlessly complicated, but that
we can use 3.14 when we need to compute with π.
Of course, we have a natural candidate for approximating a series: the partial sums.
Since the series is defined as the limit of the partial sums, if we start adding up the list of
terms we get numbers that are closer and closer to the series. So the only question we have
to ask is how terms do we need to add? To answer this question, we are going to have to
talk about remainders.
First we need to fix some notation.
Let
s=
∞
X
an
n=1
be a convergent series and
sN =
N
X
an = a1 + a2 + a3 + . . . + aN
n=1
1
2
MIN RO
be the N th partial sum for s. Define the N th remainder of s as
rN = s − sN ,
by adding sN to both sides, we have the equation s = sN + rN .
The basic idea is that sN is an approximation for s. Since the limit of sN as n goes to
infinity is s, that means that the bigger N is, the better approximations we get for s. So rN
measures the difference between the number s and the approximation sN . So we want rN to
be close to 0.
It is generally impossible to find out what rN is exactly, but we just need to know that
it’s close to 0. So if we can find some small number ε > 0 so that
|rn | < ε, the this number ε measures how far sN is from s. In other words, it measures how good our approximation is. 2. Error Estimation with Alternating Series We only have error estimates for series for specific situations: the integral test, the alternating series test, and for Taylor series. We will skip the integral test error estimate and only cover the latter two. So suppose we have the conditions for the alternating series test: there exist un > 0 such
that the sequence of un is decreasing and lim un = 0.
n→∞
Let s =
∞
X
n=1
n+1
(−1)
u n , sN =
N
X
(−1)n+1 un , and rN = s − sN .
n=1
Due to the way that alternating series converge, we have that the N th remainder is
bound by the next term of the series:
|rN | ≤ uN +1 .
But in fact, the sign of the next term also plays a role. If the next term of the series is
negative, then that means that our estimate is larger than the actual number. If the next
term is positive, then the estimate is smaller. So based on the way that we have the signs
placed, the odd-indexed terms are positive and the even-indexed terms are negative, and so
we have the following:
0 ≤ rN ≤ bN +1 if N is even,
−bN +1 ≤ rN ≤ 0 if N is odd.
So in this case, we have that if we add up an even number of terms, we get an upper
bound (i.e. the partial sum estimate is smaller than the actual number) and if we add up
an odd number of terms, we get a lower bound (i.e. the partial sum estimate is larger than
the actual number).
SECTION 10.9: ESTIMATING SERIES WITH PARTIAL SUMS
3
In fact, if we add sN to both sides of the inequalities above, we have that:
sN ≤ s ≤ sN +1 if N is even,
sN +1 ≤ s ≤ sN if N is odd.
So in fact, consecutive partial sums give us upper and lower bounds for the series. Since
it’s clear which one is which, i.e. the smaller number is the lower bound and the larger
number is the upper bound, we don’t have to memorize anything about even and odd values
if we’re willing to do a little more computation.
∞
X
(−1)n+1
For example, consider the series s =
. Suppose we want to know what the
n4
n=1
5th partial sum is, an estimate for its error, and whether it is larger than the actual value
or smaller.
To do this, we can compute the 5th and 6th partial sums:
1
1
1
1
1
− 4 + 4 − 4 + 4 = 0.947539429 . . .
4
1
2
3
4
5
1
1
1
1
1
1
s6 = 4 − 4 + 4 − 4 + 4 − 4 = 0.946767824 . . .
1
2
3
4
5
6
s5 =
So we see that s6 < s5 , so we have that 0.946767824 . . . < s < 0.947539429 . . . So we know that s5 is an upper bound for the series, and so we also know that the error is between −b6 = − 614 and 0, or in other words −0.000771605 . . . ≤ r5 ≤ 0. Now suppose we want to find an estimate for the series so that the error is less than 10−4 . So in other words, we want to find an N so that |rN | ≤ 10−4 . But since we know that |rN | ≤ bN +1 , we are looking for the N so that bN +1 ≤ 10−4 or in this particular example, 1 ≤ 10−4 (N + 1)4 If we take 1/x of both sides and switch the inequality, we have: (N + 1)4 ≥ 104 and by taking fourth-roots of both sides: (n + 1) ≥ 104/4 = 10 or n ≥ 9 So to compute this to within an error of 10−4 we need to find the 9th partial sum: 1 1 1 1 1 1 1 1 1 − 4 + 4 − 4 + 4 − 4 + 4 − 4 + 4 = 0.947276042 . . . 4 1 2 3 4 5 6 7 8 9 So our estimate for the series ∞ X (−1)n+1 n=1 n4 accurate to an error of 10−4 is 0.947276042 . . . . 4 MIN RO 3. Taylor Series Error Estimate The error estimate here is based on the fact that we have a Taylor series. Let f (x) be an infinitely-differentiable function. Let TN (x) be the N th Taylor polynomial of f centered at x = c, i.e. TN (x) = N X f (n) (c) n! n=0 (x − c)n = f (c) + f 0 (c) f 00 (c) f 000 (c) f (N ) (c) + + + ··· + 1! 2! 3! N! Then we consider RN , the N th remainder in a similar way as with series: RN (x) = f (x) − TN (x), which represents the error of the polynomial approximation TN to the original function f (x). In order to determine how good our approximation is, we need an estimate for the error. Theorem. Let f (x) be an infinitely-differentiable function with N th Taylor polynomial TN (x) at x = c and remainder RN (x) = f (x) − TN (x). If f (N +1) (x) ≤ M for some constant M and for |x − c| < R, then M |RN (x)| ≤ |x − c|N +1 (N + 1)! for |x − c| < R. Notice that similar to the alternating series test, the error term resembles what would have been the next term, except we replace f (N +1) (c) with the possibly larger number M . The most problems probably arise from that number M . Let’s take what should be the most straightforward example, finding an approximation for Euler’s number e. Suppose we ask the question: What is the fifth partial sum approximation of e and what is the estimate for the error of the approximation? Since we have the Taylor series for ex : ex = ∞ X xn n=0 n! , taking the fifth partial sum is a matter of considering the 5th Taylor polynomial: T5 (x) = 5 X xn n=0 n! =1+ x x2 x3 x 4 x5 + + + + 1! 2! 3! 4! 5! and plugging in x = 1: 5 X 1 1 1 1 1 1 T5 (1) = = 1 + + + + + = 2.716̄ n! 1! 2! 3! 4! 5! n=0 So we have our approximation, but we want to know how close this value is to the actual number e. So we want to apply the error estimate above. First we notice that f (5+1) (x) = ex and since ex is an increasing function we have that f (6) (x) ≤ e for |x| ≤ 1, since we only care about what happens at x = 1. But our bound is the very number we are trying to compute! So we need an upper bound for e in order to see how accurate our estimate for e is. SECTION 10.9: ESTIMATING SERIES WITH PARTIAL SUMS 5 In this case we have a convenient upper bound: e < 3. So since f (6) (x) ≤ e < 3 for |x| < 1, we can finally estimate the error: 3 |R5 (x)| ≤ |x|6 , 6! and by plugging in x = 1, we have 3 |R5 (1)| ≤ = 0.00416̄ 6! √ To consider another example: √ Suppose we want to find an approximation for 9.5. We can consider the function f (x) = x + 9 = (x + 9)1/2 . By the binomial series, we have ∞ ∞ X 1/2 1/2−n n X 1/2 3xn f (x) = 9 x = n n 9n n=0 n=0 √ So we can find an approximation of 9.5 by plugging in x = 0.5 and taking a partial sum. For the sake of example, let’s take the second partial sum. We should also estimate the error to see how good the approximation is. So first off, we plug in x = 0.5: ∞ ∞ ∞ X X 1/2 3 · (0.5)n X 1/2 3 1/2 3 f (0.5) = = = n n 2n 9n n 18n 9n n=0 n=0 n=0 Since we are computing the 2nd partial sum, we need to know what the first couple of binomial coefficients are: 1/2 =1 0 1/2 1/2 1 = = 1 1! 2 1 −1 1 1 1/2 (1/2)(1/2 − 1) = · · =− = 2 2! 2 2 2 8 1/2 (1/2)(1/2 − 1)(1/2 − 2) 1 −1 1 = = · · −32 · 16 = 3! 2 2 16 3 So the second partial sum is: 1/2 1/2 3 1/2 3 1 3 1 3 s2 = ·3+ − =3+ · − · 2 = 3.082175926 . . . 2 0 1 18 2 18 2 18 8 18 By the Taylor estimate, the error is smaller than M 3 |R2 (x)| ≤ |x| . 3! But since f 000 (x) is a decreasing function, we know that M 1/2 8.5−2.5 = · 8.50.5−3 = = 0.00029671 . . . 3! 3 16 6 MIN RO So when we plug in x = 0.5, we see that the error is |r2 | ≤ 0.00029671 · (0.5)3 = 0.000037089 √ So we have an approximation 9.5 ≈ 3.08218 with an error smaller than 0.000037089. 4. Exercises For each of these problems, the intermediate quantities should be written. 1. Use the fourth partial sum to find an approximation for the series ∞ X (−1)n+1 n=1 n Find an estimate for the error. 2. Use the fifth Taylor polynomial of sin(x) (i.e. the degree 5 Taylor polynomial) to find an approximation for sin(1). Find an estimate for the error. 3. How many terms of the series ∞ X (−1)n+1 n=1 n2 + 1 must be added to obtain an approximation with an error less than 10−4 ? Justify your answer. SECTION 10.10: APPLICATIONS OF TAYLOR SERIES 1. Approximating Integrals with Taylor Series So as we noted earlier in the class, there are some functions, which despite being integrable, do not have nice formulas for their integrals. To take an important example, we know that Z x 2 e−t dt F (x) = 0 does not have a nice formula in terms of functions we know. However since we can find a power series for the function that we’re integrating, we can find a power series for the integral itself. Z xX Z xX ∞ ∞ ∞ Z x ∞ X X (−t2 )n (−1)n t2n (−1)n t2n (−1)n x2n+1 F (x) = dt = dt = dt = n! n! n! (2n + 1)n! 0 n=0 0 n=0 n=0 0 n=0 So we have a formula for the integral as a power series. Z x ∞ X (−1)n x2n+1 2 e−t dt = (2n + 1)n! 0 n=0 For example if we wanted to compute the integral from 0 to 1, we would just need to plug in x = 1: Z 1 ∞ ∞ X (−1)n 12n+1 X (−1)n 2 e−t dt = = , (2n + 1)n! (2n + 1)n! 0 n=0 n=0 which is most notably an alternating series. So we can make an approximation for the integral, for example by taking the fourth partial sum: Z 1 1 1 1 1 1 2 e−t dt ≈ − + − + = 0.747486772 . . . 1 · 0! 3 · 1! 5 · 2! 7 · 3! 9 · 4! 0 And since the series is alternating, we can also find out how accurate this approximation through the alternating series error estimate: |r4 | < b5 = 1 = 1/1080 = 0.000925926 . . . 9 · 5! So we see that we have about three decimal places of accuracy. Z 1 2 e−t dt ≈ 0.7475 0 1 2 SECTION 10.10: APPLICATIONS OF TAYLOR SERIES 2. Computing Limits We can use power series to compute certain limits that would otherwise need l’Hôpital’s rule. For example, compute the limit x − cos(x) x→∞ x2 lim Plugging in cos(x) = x − x2 x4 + − . . . , we get 2 4! 2 4 x − (x − x2 + x4! − . . . ) x − cos(x) lim = lim x→0 x→0 x2 x2 2 4 x − x4! + . . . ) = lim 2 x→0 x2 1... Purchase answer to see full attachment

Don't use plagiarized sources. Get Your Custom Essay on
ECON 120C UCSD Threats to the Validity of a Regression Study Reflection 1. What were the most important 1-2 new things you learnt from the lecture and/orre
For $10/Page 0nly
Order Essay
Calculator

Calculate the price of your paper

Total price:$26

Need a better grade?
We've got you covered.

Order your paper