




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Examples and Tricks for computing Taylor polynomials with solutions.
Typology: Lecture notes
1 / 8
This page cannot be seen from the preview
Don't miss anything!





The textbook covers Taylor polynomials as a part of its treatment of infinite series (Chapter 10). We are spending only a short time on infinite series (the next unit, Unit 7) and will therefore learn Taylor polynomials with a more direct, hands-on approach. Accordingly, the readings in the coursepack will be more central, I will be providing a bit more in terms of lecture, the pre-homework will be relatively short, with extra length in the regular homework devoted to problems that would normally be in the pre-homework.
Idea of a Taylor polynomial
Polynomials are simpler than most other functions. This leads to the idea of approx- imating a complicated function by a polynomial. Taylor realized that this is possible provided there is an “easy” point at which you know how to compute the function and its derivatives. Given a function f (x) and a value a, we will define for each degree n a polynomial P (^) n (x) which is the “best n th^ degree polynomial approximation to f (x) near x = a.”
It pays to start very simply. A zero-degree polynomial is a constant. What is the best constant approximation to f (x) near x = a? Clearly, the constant f (a). What is the best linear approximation? We already know this, and have given it the notation L(x). It is the tangent line to the graph of f (x) at x = a and its equation is L(x) = f (a) + f ^ (a)(x − a). So now we know that
P 0 (x) = f (a) P 1 (x) = f (a) + f ^ (a)(x − a)
The figure on the next page shows the graph of a function f along with its zeroth and first degree Taylor polynomials at x = 2. The zeroth degree polynomial is the flat line and the first degree Taylor polynomial is the tangent line.
Just one more idea is needed to bust this wide open, that is to figure out P (^) n (x) for all n: the polynomial P (^) n (x) matches all the derivatives of f at a up to the n th^ derivative. Check: P 0 matches the zeroth derivative, that is the function value, and P 1 matches the first derivative because both P 1 and f have the same first derivative at a, namely f ^ (a). The next figure shows P 3 , P 4 andP 5 at x = 2 for the same function, with P (^5) shown in long dashes, P 4 in shorter dashes and P 3 in dots. As n grows, notice how P (^) n beceoms a better approximation and stays close to f for longer.
Next you should try a simple example.
Example: f (x) = x, n = 3 and a = 2. The value of f (a) is 2 and the first three derivatives of f (x) are constants: 1, 0, 0. Therefore
P 3 (x) = 2 + 1 · (x − 2) +
(x − 2) 2 +
(x − 2) 3.
In other words, P 3 (x) = x. Obviously P 4 , P 5 and so on will also be x. Maybe this example was too trivial. But it does point out a fact: if f is a polynomial of degree d then the terms of the Taylor polynomial beyond degree d vanish because the derivatives of f vanish. In fact, P (^) n (x) = f (x) for all n ≥ d.
Example: f (x) = e x^ , n = 3 and a = 0. We list the function and its derivatives out to the third one.
k f (k)^ (x) f (k)^ (a)
f (k)^ (a) k!
(x − a) k
0 e x^1 1 e x^1 x
2 e x^1
x 2 2
3 e x^1
x 3 6
Summing the last column we find that P 3 (x) = 1 + x + x 2 /2 + x 3 /6.
Example: Let f (x) = ln
x and expand around a = 1. We’ll do the first two terms this time.
k f (k)^ (x) f (k)^ (a)
f (k)^ (a) k!
(x − a) k
0 ln
x 0 0
2 x
(x − 1)
2 x 2
(x − 1) 2
Summing the last column we find that P 2 (x) =
x − 1 2
(x − 1) 2 4
Tricks for computing Taylor polynomials
You can always compute a Taylor polynomial using the formula. But sometimes the derivatives get messy and you can save time and mistakes by building up from pieces. Taylor polynomials follow the usual rules for addition, multiplication and composition. If f and g have Taylor polynonmials P and Q of order n then f + g has Taylor polynomial P + Q. This is easy to see because the derivative is just the sum of the derivatives. Furthermore, the order n Taylor polynomial for f g is P · Q (ignore terms of order higher than n). This is because the product rule for the derivative of f g looks exactly like the rule for multiplying polynomials. I won’t present a proof here but you can feel free to use this fact.
Example: What is the cubic Taylor polynomial for e x^ sin x? The respective cubic Taylor polynomials are 1 + x + x 2 /2 + x 3 /6 and x − x 3 /6. Multiplying these and ignoring terms with a power beyond 3 we get
P 3 (x) = x
1 + x +
x 2 2
x 3 6
· 1 = x + x 2 +
x 3 3
Perhaps the most useful manipulation is composition. I will illustrate this by example. The Taylor polynomial for e x^
2 is obtained by plugging in x 2 for x in the Taylor polynomial or series for e x^ : 1 + (x 2 ) + (x 2 ) 2 /2! + · · ·.
One last trick arises when computing the Taylor series for a function defined as an integral. Suppose f (x) = nt xb g(t) dt. Then f ^ (x) = g(x) so if you know g and its derivatives, you know the derivatives of f. If g has no nice indefinite integral, then you don’t know the value of f itself, except at one point, namely f (b) = 0. Therefore, a Taylor series at b is the most common choice for a function defined as
(^) x b of another function.
Example: Suppose f (x) =
(^) x 1
1 + t 3 dt. The Taylor series can be computed about
the point a = 1. From f ^ (x) =
1 + x 3 , f ^ (x) = 3x 2 /(
1 + x 3 ) we get
f (1) = 0, f ^ (1) =
2 , f ^ (1) = 3/(
and therefore P 2 (x) =
2(x − 1) +
(x − 1) 2.
The central question for today is, how good an approximation to f is P (^) n? We will give a rough answer and then a more precise one.
Rough answer: P (^) n (x) − f (x) ∼ c(x − a) n+1^ near x = a. For example, the linear approximation P 1 is off from the actual value by a quadratic quantity c(x − a) 2. If x differs from a by about 0.1 then P 1 (x) will differ from f (x) by something like 0.01. If x agrees with a to four decimal places, then P 1 (x) should agree with f (x) to about eight places. Similarly, the quadratic approximation P 2 differs from f by a multiple of (x − a) 3 , and so on.
You can skip the justification of this answer, but I thought I’d include the derivation for those who want it because it’s just an application of L’Hˆopital’s rule. Once you guess that P (^) n (x) − f (x) ∼ c(x − a) n^ , you can verify it by starting with the equation
lim x→ 0
f (x) − P (^) n (x) (x − a) n+^
and repeatedly applying L’Hˆopital’s rule until the denominator is not zero at x = a. Because the derivatives of f and P (^) n at zero match through order n, it takes at least n + 1 derivatives to get something nonzero, at which point the denominator has become the nonzero constant (n + 1)!. The limit is therefore f (n+1)^ (a)/(n + 1)!, which may or may not be zero but is surely finite.
We know the Taylor polynomial is an order (x − a) n+1^ approximation but there is a constant c in the expression which could be huge. What about actual bounds can we obtain on f (x) − P (^) n (x)? These are given by Answer # 2, which is called Taylor’s Theorem with Remainder.
Taylor’s Theorem with Remainder: Let f be a function with n + 1 continuous derivatives on and interval [a, x] or [x, a] and let P (^) n be the order n Taylor polynomial for f about the point a. Then
f (x) − P (^) n (x) =
f (n+1)^ (u) (n + 1)!
(x − a) n+
for some u between a and x.
The theorem is telling us that the constant c in the rough answer is equal to f (n+1)^ (u)/(n + 1)! for this unknown u. This is at first a little mysterious and difficult to use, which is why we’ll be doing some practice. The exact value of u will depend on a, x, n and f and will not be known. However, it will always be between a and x. This means we can often get bounds. We might know, for example, that f (n+1)^ is always positive on [a, x] and is greatest at a, which would lead to
P (^) n (x) ≤ x ≤ P (^) n (x) +
f (n+1)^ (a) (n + 1)!
(x − a) n+^.
Example: Let f (x) = e −x^ , a = ln 10 and n = 1. How well does P 2 (x) =
(x −
ln 10) approximate e −x^ for x = ln 10 + 0. 2 ≈ 2 .502? The remainder R = e x^ − P (^) n (x) will equal f ^ (u)/2! times (0.2) 2 for some u between ln 10 and ln 10 + 2. Because f ^ (u) = e −u^ , we know that 0 < f ^ (u) < f ^ (a) = 1/10. Therefore, with x = ln 10+0.2,
1 10
< e −x^ <
Numerically, 0. 08 < e −(ln 10+0.2)^ < 0 .082. The actual value is 0. 081873.. ..
Here is another example.
Example: Let f (x) = cos(x), a = 0 and n = 4. Then P 4 (x) = 1 −
x 2 2
x 4 24
. This is
also P 5 because f (5)^ (0) = 0. How close is this to the correct value of cos x at x = π/4? Because the sixth derivative of cos is − cos, Taylor’s theorem says
cos(π/4) − P 4 (π/4) = c(π/4) 6
where c = − cos u/6! for some u ∈ [0, π/4]. The maximum value of − cos on [0, π/4] is −
1 /2 and the minimum value is −1, therefore
π
4
≤ cos(π/4) − P 4 (π/4) ≤ −
π
4
For bounds one can compute mentally, we can use the fact that π/4 is a little less than 1 to get
−
≤ cos(π/4) − P 4 (π/4) ≤ 0
to see that P 4 (π/4) overestimates cos(π/4) but not by more than 1/720 which is a little over 0.001.