Taylor polynomial approximations

Let f(x)=sin⁡x and let Tn(x) be the Taylor polynomials expanded around c=0.

By considering the alternating series error bound, find the first n for which Tn(0.02) must have error less than 10−6.

Solution

Write the Maclaurin series of sin⁡x because we are expanding around c=0:

sin⁡x=x−x33!+x55!−x77!+⋯=∑n=0∞(−1)nx2n+1(2n+1)!

This series is alternating when we insert x=0.02, so the AST error bound formula applies (“Next Term Bound”):

|En|≤an+1

Find smallest n such that an+1≤10−6, and then we know:

|En|≤an+1≤10−6≫≫|En|≤10−6

Plug x=0.02 in the series for sin⁡x:

a2n+1=(0.02)2n+1(2n+1)!

Solve for the first time a2n+1≤10−6 by listing the values:

0.0211!=0.02,0.0233!≈1.33×10−6,0.0255!≈2.67×10−11,…

The first time a2n+1 is below 10−6 happens when 2n+1=5.

This is NOT the same n as in Tn. That n is the highest power of x allowed.

The sum of prior terms is T4(0.02).

Since T4(x)=T3(x) because there is no x4 term, the final answer is n=3.

Taylor polynomials to approximate a definite integral

Approximate ∫00.3e−x2dx using a Taylor polynomial with an error no greater than 10−5.

Solution

Plug u=−x2 into the series of eu:

eu=∑n=0∞unn!≫≫e−x2=∑n=0∞(−x2)nn!≫≫∑n=0∞(−1)n1n!x2n

Find an antiderivative by terms:

∫∑n=0∞(−1)n1n!x2ndx∑n=0∞(−1)n1n!x2n+12n+1≫≫x−11!(3)x3+12!(5)x5−13!(7)x7+⋯

Plug in bounds for definite integral:

∫00.3∑n=0∞(−1)n1n!x2n=∑n=0∞(−1)n1n!x2n+12n+1|00.3≫≫∑n=0∞(−1)n1n!(0.3)2n+12n+1≫≫0.3−(0.3)33+(0.3)510−(0.3)742+⋯

Notice alternating series pattern. Apply error bound formula, “Next Term Bound”:

(0.3)510≈2.43×10−4,(0.3)742≈5.21×10−6

So we can guarantee an error less than 5.21×10−6 by summing the first terms through (0.3)510:

0.3−(0.3)33+(0.3)510=0.291243