Taylor polynomials are a generalization of the tangent line. If f(x) is a differentiable function, then the tangent line to f at x=a is given by
L(x)=f(a)+f′(a)(x−a).
By definition, it's the linear function which passes through the point (a,f(a)) and has slope f′(a) or equivalently, the linear function L(x) such that
L(a)L′(a)=f(a)=f′(a).
This leads to the following definition:
Definition (Taylor polynomials)
Let f(x) be a function. The n-th Taylor polynomial of f centered at x=a, which we denote Tnf(x), is the unique n-th degree polynomial whose derivatives agree with f at x=a:
These have to be the same, so the coefficients of (x−2)3 are the same, i.e.,
−4=6f(3)(2)⟹f(3)(2)=−24.
Example 2.
The fourth degree Taylor polynomial of f centered at x=1 is T3f(x)=1+2x−x2+7x3−x4. Find f′′(1).
Solution.
Be careful not to do this:
The coefficient of x2 is −1, so
1!f′′(1)=−1⟹f′′(1)=−1.
The Taylor polynomial is centered at x=1, so you can't just compare coefficients because it's not in the right form: the formula tells you what the coefficients of (x−1)k are, but in our problem, we don't have (x−1) anywhere.
Instead, you need to use the definition of T3f, which says that (T3f)′′(1)=f′′(1), so you need to calculate the second derivative of T3f at x=1.
Calculate the Maclaurin polynomials for f(x)=cosx.
Solution.
A Maclaurin polynomial is another name for a Taylor polynomial centered at x=0.
Like in the previous example, we just need to find the derivatives of f and plug them into the formula, but because the problem doesn't specify which order polynomial to find, we have to find a pattern for the general polynomial:
So the derivatives repeat every 4 times and the pattern is 1,0,−1,0. From here, it's a good idea to write out a bunch of terms for the polynomials to figure out the pattern, and I recommend not multiplying out numbers:
From here, the pattern shouldn't be too hard to pick out: it alternates, so there's going to be a (−1)n term, and there are only even powers of x, so the coefficients are of the form
(−1)k(2k)!x2k.
Also, because the odd terms are 0, you know that T2n−1f=T2nf, so to give the general formula for the Maclaurin polynomials, you only need to give the even order ones:
T2n−1f(x)=T2nf(x)=k=0∑n(−1)k(2k)!x2k
Taylor Series
I didn't talk about this during discussion, but during office hours I ended up doing a couple of examples that I thought would be helpful for the midterm, so I decided to include one in the notes this week.
There are a couple of Taylor series expansions that you want to remember:
Find the Taylor series expansion for f(x)=x3ln(1+x2) at x=0 and determine its interval of convergence.
Solution.
Usually, to do these problems, you don't want to take derivatives and find patterns. Instead, you want to relate your function to the common Taylor series expansions above using a combination of the following operations:
Multiplying by Cxk
Plugging in Cxk
Differentiating
Integrating
Then for our problem, if we can find the Taylor series for ln(1+x2), then we can just multiply by x3 to get the one for f. Similarly, if we can find it for ln(1+x), then we can just plug in x2. So, to get ln(1+x), notice that
∫1+x1dx=ln(1+x)+C.
Finally, we can get the Taylor series for 1+x1 by taking the geometric series and plugging in −x:
1+x1=1−(−x)1=n=0∑∞(−x)n=n=0∑∞(−1)nxn
When you have a convergent power series, you can integrate term-by-term, so we get
All the operations above don't change the radius of convergence, but the interval of convergence might change. This means the series still converges when x∈(−1,1), but even though the geometric series doesn't converge at the endpoints, it's possible that this new series does. In other words, you have to check the endpoints at the end to find the interval of convergence:
and this converges by the alternating series test.
x=1:
n=0∑∞n+1(−1)n12n+5=n=0∑∞n+1(−1)n,
and like the above, this converges by the alternating series test. Thus, our final answer is
x3ln(1+x2)=n=0∑∞n+1(−1)nx2n+5for x∈[−1,1].
Convergence Tests
Example 6.
Determine whether n=2∑∞(lnn)n1 converges.
Solution.
Generally, you want to start with the divergence test, and then try the root or ratio test. The divergence test is inconclusive here, so now we need to decide between the root or ratio test. Because of the n in the exponent, the root test should have an easier limit to calculate:
Since the limit is 0, this means that eventually, nalnn≤1. To show that the series converges by direct comparison, we need to find something bigger whose sum converges. We know that eventually, the inequality
0≤n2lnn≤n2na=n2−a1
is true. For the sum of n2−a1 to converge, the p-test tells us that we need 2−a>1, or equivalently, we need a<1. Since a needs to be positive, we can pick any a such that 0<a<1, so we can use a=21.
With this choice of a, we know that there exists N such that if n≥N, then lnn≤n1/2, so
0≤n2lnn≤n2n1/2=n3/21
if n≥N. By the p-test, ∑n=N∞n3/21 converges, so by direct comparison, ∑n=N∞n2lnn also converges. Thus, the entire series ∑n=1∞n2lnn converges.