Recall that the purpose of a Taylor polynomial is to approximate a function f near some point a (called the center of the polynomial). So naturally, we want to have a rough idea of how good the estimate is, which leads to the following result:
Theorem (error bound)
Let f(x) be differentiable (at least) n+1 times, and let Tnf(x) be the n-th degree Taylor polynomial of f centered at a. Then
∣Tnf(x)−f(x)∣≤(n+1)!K∣x−a∣n+1,
where K is an upper bound for ∣∣f(n+1)∣∣ between x and a, i.e., on the interval [a,x] or [x,a], depending on whether a≤x or x≤a.
Example 1.
Find n such that
∣cos0.1−Tn(0.1)∣≤10−7
where Tn is the n-th degree Taylor polynomial of cosx centered at a=0.
Solution.
To use the error bound, we just need to figure out what to use for K, meaning we need an upper bound for cos(n+1)(x) on the interval [0,0.1]. In this case, the derivatives of cosx are ±sinx or ±cosx, so no matter what n is, we know
∣∣cos(n+1)(x)∣∣≤1.
Thus, K=1 works (but anything larger than 1 could also work, e.g., you could use K=10 or 20 if you wanted to). Plugging this into the error bound,
∣cos0.1−Tn(0.1)∣≤(n+1)!0.1n+1
and we want this to be less than 10−7. From here, you just need to plug in values for n until you get something that works:
So, the first n that works is n=4. (You can also use any bigger values of n.)
Example 2.
Let f(x)=lnx and Tnf(x) be the n-th degree Taylor polynomial of f centered at a=1. If c>1, show that
∣lnc−Tn(c)∣≤n+1∣c−1∣n+1.
Solution.
As you can guess, we're going to want to use the error bound again, so as before, we need to find an upper bound K for ∣∣f(n+1)∣∣ on the interval [1,c]. For the first couple derivatives, we get
To find K, we need to find an upper bound for this function on the interval [1,c]. To get something as big as possible, we can try to make the denominator as small as possible on this interval, i.e., x=1 should give us an upper bound:
∣∣f(n+1)(x)∣∣≤∣∣f(n+1)(1)∣∣=n!,
so K=n! works. Thus, the error bound gives
∣lnc−Tn(c)∣≤(n+1)!n!∣c−1∣n+1=n+1∣c−1∣n+1.
Taylor Series
Definition
Let f(x) be infinitely differentiable at x=a. Then its Taylor series centered at x=a is
T(x)=n=0∑∞n!f(n)(a)(x−a)n.
Warning: It's important to distinguish f from its Taylor series. Here's an important fact:
Every infinitely differentiable function f has a Taylor series (you can always make one using the formula in the definition).
Not every function f is represented by its Taylor series, i.e., the Taylor series might not always converge to f itself.
Example 3.
Let
f(x)={e−1/x20if x=0,if x=0.
This function has the property that f(n)(0)=0, which means that its Taylor series centered at a=0 is
Tf(x)=n=0∑∞n!0xn=0,
i.e., Tf converges to the constant function 0 everywhere. However, f(x)=0 anywhere except x=0.
f(x) is an example of a function with a Taylor series that converges everywhere, but agrees with f(x) at the center and nowhere else.
Despite this, Taylor series are still useful in a lot of cases. We already know a couple of functions that are represented by its Taylor series:
It's good to have these off the top of your head since they can be useful for calculating series.
Example 4.
Calculate
1−42⋅2!π2+44⋅4!π4−46⋅6!π6+⋯.
Solution.
When given a series with its terms written out, you should try to write it in sigma notation:
n=0∑∞(−1)n42n⋅(2n)!π2n.
From here, you should hopefully recognize the Taylor series expansion for cosx. If you stare at it, you'll see that its the Taylor series with x=2π plugged in:
Hopefully, the power series expansion for ex stands out here. Let's try to rewrite the sum so it looks more like the series expansion:
n=2∑∞n!2n+3=8n=2∑∞n!2n.
Now it's almost like e2, but the lower bound isn't correct, and this means that we're missing some terms. To make it more clear, we can write it like this: