Calculus3Power Series1 of 4
Power Series · 1

Taylor Polynomials and Error Bounds

1

Approximating cos⁡x\cos x with a polynomial

Polynomials only use addition and multiplication, so we can evaluate them by hand. But there's no obvious way to compute a value like cos⁡0.3\cos 0.3 by hand. To estimate it, we can look for a polynomial that stays close to cos⁡x\cos x near 00. Our closest tool so far is the tangent line at 00, the linear approximation f(0)+f′(0)x\cst{f(0)} + \lin{f'(0)x}. Since cos⁡0=1\cst{\cos 0 = 1} and −sin⁡0=0\lin{-\sin 0 = 0}, the tangent line at 00 is just y=1y = \cst{1}.

But near 00, cos⁡x\cos x is less than 11 on both sides. Its second derivative at 00 is −1\sq{-1}, so it's concave down there. The tangent line y=1y = \cst{1} has second derivative 00, so it can't be concave down.

cos⁡0=1,\cst{\cos 0 = 1},−sin⁡0=0\lin{-\sin 0 = 0}→  y=1\to\; y = \cst{1}
(cos⁡x)′′∣x=0=−cos⁡0=−1,\sq{(\cos x)''\big|_{x=0} = -\cos 0 = -1},(1)′′=0(1)'' = 0

To make our approximation concave down like cos⁡x\cos x, we can add higher powers of xx, and choose the coefficients so each new term matches one more derivative of cos⁡x\cos x at 00.

cos⁡x≈□+□ x+□ x2+□ x3+□ x4,□=  ?\displaystyle \cos x \approx \cst{\square} + \lin{\square\,x} + \sq{\square\,x^2} + \cub{\square\,x^3} + \qrt{\square\,x^4}, \qquad {\square = \;?}
cos⁡x≈□+□ x+□ x2+□ x3+□ x4,□=  ?\displaystyle \begin{gathered}\cos x \approx \cst{\square} + \lin{\square\,x} + \sq{\square\,x^2}\\ + \cub{\square\,x^3} + \qrt{\square\,x^4}, \qquad \square = \;?\end{gathered}
Match derivatives at 00 to find a fourth-degree polynomial for cos⁡x\cos x
−1-1
11
−2-2
22
xx
yy
cos⁡x\cos x
Text solution
Value at 00Substituting x=0x = 0 makes every term with an xx equal 00, so only the constant box is left.
□\displaystyle \cst{\square} =cos⁡0\displaystyle = \cst{\cos 0} =1\displaystyle = \cst{1}
Each derivative keeps one boxDifferentiating kk times turns the powers below xkx^k into 00, and the powers above still have an xx, so at x=0x = 0 only the xkx^k box is left, times the numbers the power rule brought down. For the second derivative:
2⋅1 □\displaystyle \sq{2\cdot 1\,\square} =−cos⁡0\displaystyle = \sq{-\cos 0} =−1  →  □\displaystyle = \sq{-1} \;\to\; \sq{\square} =−12\displaystyle = \sq{-\frac{1}{2}}
The other boxesThe first and third derivatives of cos⁡x\cos x at 00 are −sin⁡0=0\lin{-\sin 0 = 0} and sin⁡0=0\cub{\sin 0 = 0}, so those boxes are 00. The fourth brings down 4⋅3⋅2⋅14\cdot 3\cdot 2\cdot 1.
4⋅3⋅2⋅1 □\displaystyle \qrt{4\cdot 3\cdot 2\cdot 1\,\square} =cos⁡0\displaystyle = \qrt{\cos 0} =1  →  □\displaystyle = \qrt{1} \;\to\; \qrt{\square} =124\displaystyle = \qrt{\frac{1}{24}}

The numbers in front of each box are factorials. For the xkx^k term, differentiating kk times multiplies its box by k(k−1)⋯1k(k-1)\cdots 1, which is k!k!. So the box for xkx^k is the kkth derivative of cos⁡x\cos x at 00, divided by k!k!.

2!=2⋅1=2,\sq{2! = 2\cdot 1} = 2,3!=3⋅2⋅1=6,\cub{3! = 3\cdot 2\cdot 1} = 6,4!=4⋅3⋅2⋅1=24,\qrt{4! = 4\cdot 3\cdot 2\cdot 1} = 24,0!=1!=10! = 1! = 1

Matching the value and the first four derivatives gives P4(x)P_4(x), the Taylor polynomial of degree 44 for cos⁡x\cos x at 00. It stays close to cos⁡x\cos x much farther from 00 than the tangent line does.

−1-1
11
−3-3
−2-2
22
33
−1-1
xx
yy
y=1\htmlClass{lc-pink}{y = 1}
P4\htmlClass{lc-orange}{P_4}
P2\htmlClass{lc-green}{P_2}
cos⁡x\cos x
P4(x)=1−x22!+x44!=1−x22+x424\displaystyle \begin{aligned}P_4(x) &= \cst{1} - \sq{\frac{x^2}{2!}} + \qrt{\frac{x^4}{4!}}\\ &= \cst{1} - \sq{\frac{x^2}{2}} + \qrt{\frac{x^4}{24}}\end{aligned}

Since the x3\cub{x^3} box is 0\cub{0}, the degree-3 Taylor polynomial P3(x)P_3(x) is the same as P2(x)P_2(x). Degree 33 means the highest power allowed is x3x^3, not that there must be four separate terms.

P3(x)\displaystyle P_3(x) =1−x22+0⋅x3\displaystyle = {\cst{1} - \sq{\frac{x^2}{2}} + \cub{0\cdot x^3}} =1−x22\displaystyle = {\cst{1} - \sq{\frac{x^2}{2}}} =P2(x)\displaystyle = P_2(x)
2

The Taylor polynomial for any function

For cos⁡x\cos x, we matched each derivative at 00 by choosing the number in front of each power of xx. We can do the same thing for any function ff near 00.

Differentiating xkx^k exactly kk times gives k!k!, and every other term becomes 00 when we plug in x=0x = 0. So the kkth derivative of the polynomial at 00 is just k!k! times the coefficient of xkx^k. Matching that to f(k)(0)f^{(k)}(0) means the coefficient of xkx^k is f(k)(0)k!\frac{f^{(k)}(0)}{k!}. We write f(4)\qrt{f^{(4)}} for the fourth derivative.

f(0)+f′(0) x+f′′(0)2! x2+f′′′(0)3! x3+f(4)(0)4! x4\displaystyle \cst{f(0)} + \lin{f'(0)\,x} + \sq{\frac{f''(0)}{2!}\,x^2} + \cub{\frac{f'''(0)}{3!}\,x^3} + \qrt{\frac{f^{(4)}(0)}{4!}\,x^4}
f(0)+f′(0) x+f′′(0)2! x2+f′′′(0)3! x3+f(4)(0)4! x4\displaystyle \begin{aligned}&\cst{f(0)} + \lin{f'(0)\,x} + \sq{\frac{f''(0)}{2!}\,x^2}\\ &\quad + \cub{\frac{f'''(0)}{3!}\,x^3} + \qrt{\frac{f^{(4)}(0)}{4!}\,x^4}\end{aligned}

