MAT1052 · Week 6 · Taylor Series, Vectors, Dot Product
Applications of Taylor series: approximation, error, limits, sums
You learn to approximate numerical values with a Taylor polynomial, to bound the error with Taylor's inequality and the alternating series estimate, to compute limits and integrals with series, and the binomial series.
Taylor's theoremremainderLagrange error boundTaylor's inequalityalternating series estimationbinomial seriesapproximationMaclaurin series
Last week you learned to write the Taylor series. This week we put it to work: computing a number approximately by hand, bounding the error of that approximation provably, solving in one line limits for which L’Hôpital would take long, matching a series with an unknown sum to a familiar function, and computing numerically integrals that have no antiderivative. The exam most often has “approximate with error less than …” and “use series to evaluate the limit” questions.
Golden rules:
Approximation = Taylor polynomial. Error = the part that was dropped.
If the series is alternating and decreasing, the error is smaller than the first dropped term. This is the easiest bound, try it first.
If it is not alternating, Taylor’s inequality (the Lagrange error bound) is used; for M, estimate the largest value of the derivative on the interval.
In a limit, expand the numerator and denominator into series and cancel the lowest-degree term.
Taylor’s theorem and the remainder term
If f is n+1 times differentiable near a, there is a c between a and x such that
Rn is called the remainder. We do not know c, but we can bound the derivative.
Taylor’s inequality. If ∣f(n+1)(t)∣≤M between a and x, then
∣Rn(x)∣≤(n+1)!M∣x−a∣n+1.
Intuition. The remainder is very much like the next term to be added to the polynomial; only the derivative is evaluated at an unknown point c instead of a. So you can think of it as “the worst case of the next term”.
Example 1. Compute e0.1 with P3 and bound the error.
P3(0.1)=1+0.1+20.01+60.001=1.1051667.
f(4)(t)=et, whose largest value on [0,0.1] is e0.1<3 (crude but safe). M=3:
∣R3∣≤4!3(0.1)4=240.0003=1.25×10−5.
The true value is 1.1051709, the actual error is 4.3×10−6, below the bound.
PITFALL · choosing M.M must be the largest absolute value of the derivative between a and x. Choosing M=e0=1 for et is wrong; the function is increasing, and the largest value is at the right end. Putting in place of an unknown value (e0.1) a simple number that exceeds it (3) is allowed.
Alternating series estimate
If the value of x makes the series alternating and decreasing, the job is much easier: ∣Rn∣<∣first dropped term∣.
Example 2. Compute ln(1.2) with three terms of ln(1+x)=x−2x2+3x3−…
0.2−20.04+30.008=0.1826667.
The error is <4(0.2)4=0.0004. The true value is ln1.2=0.1823216, the error is 0.000345.
“How many terms are needed?” questions
Find the smallest n that brings the error bound below the desired tolerance. In the alternating case you compute the dropped terms in order; in Taylor’s inequality you solve the inequality (n+1)!M∣x−a∣n+1<ε by trying n=1,2,3,…
Example 2b. How many terms are needed to compute sin(0.5) with an error smaller than 10−6? sinx=x−3!x3+5!x5−7!x7+… is alternating and decreasing for x=0.5. Compute the terms in order:
The term x9/9! is the first to drop below 10−6. So you have to take the four terms before it (x, x3, x5, x7): 0.5−0.0208333+0.0002604−0.0000016=0.4794255. The true value is sin0.5=0.4794255.
Example 2c (with Taylor’s inequality). If you use cosx with P2=1−2x2 on the interval ∣x∣≤0.1, what is the largest the error can be? The derivatives of cos are ±sin, ±cos, all bounded by 1, M=1. But note: there is no x3 term in the series of cos, so P2=P3. The bound is better with n=3: ∣R3∣≤4!1(0.1)4≈4.2×10−6. Even if the exam says “use P2”, if you notice that it equals P3 you can write a sharper bound; but the bound given with n=2 (6(0.1)3≈1.7×10−4) is also correct, just cruder.
Intuition: how does the polynomial hug the curve?
Imagine drawing P1=1+x (the tangent line), P2, P3 next to the graph of ex. Near x=0 they all sit almost on the curve. As x grows, first P1 separates, then P2, then P3. The factor ∣x−a∣n+1 in the error formula says exactly this: as the distance from the center grows, the error grows quickly, while the (n+1)! in the denominator crushes the error as the number of terms increases. The practical conclusion: always make the approximation at a point close to the center. For ln(1.2) the series of ln(1+x) is suitable; for ln5 the same series does not work at all, because x=4 is outside the interval.
Limits with series
In 0/0 limits that would need L’Hôpital several times, expanding with series is faster and less error-prone.
Example 3.x→0limx3x−sinx=limx3x−(x−6x3+…)=lim(61−120x2+…)=61.
Example 4.x→0lim1−cosxsin(x2). Numerator: x2−6x6+… Denominator: 2x2−24x4+… Divide both by x2: 21−…1−…→2.
Rule: in the numerator and denominator, expand up to the lowest-degree nonzero term, that is enough.
Finding sums with series
See a number series as a particular value of x in a familiar Maclaurin series.
The series you see
Familiar pattern
Sum
∑n!1
ex, x=1
e
∑2n+1(−1)n
arctanx, x=1
4π
∑n≥1n2n1
−ln(1−x), x=21
ln2
∑(2n+1)!(−1)nx2n+1
sinx
sinx
Tip: if there is n! in the denominator think of ex, if (2n)! think of cos, if (2n+1)! think of sin, if only n think of ln, if 2n+1 think of arctan.
Integrals with series
∫01sin(x2)dx cannot be computed with elementary functions. Expand into a series:
If k is a positive integer the series terminates (the binomial expansion you know). Otherwise it is infinite.
Example 5.1.11: k=−21, x=0.1. 1−21(0.1)+2(−21)(−23)(0.01)=1−0.05+0.00375=0.95375. The true value is 0.95346.
Common mistakes
Wrong
Correct
Writing (x−a)n in the error bound
The power is n+1, the denominator is (n+1)!
Taking M as the derivative at the point a
The largest ∣f(n+1)∣ on the interval
Alternating estimate on a positive-term series
Only if the sign alternates and it decreases
Expanding too few terms in a limit
Expand up to the lowest-degree nonzero term
Saying 2e for ∑n!2n
Plug in x=2: e2
Calculating in degree mode
Series work with radians
Forgetting n! in the binomial coefficient
2!k(k−1), 3!k(k−1)(k−2)
Using the series outside its interval
x=2 is invalid for ln(1+x)
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Question 1easy
Use Maclaurin series to evaluate x→0limx3sinx−x.
Show answer
−1/6
sinx=x−6x3+120x5−…, so sinx−x=−6x3+120x5−…Divide by x3: −61+120x2−⋯→−61.
Question 2easy
Evaluate x→0limx3ex−1−x−2x2.
Show answer
1/6
In the series of ex the first three terms cancel in the numerator, and what remains is 6x3+24x4+…Divide by x3: 61+24x+⋯→61.
Question 3medium
Evaluate x→0limx4cosx−1+2x2.
Show answer
1/24
cosx=1−2x2+24x4−720x6+… The numerator =24x4−720x6+…Divided by x4 it gives 241. (With L'Hôpital, four derivatives would have been needed.)
Question 4medium
Evaluate x→0limx2ln(1+x)−x.
Show answer
−1/2
ln(1+x)=x−2x2+3x3−… The numerator =−2x2+3x3−…, divide by x2: −21.
Question 5easy
Find the sum n=0∑∞n!2n.
Show answer
e2
In the series ex=∑n!xn put x=2. The sum is e2≈7.389.
Question 6medium
Find the sum n=1∑∞n2n(−1)n+1.
Show answer
ln(3/2)
ln(1+x)=∑n≥1n(−1)n+1xn. The term is n(−1)n+1(1/2)n, that is, x=21 (inside the interval). The sum is ln23≈0.4055.
Question 7medium
Find the sum n=0∑∞4n(2n)!(−1)nπ2n.
Show answer
0
4nπ2n=(2π)2n. The series is ∑(2n)!(−1)n(π/2)2n=cos2π=0.
Question 8hard
Approximate ∫01e−x2dx with an error less than 0.001 using a series.
Show answer
≈0.7475
e−x2=∑n!(−1)nx2n. Term-by-term integral: ∫01=∑n!(2n+1)(−1)n=1−31+101−421+2161−13201+…Alternating series: the error is smaller than the first dropped term. 2161≈0.0046>0.001, 13201≈0.00076<0.001. Add the first five terms: 0.74749. (The true value is 0.74682, the error is 0.00066.)
Question 9easy
Find the coefficient of x6 in the Maclaurin series of e−x2.
Show answer
−1/6
eu=∑n!un, u=−x2: the x6 term comes from n=3: 3!(−x2)3=−6x6.
Question 10medium
If sin(0.1) is approximated by 0.1−6(0.1)3, give an upper bound for the error.
Show answer
≈8.3×10−8
For x=0.1 the series of sinx is alternating with decreasing terms. The error is smaller than the first dropped term:5!(0.1)5=12010−5≈8.33×10−8.
Question 11hard
Use P2(x)=1+x+2x2 to approximate e0.2 and bound the error with Taylor's inequality (use e0.2<2).
Show answer
1.22, error ≤0.00267
P2(0.2)=1+0.2+0.02=1.22. Taylor's inequality: ∣R2∣≤3!M∣x∣3, M=max∣f′′′∣=e0.2<2 (on [0,0.2]).∣R2∣≤62(0.2)3=60.016≈0.00267. (The actual error is 0.0014.) The series has positive terms, it is not alternating; the alternating estimate cannot be used here.
Question 12medium
Use the binomial series to approximate 1.02 with the first three terms.
Show answer
≈1.00995
(1+x)1/2=1+21x+221(−21)x2+⋯=1+2x−8x2+…x=0.02: 1+0.01−80.0004=1.00995. (The true value is 1.0099505.)
Verification: Approximations were compared with Math.exp/log/sin/sqrt values, error bounds with the actual error, limits at small x values, series sums with partial sums, and integrals computed with series with Simpson integration in node (verify/MAT1052/06.mjs).
Review card
f(x) = P_n(x) + R_n(x). R_n = f^(n+1)(c)/(n+1)! · (x-a)^(n+1), c between a and x
Taylor's inequality: if |f^(n+1)| ≤ M then |R_n| ≤ M|x-a|^(n+1)/(n+1)!
If the series is ALTERNATING and the terms decrease: error < first dropped term (easier)
Limit: expand the numerator with series, divide by the smallest power. (sin x - x)/x^3 = -1/6
Sum: find the familiar series: Σx^n/n! → e^x, Σ(-1)^n x^(2n)/(2n)! → cos x
Integral: expand the integrand into a series, integrate term by term; error from the alternating estimate
Binomial: (1+x)^k = 1 + kx + k(k-1)/2! x^2 + k(k-1)(k-2)/3! x^3 + ... |x|<1
√(1+x) ≈ 1 + x/2 - x^2/8 1/√(1+x) ≈ 1 - x/2 + 3x^2/8
e^(-x^2), sin(x^2): substitute u, do not differentiate
Use the calculator in RADIAN mode