Topic 10.12 · BC

Choose the derivative order for the remainder

Builds on reading the information a polynomial provides. 7 minutes.

The error of a degree 2 polynomial

The chalk curve shows \(f(x)=e^{2x}\). The orange curve is its Taylor polynomial of degree \(n\) with the center 0, and the slider sets \(n\).

The error is \(E(x)=f(x)-P_n(x)\), the red gap at \(x=0.5\). For \(n=2\), the gap is \(e-2.5\), about 0.218.

The lower graph shows the size of the error at every x. The error is 0 at the center and stays small nearby, because the polynomial matches f and its first n derivatives there.

The dashed red curve shows the size of the first term that the polynomial leaves out. For \(n=2\) this term is \(\frac{f'''(0)}{3!}x^3=\frac{8}{3!}x^3\), and near the center it follows the error closely.

Set \(n=3\). The polynomial now includes that term, so the dashed curve changes to \(\frac{f^{(4)}(0)}{4!}x^4=\frac{16}{4!}x^4\). The order of the derivative is always one above the degree.

Any function, any degree

The picture holds for any function f and any center. Change the degree with the slider.

The dashed curve is the first term that the polynomial leaves out. It uses the derivative of order \(n+1\), and it uses the power \(n+1\) of the distance from the center.

For every degree, the dashed curve stays close to the error near the center, so the error behaves like the first term left out.

Notation

  1. The remainder is another name for the error, the function minus the polynomial.

    \[\cr{R_n(x)}=f(x)-\cy{P_n(x)}\]
  2. The Lagrange form looks like the next term of the polynomial, but the derivative is evaluated at a point \(c\), not at the center. The dashed curve shows the same formula with \(c\) replaced by the center.

    \[\cr{R_n(x)}=\dfrac{f^{(n+1)}(c)}{(n+1)!}\,(x-a)^{n+1}\]

    The number \(c\) lies between \(a\) and \(x\). Its position is unknown, so the next skills use a bound for the derivative.

  3. For every function, the order of the derivative is \(n+1\), and so is the power of \(x-a\).

  4. The function must have a derivative of order \(n+1\) at every point between \(a\) and \(x\).

When it fails

Take \(n=2\) and use the derivative of order 2. The dashed curve now follows \(x^2\), but the error follows \(x^3\), so near the center the dashed curve is far above the error.

The second derivative of the error at the center is 0, because the polynomial has the same bend as \(f\) there. Only the derivative of order \(n+1\), the first that the polynomial does not match, describes what is left over.

Example 1: A reciprocal

Write the Lagrange remainder \(R_3(x)\) for \(f(x)=\dfrac{1}{1-x}\) with the center 0.

  1. The degree is \(n=3\), so the remainder uses the derivative of order \(n+1=4\).

    \[n+1=4\]
  2. Differentiate four times.

    \[\begin{aligned}f'(x)&=\dfrac{1}{(1-x)^2}\\ f''(x)&=\dfrac{2}{(1-x)^3}\\ f'''(x)&=\dfrac{6}{(1-x)^4}\\ f^{(4)}(x)&=\dfrac{24}{(1-x)^5}\end{aligned}\]
  3. Put the fourth derivative at \(c\) into the formula. Divide by \(4!=24\), and multiply by \(x^4\) because the center is 0. The dashed red curve shows the same formula with \(c\) replaced by 0, which gives \(x^4\).

    \[\begin{aligned}\cr{R_3(x)}&=\dfrac{24}{4!\,(1-c)^5}\,x^4\\ &=\dfrac{x^4}{(1-c)^5}\end{aligned}\]

Example 2: A square root

The Taylor polynomial of degree 2 for \(f(x)=\sqrt{1+x}\) at 0 is \(1+\tfrac{x}{2}-\tfrac{x^2}{8}\). Write the Lagrange remainder \(R_2(x)\).

  1. Differentiate. The center is 0.

    \[\begin{aligned}f''(x)&=-\dfrac{1}{4}(1+x)^{-3/2}\\ f'''(x)&=\dfrac{3}{8}(1+x)^{-5/2}\end{aligned}\]
  2. A tempting wrong move: The degree is 2, so use the second derivative \(f''\) in the remainder.

    \[\cr{f''(0)=-\dfrac14}\]

    The polynomial has the second derivative \(-\frac14\) at 0, the same as \(f\), so the error has second derivative 0 there. The dashed curve for order 2 rises like \(x^2\), far above the error, which rises like \(x^3\).

  3. Use the derivative of order \(n+1=3\). Divide by \(3!=6\), and multiply by \(x^3\). The dashed curve now follows the error.

    \[\begin{aligned}\cr{R_2(x)}&=\dfrac{f'''(c)}{3!}\,x^3\\ &=\dfrac{1}{16}(1+c)^{-5/2}\,x^3\end{aligned}\]

Practice

Write the Lagrange remainder \(R_4(x)\) for \(f(x)=x e^{x}\) with the center 0.

The degree is 4. Which order of derivative does the remainder use? The first two derivatives of \(xe^x\) are \((x+1)e^x\) and \((x+2)e^x\).

Solution
  1. The degree is \(n=4\), so the remainder uses the derivative of order 5.

    \[n+1=5\]
  2. The derivative of \((x+k)e^x\) is \((x+k+1)e^x\), so the fifth derivative is:

    \[f^{(5)}(x)=(x+5)e^{x}\]
  3. Put the derivative at \(c\) into the formula. Divide by \(5!=120\), and multiply by \(x^5\).

    \[\cr{R_4(x)}=\dfrac{(c+5)e^{c}}{120}\,x^5\]

Questions

Questions 1 and 2 use the figure. The chalk curve is \(f(x)=e^{3x}\) and the orange curve is its Taylor polynomial of degree 2 with the center 0. The lower graph shows the error in red. The dashed red curve is the first term that the polynomial leaves out.

  1. At \(x=0.4\) the dot on the dashed curve is at height about 0.29. Which derivative of \(f\) at 0 does the dashed curve use?

    • \(f'''\)
    • \(f''\)
    • \(f^{(4)}\)
    Answer

    \(f'''\)

  2. At \(x=0.4\) the red error curve is above the dashed curve. Why?

    • The remainder uses \(f'''(c)\) at a point \(c\) between 0 and 0.4, where \(f'''\) is larger than \(f'''(0)\).
    • The polynomial has the wrong degree.
    • The remainder uses the derivative of order 4.
    Answer

    The remainder uses \(f'''(c)\) at a point \(c\) between 0 and 0.4, where \(f'''\) is larger than \(f'''(0)\).

  3. A Taylor polynomial of degree 3 at the center 0 approximates \(g(x)=\ln(2+x)\). Which function appears in the Lagrange remainder?

    • \(g^{(4)}(x)=-\dfrac{6}{(2+x)^4}\)
    • \(g'''(x)=\dfrac{2}{(2+x)^3}\)
    • \(g^{(5)}(x)=\dfrac{24}{(2+x)^5}\)
    Answer

    \(g^{(4)}(x)=-\dfrac{6}{(2+x)^4}\)

Summary

The derivative in the remainder has the order one above the degree of the polynomial.

This is because the polynomial matches \(f\) in all derivatives up to its degree, so the error starts at the next order.

You need this order when a problem asks for the Lagrange form of the remainder or for an error bound.

This is one of four skills in topic 10.12 of Which & Why: AP Calculus.