Let's try this on exe^x. The derivative of exe^x is always exe^x, and e0=1e^0 = 1. So every derivative at 00 is 11, which means every coefficient is 1k!\frac{1}{k!}. None of them are 00, so unlike cos⁡x\cos x, every power of xx appears.

f(0)\displaystyle \cst{f(0)} =f′(0)\displaystyle = \lin{f'(0)} =f′′(0)\displaystyle = \sq{f''(0)} =f′′′(0)\displaystyle = \cub{f'''(0)} =e0\displaystyle = e^0 =1\displaystyle = 1
P3(x)\displaystyle P_3(x) =1+x+x22!+x33!\displaystyle = \cst{1} + \lin{x} + \sq{\frac{x^2}{2!}} + \cub{\frac{x^3}{3!}} =1+x+x22+x36\displaystyle = \cst{1} + \lin{x} + \sq{\frac{x^2}{2}} + \cub{\frac{x^3}{6}}

For sin⁡x\sin x, the derivatives at 00 cycle through 0,1,0,−1,0,1\cst{0}, \lin{1}, \sq{0}, \cub{-1}, \qrt{0}, 1. Because every even derivative at 00 is 00, all the even-power terms are 00. That leaves only the odd powers, with alternating signs.

sin⁡0=0,\cst{\sin 0 = 0},cos⁡0=1,\lin{\cos 0 = 1},−sin⁡0=0,\sq{-\sin 0 = 0},−cos⁡0=−1,\cub{-\cos 0 = -1},sin⁡0=0,\qrt{\sin 0 = 0},cos⁡0=1\cos 0 = 1
P5(x)\displaystyle P_5(x) =x−x33!+x55!\displaystyle = \lin{x} - \cub{\frac{x^3}{3!}} + \frac{x^5}{5!} =x−x36+x5120\displaystyle = \lin{x} - \cub{\frac{x^3}{6}} + \frac{x^5}{120}

A Taylor polynomial centered at 00 is also called a Maclaurin polynomial.

Does increasing the degree always add a term?

3

Centering at a number other than 00

We can't build a polynomial for ln⁡x\ln x at 00: ln⁡0\ln 0 isn't defined, and neither is its derivative 1x\frac{1}{x} at 00. At x=1x = 1, though, ln⁡1=0\cst{\ln 1 = 0}, so let's build our polynomial around 11 instead, in powers of x−1x - 1.

ln⁡x≈□+□ (x−1)+□ (x−1)2+□ (x−1)3near x=1,□=  ?\displaystyle \begin{gathered}\ln x \approx \cst{\square} + \lin{\square\,(x-1)} + \sq{\square\,(x-1)^2} + \cub{\square\,(x-1)^3}\\ \text{near } x = 1, \qquad \square = \;?\end{gathered}
ln⁡x≈□+□ (x−1)+□ (x−1)2+□ (x−1)3near x=1,□=  ?\displaystyle \begin{gathered}\ln x \approx \cst{\square} + \lin{\square\,(x-1)}\\ + \sq{\square\,(x-1)^2} + \cub{\square\,(x-1)^3}\\ \text{near } x = 1, \qquad \square = \;?\end{gathered}

Powers of x−1x - 1 do at x=1x = 1 what powers of xx did at 00: each one becomes 00, so only the first box remains. With plain powers of xx, every power of 11 is 11, and all the boxes would get added together.

Powers of x − 1
□+□ (x−1)+□ (x−1)2+□ (x−1)3  ∣x=1=□\displaystyle \begin{aligned}&\cst{\square} + \lin{\square\,(x-1)} + \sq{\square\,(x-1)^2}\\ &\quad + \cub{\square\,(x-1)^3} \;\Big|_{x=1}\\ &= \cst{\square}\end{aligned}
Powers of x
□+□ x+□ x2+□ x3  ∣x=1=□+□+□+□\displaystyle \begin{aligned}&\cst{\square} + \lin{\square\,x} + \sq{\square\,x^2}\\ &\quad + \cub{\square\,x^3} \;\Big|_{x=1}\\ &= \cst{\square} + \lin{\square} + \sq{\square} + \cub{\square}\end{aligned}
Find the third-degree Taylor polynomial for ln⁡x\ln x about x=1x = 1
11
22
11
xx
yy
ln⁡x\ln x
Text solution
Derivatives at 11As at 00, the kkth derivative at 11 keeps only the (x−1)k(x - 1)^k box, times k!k!. So we need the derivatives of ln⁡x\ln x at 11.
ln⁡x1x−1x22x301−12\displaystyle \begin{array}{cccc}\cst{\ln x} & \lin{\dfrac{1}{x}} & \sq{-\dfrac{1}{x^2}} & \cub{\dfrac{2}{x^3}}\\[10pt] \cst{0} & \lin{1} & \sq{-1} & \cub{2}\end{array}
Divide by k!k!
P3(x)=0+1⋅(x−1)+−12! (x−1)2+23! (x−1)3=(x−1)−(x−1)22+(x−1)33\displaystyle \begin{aligned}P_3(x) &= \cst{0} + \lin{1\cdot(x-1)} + \sq{\frac{-1}{2!}\,(x-1)^2} + \cub{\frac{2}{3!}\,(x-1)^3}\\ &= \lin{(x-1)} - \sq{\frac{(x-1)^2}{2}} + \cub{\frac{(x-1)^3}{3}}\end{aligned}
P3(x)=0+1⋅(x−1)+−12! (x−1)2+23! (x−1)3=(x−1)−(x−1)22+(x−1)33\displaystyle \begin{aligned}P_3(x) &= \cst{0} + \lin{1\cdot(x-1)}\\ &\quad + \sq{\frac{-1}{2!}\,(x-1)^2}\\ &\quad + \cub{\frac{2}{3!}\,(x-1)^3}\\ &= \lin{(x-1)} - \sq{\frac{(x-1)^2}{2}}\\ &\quad + \cub{\frac{(x-1)^3}{3}}\end{aligned}
Estimate ln⁡0.8\ln 0.8At x=0.8x = 0.8, x−1=−0.2x - 1 = -0.2.
ln⁡0.8≈P3(0.8)≈−0.2−0.02−0.00267\displaystyle \ln 0.8 \approx P_3(0.8) \approx \lin{-0.2} - \sq{0.02} - \cub{0.00267} =−0.22267\displaystyle = -0.22267

Each new degree stays close to ln⁡x\ln x farther from 11. At 0.80.8, the true value is ln⁡0.8≈−0.22314\ln 0.8 \approx -0.22314, so with just three terms the estimate agrees to about three decimal places.

0.50.5
1.51.5
22
2.52.5
11
xx
ln⁡x\ln x
P1\htmlClass{lc-blue}{P_1}
P2\htmlClass{lc-green}{P_2}
P3\htmlClass{lc-violet}{P_3}

For any center aa, powers of x−ax - a work the same way. Plugging in aa makes each (x−a)k(x - a)^k equal 00, and the kkth derivative of (x−a)k(x - a)^k is k!k!, so the coefficient in front of (x−a)k(x - a)^k is always f(k)(a)k!\frac{f^{(k)}(a)}{k!}.

f(a)+f′(a) (x−a)+f′′(a)2! (x−a)2+f′′′(a)3! (x−a)3\displaystyle \cst{f(a)} + \lin{f'(a)\,(x-a)} + \sq{\frac{f''(a)}{2!}\,(x-a)^2} + \cub{\frac{f'''(a)}{3!}\,(x-a)^3}
f(a)+f′(a) (x−a)+f′′(a)2! (x−a)2+f′′′(a)3! (x−a)3\displaystyle \begin{aligned}&\cst{f(a)} + \lin{f'(a)\,(x-a)}\\ &\quad + \sq{\frac{f''(a)}{2!}\,(x-a)^2}\\ &\quad + \cub{\frac{f'''(a)}{3!}\,(x-a)^3}\end{aligned}

We leave P3P_3 in powers of x−1x - 1 rather than expanding it, because the coefficient of each (x−1)k(x - 1)^k shows f(k)(1)k!\frac{f^{(k)}(1)}{k!} directly.

4

Reading derivatives from a Taylor polynomial

That rule also works backwards. Suppose we're given a Taylor polynomial for ff about 22, but no formula for ff. We can still find ff and its derivatives at 22, and use them to decide whether ff has a local maximum there.

