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 | 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
Economic Debate- Progressive Income Tax For this Economic Debate, we are going to discuss the…
TOPIC: Going Global Discussion Thread 1 (initial post due Wednesday for full credit) Please note:…
Assignment Topic This week will culminate in the creation of a narrated PowerPoint to create…
The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted…
you need to post your 2-page information flier to share with your Final Project Group.…
discussion: Discuss the methods used at your company to measure and ensure quality products and…