Find f(2)\cst{f(2)}, f′(2)\lin{f'(2)}, f′′(2)\sq{f''(2)} and f′′′(2)\cub{f'''(2)} from P3(x)=5P_3(x) = \cst{5} −3(x−2)2{}- \sq{3(x-2)^2} +4(x−2)3{}+ \cub{4(x-2)^3}, and decide if ff has a local maximum at 22
P3(x)\displaystyle P_3(x) =5−3(x−2)2+4(x−2)3\displaystyle = \cst{5} - \sq{3(x-2)^2} + \cub{4(x-2)^3}
f(2)\displaystyle \cst{f(2)} =  ?f′(2)\displaystyle = \;?\qquad \lin{f'(2)} =  ?\displaystyle = \;?
f′′(2)\displaystyle \sq{f''(2)} =  ?f′′′(2)\displaystyle = \;?\qquad \cub{f'''(2)} =  ?\displaystyle = \;?
local maximum at x\displaystyle \text{local maximum at } x =2 ?\displaystyle = 2\,?
Text solution
Multiply each coefficient by k!k!The coefficient of (x−2)k(x - 2)^k is f(k)(2)k!\frac{f^{(k)}(2)}{k!}, so f(k)(2)f^{(k)}(2) is k!k! times it. There's no (x−2)\lin{(x - 2)} term, so f′(2)=0\lin{f'(2) = 0}. And f′′(2)\sq{f''(2)} is −6\sq{-6}, not −3\sq{-3}.
f(2)=5f′(2)=0f′′(2)=2!⋅(−3)=−6f′′′(2)=3!⋅4=24\displaystyle \begin{aligned}\cst{f(2)} &= \cst{5}\\ \lin{f'(2)} &= \lin{0}\\ \sq{f''(2)} &= \sq{2!\cdot(-3)} = \sq{-6}\\ \cub{f'''(2)} &= \cub{3!\cdot 4} = \cub{24}\end{aligned}
Second Derivative TestThe tangent line at x=2x = 2 is horizontal and ff is concave down there, so ff has a local maximum at x=2x = 2.
f′(2)=0,f′′(2)=−6<0\displaystyle \lin{f'(2) = 0}, \qquad \sq{f''(2) = -6} < 0

We can also see the maximum in the polynomial itself. Near 22, the cubic term is tiny next to the squared term: at x=2.1x = 2.1, we subtract 0.03\sq{0.03} and add only 0.004\cub{0.004}. So P3(x)P_3(x) looks almost exactly like the downward-opening parabola 5−3(x−2)2\cst{5} - \sq{3(x - 2)^2}, which has its highest point at (2,5)\cst{(2, 5)}.

1.81.8
22
2.22.2
2.42.4
4.44.4
4.64.6
4.84.8
55
(2, 5)\htmlClass{lc-pink}{(2,\ 5)}
P3\htmlClass{lc-violet}{P_3}
5−3(x−2)2\htmlClass{lc-green}{5 - 3(x-2)^2}
5

How far off a Taylor polynomial can be

We can use the second-degree Taylor polynomial for exe^x about 0\ctr{0} to estimate e0.2e^{\xp{0.2}}.

P2(x)=1+x+x22P2(0.2)=1+0.2+0.02=1.22\displaystyle \begin{aligned}P_2(x) &= 1 + x + \frac{x^2}{2}\\ P_2(0.2) &= 1 + 0.2 + 0.02 = 1.22\end{aligned}

But we don't know the exact value of e0.2e^{\xp{0.2}}, which is the reason we're estimating it in the first place. So how far off can 1.221.22 be? On the graph, the error is the length of the vertical segment at x=0.2\xp{x = 0.2}, from the polynomial up to the curve y=exy = e^x.

0\htmlClass{lc-blue}{0}
0.2\htmlClass{lc-orange}{0.2}
11
1.11.1
1.21.2
exe^x
P2\htmlClass{lc-green}{P_2}
0.2\htmlClass{lc-orange}{0.2}
e0.2−P2(0.2)\htmlClass{lc-pink}{e^{0.2} - P_2(0.2)}
exe^x
P2\htmlClass{lc-green}{P_2}
Find a bound on the error of P2(0.2)=1.22P_2(0.2) = 1.22 as an estimate of e0.2e^{\xp{0.2}}
0\htmlClass{lc-blue}{0}
0.2\htmlClass{lc-orange}{0.2}
11
1.11.1
1.21.2
xx
yy
exe^x
e0.2e^{\htmlClass{lc-orange}{0.2}}
Text solution
The error is the first term left outStopping at degree 22 leaves out e03! x3\frac{e^0}{3!}\,x^3. The error at 0.2\xp{0.2} is that term with e0e^0 changed to ec\cm{e^c}, for some c\cm{c} between 0\ctr{0} and 0.2\xp{0.2}.
e0.2−P2(0.2)\displaystyle \er{e^{0.2} - P_2(0.2)} =ec3! (0.2)3\displaystyle = \frac{\cm{e^c}}{3!}\,(0.2)^3
Why: degree 00 and the Mean Value TheoremAt degree 00, the first term left out is f′(a)(x−a)f'(\ctr{a})(\xp{x} - \ctr{a}), and the Mean Value Theorem makes the error that same term with the derivative at c\cm{c}.
P0(x)=f(a)f(x)−f(a)=f′(c) (x−a)\displaystyle \begin{aligned}P_0(x) &= f(\ctr{a})\\ \er{f(x) - f(a)} &= \cm{f'(c)}\,(\xp{x} - \ctr{a})\end{aligned}
Bound ec\cm{e^c} by M=3\cm{M = 3}We can't find c\cm{c}, because it's different for each x\xp{x}. If it were the same, exe^x would be a cubic. But exe^x is increasing, so ec\cm{e^c} is at most e0.2e^{\xp{0.2}}.
ec\displaystyle \cm{e^c} ≤e0.2<e<3,M=3\displaystyle \le e^{\xp{0.2}} < e < \cm{3}, \qquad \cm{M = 3}
e0.2−1.22\displaystyle \er{e^{0.2} - 1.22} ≤3⋅(0.2)33!\displaystyle \le \cm{3}\cdot\frac{(0.2)^3}{3!} =3⋅0.0086\displaystyle = \frac{3\cdot 0.008}{6} =0.004\displaystyle = 0.004

So without knowing e0.2e^{\xp{0.2}}, we know 1.221.22 is off by at most 0.0040.004. The true value is about 1.22141.2214, so the actual error, about 0.00140.0014, is well within the bound.

This upper bound is called the Lagrange error bound. We replace the unknown derivative with M\cm{M}, a number at least as large as the size of that derivative between the center and x\xp{x}. For a degree-2 polynomial, the error is at most M\cm{M} times the distance to the center cubed, divided by 3!3!.

e0.2−P2(0.2)\displaystyle \er{e^{0.2} - P_2(0.2)} ≤M⋅(0.2)33!\displaystyle \le \cm{M}\cdot\frac{(0.2)^3}{3!}
6

Overestimate or underestimate, and finding M\cm{M}

In Section 3, the third-degree Taylor polynomial for ln⁡x\ln x about 1\ctr{1} estimated ln⁡0.8\ln \xp{0.8} as −0.22267-0.22267. Is that estimate too high or too low, and how far off can it be? To find out, we look at the first term we left out, which has the fourth derivative of ln⁡x\ln x, the derivative of 2t3\frac{2}{t^3}.

ln⁡t,\displaystyle \ln t,1t,\displaystyle \frac{1}{t},−1t2,\displaystyle -\frac{1}{t^2},2t3,\displaystyle \frac{2}{t^3},f(4)(t)=−6t4\displaystyle f^{(4)}(t) = -\frac{6}{t^4}
Check whether P3(0.8)P_3(\xp{0.8}) overestimates or underestimates ln⁡0.8\ln \xp{0.8}, and bound the error
0.8\htmlClass{lc-orange}{0.8}
1\htmlClass{lc-blue}{1}
1.21.2
xx
yy
ln⁡x\ln x
P3\htmlClass{lc-violet}{P_3}
Text solution
The sign of the errorc\cm{c} is between 0.8\xp{0.8} and 1\ctr{1}, so it's positive and −6c4\cm{-\frac{6}{c^4}} is negative. (−0.2)4(-0.2)^4 is positive, so the error is negative, and P3(0.8)P_3(\xp{0.8}) is an overestimate.
ln⁡0.8−P3(0.8)\displaystyle \er{\ln 0.8 - P_3(0.8)} =−6c4⋅(−0.2)44!<0\displaystyle = \cm{-\frac{6}{c^4}}\cdot\frac{(-0.2)^4}{4!} < 0
ln⁡0.8−P3(0.8)=−6c4⋅(−0.2)44!<0\displaystyle \begin{aligned}&\er{\ln 0.8 - P_3(0.8)}\\ &\quad = \cm{-\frac{6}{c^4}}\cdot\frac{(-0.2)^4}{4!} < 0\end{aligned}
P3(0.8)>ln⁡0.8\displaystyle P_3(0.8) > \ln 0.8
The size of the errorTake absolute values, and replace ∣f(4)(c)∣\cm{|f^{(4)}(c)|} with M\cm{M}, the largest value of 6t4\frac{6}{t^4} on [0.8,1][\xp{0.8}, \ctr{1}].
∣ln⁡0.8−P3(0.8)∣=∣f(4)(c)∣4! ∣0.8−1∣4∣f(4)(t)∣=6t4\displaystyle \begin{aligned}\er{\big|\ln 0.8 - P_3(0.8)\big|} &= \frac{\cm{|f^{(4)}(c)|}}{4!}\,|\xp{0.8} - \ctr{1}|^4\\ |f^{(4)}(t)| &= \frac{6}{t^4}\end{aligned}
∣ln⁡0.8−P3(0.8)∣=∣f(4)(c)∣4! ∣0.8−1∣4∣f(4)(t)∣=6t4\displaystyle \begin{aligned}&\er{\big|\ln 0.8 - P_3(0.8)\big|}\\ &\quad = \frac{\cm{|f^{(4)}(c)|}}{4!}\,|\xp{0.8} - \ctr{1}|^4\\ &|f^{(4)}(t)| = \frac{6}{t^4}\end{aligned}

Finding M\cm{M} is the step to remember. As tt increases, 6t4\frac{6}{t^4} decreases, so on [0.8,1][\xp{0.8}, \ctr{1}] it's largest at the left end, t=0.8t = \xp{0.8}. We round 14.6\cm{14.6} up to M=15\cm{M = 15}, and the error is at most 0.0010.001. In fact, ln⁡0.8≈−0.22314\ln \xp{0.8} \approx -0.22314, so the actual error is about −0.00048-0.00048.

0.8\htmlClass{lc-orange}{0.8}
1\htmlClass{lc-blue}{1}
1.21.2
tt
55
1010
2020
M=15\htmlClass{lc-violet}{M = 15}
14.6\htmlClass{lc-violet}{14.6}
6t4\dfrac{6}{t^4}
x=0.8 ⁣:on [0.8,1]\displaystyle \xp{x = 0.8}\colon \quad \text{on } [\xp{0.8}, \ctr{1}]
6t4≤60.84≈14.6M=15\displaystyle \begin{aligned}\frac{6}{t^4} &\le \frac{6}{\xp{0.8}^4} \approx \cm{14.6}\\ \cm{M} &= \cm{15}\end{aligned}
∣ln⁡0.8−P3(0.8)∣≤15⋅(0.2)44!=15⋅0.001624=0.001\displaystyle \begin{aligned}&\er{\big|\ln 0.8 - P_3(0.8)\big|}\\ &\quad \le \cm{15}\cdot\frac{(0.2)^4}{4!}\\ &\quad = \frac{15\cdot 0.0016}{24} = 0.001\end{aligned}

To estimate ln⁡1.2\ln \xp{1.2} instead, the interval is [1,1.2][\ctr{1}, \xp{1.2}]. 6t4\frac{6}{t^4} is still largest at the left end, but now the left end is the center, so M=6\cm{M = 6}.

x=1.2 ⁣:on [1,1.2]\displaystyle \xp{x = 1.2}\colon \quad \text{on } [\ctr{1}, \xp{1.2}]
6t4≤614=6M=6\displaystyle \begin{aligned}\frac{6}{t^4} &\le \frac{6}{\ctr{1}^4} = \cm{6}\\ \cm{M} &= \cm{6}\end{aligned}

Some functions make M\cm{M} easy. For sin⁡x\sin x and cos⁡x\cos x, every derivative is ±sin⁡t\pm\sin t or ±cos⁡t\pm\cos t, so its absolute value is at most 1\cm{1}, and we can always choose M=1\cm{M = 1}.

Is the next derivative always largest in size at x?

7

Approximating ee to within 0.001\er{0.001}

The error bound can also tell us how many terms we need. Let's find the lowest-degree Taylor polynomial for exe^x about 0\ctr{0} that gives ee with an error under 0.001\er{0.001}. Since e=e1e = e^{\xp{1}}, we're evaluating the polynomial at x=1\xp{x = 1}, and we'll test degrees one by one.

Find the lowest-degree Taylor polynomial for exe^x about 0\ctr{0} that gives ee with error under 0.001\er{0.001}
∣e−Pn(1)∣<0.001\displaystyle \er{\big|e - P_n(1)\big|} < \er{0.001}
lowest n\displaystyle \text{lowest } n =  ?\displaystyle = \;?
Text solution
M=3\cm{M = 3} at every degreeEvery derivative of exe^x is exe^x, which is increasing, so on [0,1][\ctr{0}, \xp{1}] it's at most ee, and e<3e < 3.
f(k)(t)\displaystyle f^{(k)}(t) =et\displaystyle = e^t ≤e1<3,M=3\displaystyle \le e^{\xp{1}} < \cm{3}, \qquad \cm{M = 3}
Test degreesFor degree nn, the bound is 3\cm{3} times the first term left out at x=1\xp{x = 1}. Degree 66 is the first one under 0.001\er{0.001}.
n=4 ⁣:3⋅155!=3120=0.025n=5 ⁣:3⋅166!=3720≈0.0042n=6 ⁣:3⋅177!=35040≈0.0006<0.001\displaystyle \begin{aligned}n = 4\colon&\quad \cm{3}\cdot\frac{1^5}{5!} = \frac{3}{120} = 0.025\\ n = 5\colon&\quad \cm{3}\cdot\frac{1^6}{6!} = \frac{3}{720} \approx 0.0042\\ n = 6\colon&\quad \cm{3}\cdot\frac{1^7}{7!} = \frac{3}{5040} \approx 0.0006 < \er{0.001}\end{aligned}
n=4 ⁣:3⋅155!=0.025n=5 ⁣:3⋅166!≈0.0042n=6 ⁣:3⋅177!≈0.00060.0006<0.001\displaystyle \begin{aligned}n = 4\colon&\quad \cm{3}\cdot\frac{1^5}{5!} = 0.025\\ n = 5\colon&\quad \cm{3}\cdot\frac{1^6}{6!} \approx 0.0042\\ n = 6\colon&\quad \cm{3}\cdot\frac{1^7}{7!} \approx 0.0006\\ &\quad 0.0006 < \er{0.001}\end{aligned}
Check with P6(1)P_6(1)Since e=2.71828…e = 2.71828\dots, the actual error is about 0.00020.0002.
P6(1)\displaystyle P_6(1) =1+1+12+16+124+1120+1720≈2.7181\displaystyle = {1 + 1 + \frac{1}{2} + \frac{1}{6} + \frac{1}{24} + \frac{1}{120} + \frac{1}{720} \approx 2.7181}
P6(1)=1+1+12+16+124+1120+1720≈2.7181\displaystyle \begin{aligned}P_6(1) &= 1 + 1 + \frac{1}{2} + \frac{1}{6}\\ &\quad + \frac{1}{24} + \frac{1}{120} + \frac{1}{720}\\ &\approx 2.7181\end{aligned}

M\cm{M} stayed 3\cm{3} for every degree only because every derivative of exe^x is exe^x. For a function like ln⁡x\ln x, each new degree brings a different derivative and a new value for M\cm{M}.

Summary

Building a Taylor polynomial about aa
f(a)+f′(a) (x−a)+f′′(a)2! (x−a)2+f′′′(a)3! (x−a)3+⋯\displaystyle {\cst{f(a)} + \lin{f'(a)\,(x-a)} + \sq{\frac{f''(a)}{2!}\,(x-a)^2} + \cub{\frac{f'''(a)}{3!}\,(x-a)^3} + \cdots}
f(a)+f′(a) (x−a)+f′′(a)2! (x−a)2+f′′′(a)3! (x−a)3+⋯\displaystyle \begin{aligned}&\cst{f(a)} + \lin{f'(a)\,(x-a)}\\ &\quad + \sq{\frac{f''(a)}{2!}\,(x-a)^2}\\ &\quad + \cub{\frac{f'''(a)}{3!}\,(x-a)^3} + \cdots\end{aligned}

To center a Taylor polynomial at aa, write it in powers of x−ax - a. The coefficient of (x−a)k(x - a)^k is f(k)(a)k!\frac{f^{(k)}(a)}{k!}, because differentiating (x−a)k(x - a)^k kk times brings down k!k!, and every other term is 00 at x=ax = a. When a=0a = 0, these powers are just powers of xx.

Degree and missing terms
cos⁡x ⁣:P3(x)=P2(x)=1−x22\displaystyle {\cos x\colon \qquad P_3(x) = P_2(x) = \cst{1} - \sq{\frac{x^2}{2}}}
cos⁡x ⁣:P3(x)=P2(x)=1−x22\displaystyle \begin{aligned}&\cos x\colon\\ &P_3(x) = P_2(x) = \cst{1} - \sq{\frac{x^2}{2}}\end{aligned}

The degree is the highest power of x−ax - a allowed, not the number of terms. For cos⁡x\cos x at 00, the third derivative is 0\cub{0}, so the x3\cub{x^3} term is 0\cub{0} and P3(x)P_3(x) is the same polynomial as P2(x)P_2(x).

Reading derivatives from a polynomial
5−3(x−2)2+4(x−2)3 ⁣:f′(2)=0,f′′(2)=2!⋅(−3)=−6\displaystyle \cst{5} - \sq{3(x-2)^2} + \cub{4(x-2)^3}\colon \qquad \lin{f'(2) = 0}, \quad \sq{f''(2) = 2!\cdot(-3) = -6}
5−3(x−2)2+4(x−2)3 ⁣:f′(2)=0f′′(2)=2!⋅(−3)=−6\displaystyle \begin{aligned}&\cst{5} - \sq{3(x-2)^2} + \cub{4(x-2)^3}\colon\\ &\lin{f'(2) = 0}\\ &\sq{f''(2) = 2!\cdot(-3) = -6}\end{aligned}

To find f(k)(a)f^{(k)}(a) from a Taylor polynomial about aa, multiply the coefficient of (x−a)k(x-a)^k by k!k!. If a power up to the polynomial's degree is missing, that derivative at aa is 00. In 5−3(x−2)2+4(x−2)3\cst{5} - \sq{3(x-2)^2} + \cub{4(x-2)^3}, the x−2\lin{x - 2} term is missing, so f′(2)=0\lin{f'(2) = 0}. That makes x=2x = 2 a critical point, and because f′′(2)=−6<0\sq{f''(2) = -6} < 0, the graph is concave down and ff has a local maximum at 22.

The Lagrange error bound
e0.2−P2(0.2)\displaystyle \er{e^{0.2} - P_2(0.2)} =ec3! (0.2)3\displaystyle = \frac{\cm{e^c}}{3!}\,(0.2)^3 ≤3⋅(0.2)33!\displaystyle \le \cm{3}\cdot\frac{(0.2)^3}{3!}

The error from stopping at degree nn is the first term left out, with its derivative evaluated at some unknown number c\cm{c} between the center a\ctr{a} and x\xp{x}. Because we don't know c\cm{c}, we replace ∣f(n+1)(c)∣\cm{|f^{(n+1)}(c)|} with an upper bound M\cm{M}. So the size of the error is at most M∣x−a∣n+1(n+1)!\cm{M}\frac{|\xp{x} - \ctr{a}|^{n+1}}{(n+1)!}.

Choosing M\cm{M}

M\cm{M} must be at least as large as the absolute value of the next derivative everywhere between the center a\ctr{a} and x\xp{x}. If ∣f(n+1)∣|f^{(n+1)}| is decreasing across the interval, its largest value is at the left end. If it's increasing, its largest value is at the right end. Any larger number works for M\cm{M}, so we can round up to a simple value. For sin⁡x\sin x and cos⁡x\cos x, every derivative has absolute value at most 1\cm{1}, so M=1\cm{M = 1} always works.

Deciding if an estimate is too high or too low

The sign of the error comes from the first term left out, f(n+1)(c)(n+1)! (x−a)n+1\frac{\cm{f^{(n+1)}(c)}}{(n+1)!}\,(\xp{x} - \ctr{a})^{n+1}, with c\cm{c} between the center a\ctr{a} and x\xp{x}. If that term is negative, then f(x)−Pn(x)<0\er{f(x) - P_n(x)} < 0, so Pn(x)>f(x)P_n(x) > f(x) and the estimate is an overestimate. If that term is positive, the estimate is an underestimate. For ln⁡0.8\ln \xp{0.8} with center 1\ctr{1}, the fourth derivative −6c4\cm{-\frac{6}{c^4}} is negative and (−0.2)4(-0.2)^4 is positive, so the error is negative. That means P3(0.8)>ln⁡0.8P_3(0.8) > \ln 0.8, so the estimate is an overestimate.

Finding the least degree for a target error

To find the least degree that guarantees an error under a given target, test degrees n=1,2,3,…n = 1, 2, 3, \dots one by one until M∣x−a∣n+1(n+1)!\cm{M}\frac{|\xp{x} - \ctr{a}|^{n+1}}{(n+1)!} is less than the target. For exe^x, every derivative is exe^x, so the same bound M=3\cm{M = 3} works for every degree on [0,1][\ctr{0}, \xp{1}]. For ln⁡x\ln x, each higher degree brings a new derivative, so find a new M\cm{M} at each step.

8

Practice

Enter exact values unless a problem asks for a decimal.

1
Find the first three nonzero terms of the Taylor polynomial for f(x)=cos⁡2xf(x) = \cos 2x about x=0x = 0.

The chain rule gives (cos⁡2x)′=−2sin⁡2x(\cos 2x)' = -2\sin 2x. What is (cos⁡2x)′′(\cos 2x)''?

If you got 1−x22+x4241 - \dfrac{x^2}{2} + \dfrac{x^4}{24} Check the chain rule. Each derivative brings out a factor of 22, so (cos⁡2x)′′(\cos 2x)'' is −4cos⁡2x-4\cos 2x, not −cos⁡2x-\cos 2x.

If you got 1−4x2+16x41 - 4x^2 + 16x^4 Remember to divide each derivative by k!k! to get the coefficient of xkx^k.

Find the derivatives at 00Differentiate cos⁡2x\cos 2x using the chain rule until there are three nonzero values at x=0x = 0.
cos⁡2x−2sin⁡2x−4cos⁡2x8sin⁡2x16cos⁡2xx=0:10−4016\displaystyle \begin{array}{rccccc} & \cst{\cos 2x} & \lin{-2\sin 2x} & \sq{-4\cos 2x} & \cub{8\sin 2x} & \qrt{16\cos 2x}\\[6pt] x = 0: & \cst{1} & \lin{0} & \sq{-4} & \cub{0} & \qrt{16}\end{array}
cos⁡2x∣x=0=1−2sin⁡2x∣x=0=0−4cos⁡2x∣x=0=−48sin⁡2x∣x=0=016cos⁡2x∣x=0=16\displaystyle \begin{aligned}\cst{\cos 2x}\big|_{x=0} &= \cst{1}\\ \lin{-2\sin 2x}\big|_{x=0} &= \lin{0}\\ \sq{-4\cos 2x}\big|_{x=0} &= \sq{-4}\\ \cub{8\sin 2x}\big|_{x=0} &= \cub{0}\\ \qrt{16\cos 2x}\big|_{x=0} &= \qrt{16}\end{aligned}
Build the polynomialThe odd-power terms are 00 because their derivatives are 00 at x=0x = 0, so we just divide −4\sq{-4} by 2!\sq{2!} for the x2\sq{x^2} term and 16\qrt{16} by 4!\qrt{4!} for the x4\qrt{x^4} term.
1+−42! x2+164! x4\displaystyle \cst{1} + \sq{\frac{-4}{2!}\,x^2} + \qrt{\frac{16}{4!}\,x^4} =1−2x2+23 x4\displaystyle = \cst{1} - \sq{2x^2} + \qrt{\frac{2}{3}\,x^4}
2
A function ff has f(2)=3f(2) = 3, f′(2)=−2f'(2) = -2, f′′(2)=5f''(2) = 5 and f′′′(2)=12f'''(2) = 12. (a) Write the third-degree Taylor polynomial for ff about x=2x = 2, and use it to approximate f(2.2)f(2.2). (b) Given that ∣f(4)(x)∣≤9|f^{(4)}(x)| \le 9 for 2≤x≤2.22 \le x \le 2.2, find a bound on the error of the approximation in (a).

If you got 2.8962.896 Check the coefficients in the polynomial. Remember to divide f′′(2)f''(2) by 2!2! and f′′′(2)f'''(2) by 3!3!.

For a degree-3 polynomial, what power of (x−2)(x - 2) and which factorial appear in the first term left out?

Build the polynomialThe center is 22, so the terms are powers of x−2x - 2, with each derivative at 22 divided by k!k!.
P3(x)=3−2(x−2)+52! (x−2)2+123! (x−2)3=3−2(x−2)+52 (x−2)2+2(x−2)3\displaystyle \begin{aligned}P_3(x) &= \cst{3} - \lin{2(x-2)} + \sq{\frac{5}{2!}\,(x-2)^2} + \cub{\frac{12}{3!}\,(x-2)^3}\\ &= \cst{3} - \lin{2(x-2)} + \sq{\frac{5}{2}\,(x-2)^2} + \cub{2(x-2)^3}\end{aligned}
P3(x)=3−2(x−2)+52! (x−2)2+123! (x−2)3=3−2(x−2)+52 (x−2)2+2(x−2)3\displaystyle \begin{aligned}P_3(x) &= \cst{3} - \lin{2(x-2)} + \sq{\frac{5}{2!}\,(x-2)^2}\\ &\quad + \cub{\frac{12}{3!}\,(x-2)^3}\\ &= \cst{3} - \lin{2(x-2)} + \sq{\frac{5}{2}\,(x-2)^2}\\ &\quad + \cub{2(x-2)^3}\end{aligned}
Plug in x=2.2x = 2.2, so x−2x - 2 is 0.20.2.
P3(2.2)\displaystyle P_3(2.2) =3−2(0.2)+52(0.2)2+2(0.2)3\displaystyle = \cst{3} - \lin{2(0.2)} + \sq{\frac{5}{2}(0.2)^2} + \cub{2(0.2)^3} =3−0.4+0.1+0.016\displaystyle = \cst{3} - \lin{0.4} + \sq{0.1} + \cub{0.016} =2.716\displaystyle = 2.716
Bound the errorThe polynomial has degree 33, so the first term left out uses the fourth derivative and 4!4!.
∣f(2.2)−P3(2.2)∣\displaystyle \er{\big|f(2.2) - P_3(2.2)\big|} ≤9⋅(0.2)44!\displaystyle \le \cm{9}\cdot\frac{(0.2)^4}{4!} =9⋅0.001624\displaystyle = \frac{9\cdot 0.0016}{24} =0.0006\displaystyle = 0.0006
3
P3(x)=1+6(x+1)2−5(x+1)3P_3(x) = 1 + 6(x+1)^2 - 5(x+1)^3 is the third-degree Taylor polynomial for ff about x=−1x = -1. (a) Does ff have a local maximum, a local minimum, or neither at x=−1x = -1? (b) Write the second-degree Taylor polynomial for f′f' about x=−1x = -1, and use it to estimate f′(−0.9)f'(-0.9).

What value of xx makes x+1=0x + 1 = 0, and what are f′(−1)f'(-1) and f′′(−1)f''(-1)?

The derivatives of f′f' are f′′f'' and f′′′f'''. What are their values at −1-1?

If you got 0.5750.575 Check how you read derivatives from the coefficients. The coefficient of (x+1)k(x + 1)^k is f(k)(−1)k!\frac{f^{(k)}(-1)}{k!}, so multiply each coefficient by k!k!.

If you got 12(x−1)−15(x−1)212(x-1) - 15(x-1)^2 Check the center. The polynomial uses powers of x+1x + 1, which is 00 at x=−1x = -1, not x=1x = 1.

Find the center and derivativesThe terms use powers of x+1x + 1, so the center is −1-1, and we multiply each coefficient by k!k! to get f(k)(−1)f^{(k)}(-1).
x+1\displaystyle x + 1 =0  →  x\displaystyle = 0 \;\to\; x =−1\displaystyle = -1
f′(−1)=0f′′(−1)=2!⋅6=12f′′′(−1)=3!⋅(−5)=−30\displaystyle \begin{aligned}\lin{f'(-1)} &= \lin{0}\\ \sq{f''(-1)} &= \sq{2!\cdot 6} = \sq{12}\\ \cub{f'''(-1)} &= \cub{3!\cdot(-5)} = \cub{-30}\end{aligned}
Apply the Second Derivative TestSince f′(−1)=0\lin{f'(-1) = 0} and the second derivative is positive, ff has a local minimum at −1-1.
f′(−1)=0,f′′(−1)=12>0\displaystyle \lin{f'(-1) = 0}, \qquad \sq{f''(-1) = 12} > 0
Build the polynomial for f′f'We can build the polynomial from the derivatives of f′f', or differentiate P3(x)P_3(x) directly.
f′(−1)+f′′(−1) (x+1)+f′′′(−1)2! (x+1)2=0+12(x+1)+−302 (x+1)2=12(x+1)−15(x+1)2\displaystyle \begin{aligned}&\cst{f'(-1)} + \lin{f''(-1)\,(x+1)} + \sq{\frac{f'''(-1)}{2!}\,(x+1)^2}\\ &\quad = \cst{0} + \lin{12(x+1)} + \sq{\frac{-30}{2}\,(x+1)^2} = \lin{12(x+1)} - \sq{15(x+1)^2}\end{aligned}
f′(−1)+f′′(−1) (x+1)+f′′′(−1)2! (x+1)2=0+12(x+1)+−302 (x+1)2=12(x+1)−15(x+1)2\displaystyle \begin{aligned}&\cst{f'(-1)} + \lin{f''(-1)\,(x+1)}\\ &\quad + \sq{\frac{f'''(-1)}{2!}\,(x+1)^2}\\ &= \cst{0} + \lin{12(x+1)} + \sq{\frac{-30}{2}\,(x+1)^2}\\ &= \lin{12(x+1)} - \sq{15(x+1)^2}\end{aligned}
P3′(x)\displaystyle P_3'(x) =12(x+1)−15(x+1)2\displaystyle = \lin{12(x+1)} - \sq{15(x+1)^2}
Plug in −0.9-0.9, so x+1x + 1 is 0.10.1.
f′(−0.9)≈12(0.1)−15(0.1)2\displaystyle f'(-0.9) \approx \lin{12(0.1)} - \sq{15(0.1)^2} =1.2−0.15\displaystyle = \lin{1.2} - \sq{0.15} =1.05\displaystyle = 1.05
4
Use the second-degree Taylor polynomial for exe^x about x=0x = 0 to estimate e−0.3e^{-0.3}. (a) Find a Lagrange error bound for this estimate. (b) Is the estimate greater than or less than e−0.3e^{-0.3}?

The function ete^t is increasing on [−0.3,0][-0.3, 0]. At which point is it largest?

In the exact error ec3!(−0.3)3\frac{e^c}{3!}(-0.3)^3, is (−0.3)3(-0.3)^3 positive or negative?

Plug x=−0.3\xp{x = -0.3} into the second-degree polynomial 1+x+x221 + x + \frac{x^2}{2}.
P2(−0.3)\displaystyle P_2(-0.3) =1−0.3+(−0.3)22\displaystyle = 1 - 0.3 + \frac{(-0.3)^2}{2} =1−0.3+0.045\displaystyle = 1 - 0.3 + 0.045 =0.745\displaystyle = 0.745
Bound the errorOn [−0.3,0][\xp{-0.3}, \ctr{0}], the third derivative ete^t is increasing, so its maximum is at t=0t = \ctr{0}, where e0=1e^{\ctr{0}} = \cm{1}.
f′′′(t)\displaystyle f'''(t) =et\displaystyle = e^t ≤e0\displaystyle \le e^{\ctr{0}} =1  on [−0.3,0],M=1\displaystyle = \cm{1} \ \text{ on } [\xp{-0.3}, \ctr{0}], \qquad \cm{M = 1}
∣e−0.3−P2(−0.3)∣\displaystyle \er{\big|e^{-0.3} - P_2(-0.3)\big|} ≤1⋅(0.3)33!\displaystyle \le \cm{1}\cdot\frac{(0.3)^3}{3!} =0.0276\displaystyle = \frac{0.027}{6} =0.0045\displaystyle = 0.0045
Find the sign of the errorIn the expression for the error, ec\cm{e^c} is positive and (−0.3)3(-0.3)^3 is negative, so the true value minus the estimate is negative.
e−0.3−P2(−0.3)=ec3! (−0.3)3<0c between −0.3 and 0\displaystyle \begin{aligned}\er{e^{-0.3} - P_2(-0.3)} &= \frac{\cm{e^c}}{3!}\,(-0.3)^3 < 0\\ &\quad \cm{c} \text{ between } \xp{-0.3} \text{ and } \ctr{0}\end{aligned}
0.745>e−0.3\displaystyle 0.745 > e^{-0.3}
Comparing with the true value e−0.3≈0.74082e^{-0.3} \approx 0.74082 shows the actual error is about 0.00420.0042, which is less than the bound 0.00450.0045.
e−0.3≈0.74082,0.745−0.74082≈0.0042\displaystyle e^{-0.3} \approx 0.74082, \qquad 0.745 - 0.74082 \approx 0.0042 ≤0.0045\displaystyle \le 0.0045
5
A function ff has f(2)=3f(2) = 3, f′(2)=−2f'(2) = -2 and f′′(2)=5f''(2) = 5. Let g(x)=∫2xf(t) dtg(x) = \displaystyle\int_2^x f(t)\,dt. Write the third-degree Taylor polynomial for gg about x=2x = 2.

What is g′(x)g'(x), and what is g(2)=∫22f(t) dtg(2) = \int_2^2 f(t)\,dt?

If you got 3+3(x−2)−(x−2)2+56(x−2)33 + 3(x-2) - (x-2)^2 + \dfrac{5}{6}(x-2)^3 Check the value of g(2)g(2). The integral from 22 to 22 is 00, so the constant term is 00, not f(2)f(2).

If you got g′(2)=−2g'(2) = -2 Check which derivative is which. g′(x)=f(x)g'(x) = f(x), so g′(2)=f(2)=3g'(2) = f(2) = 3, not f′(2)f'(2).

Find the derivatives of gg at 22Differentiating g(x)=∫2xf(t) dtg(x) = \int_2^x f(t)\,dt gives g′(x)=f(x)g'(x) = f(x), so each derivative of gg is the derivative of ff one order lower.
g′(x)=f(x)g′′(x)=f′(x)g′′′(x)=f′′(x)\displaystyle \begin{aligned}g'(x) &= f(x)\\ g''(x) &= f'(x)\\ g'''(x) &= f''(x)\end{aligned}
g(2)=∫22f(t) dt=0g′(2)=3g′′(2)=−2g′′′(2)=5\displaystyle \begin{aligned}\cst{g(2)} &= \int_2^2 f(t)\,dt = \cst{0}\\ \lin{g'(2)} &= \lin{3}\\ \sq{g''(2)} &= \sq{-2}\\ \cub{g'''(2)} &= \cub{5}\end{aligned}
Plug these values into the Taylor formula about 22.
0+3(x−2)+−22! (x−2)2+53! (x−2)3=3(x−2)−(x−2)2+56 (x−2)3\displaystyle \begin{aligned}&\cst{0} + \lin{3(x-2)} + \sq{\frac{-2}{2!}\,(x-2)^2} + \cub{\frac{5}{3!}\,(x-2)^3}\\ &\quad = \lin{3(x-2)} - \sq{(x-2)^2} + \cub{\frac{5}{6}\,(x-2)^3}\end{aligned}
6
What is the least degree of a Taylor polynomial for ln⁡x\ln x about x=1x = 1 that approximates ln⁡1.5\ln 1.5 with error less than 0.010.01?

On [1,1.5][1, 1.5], is 6t4\frac{6}{t^4} increasing or decreasing, and at which endpoint is it largest?

Test degree 33For degree 3, the fourth derivative has size 6t4\frac{6}{t^4}, which decreases on [1,1.5][\ctr{1}, \xp{1.5}] and reaches its maximum M=6\cm{M = 6} at t=1t = \ctr{1}.
f(4)(t)=−6t46t4≤614=6  on [1,1.5]M=6\displaystyle \begin{aligned}f^{(4)}(t) &= -\frac{6}{t^4}\\ \frac{6}{t^4} &\le \frac{6}{\ctr{1}^4} = \cm{6} \ \text{ on } [\ctr{1}, \xp{1.5}]\\ \cm{M} &= \cm{6}\end{aligned}
6⋅(0.5)44!\displaystyle \cm{6}\cdot\frac{(0.5)^4}{4!} =6⋅0.062524≈0.0156>0.01\displaystyle = \frac{6\cdot 0.0625}{24} \approx 0.0156 > \er{0.01}
Test degree 44Differentiating again gives 24t5\frac{24}{t^5}, which is also decreasing on [1,1.5][\ctr{1}, \xp{1.5}] and has its maximum M=24\cm{M = 24} at t=1t = \ctr{1}.
f(5)(t)=24t524t5≤2415=24  on [1,1.5]M=24\displaystyle \begin{aligned}f^{(5)}(t) &= \frac{24}{t^5}\\ \frac{24}{t^5} &\le \frac{24}{\ctr{1}^5} = \cm{24} \ \text{ on } [\ctr{1}, \xp{1.5}]\\ \cm{M} &= \cm{24}\end{aligned}
24⋅(0.5)55!\displaystyle \cm{24}\cdot\frac{(0.5)^5}{5!} =24⋅0.03125120\displaystyle = \frac{24\cdot 0.03125}{120} =0.00625<0.01\displaystyle = 0.00625 < \er{0.01}