Tutorials › Calculus II › Deriving Coefficients by Matching Derivatives

Taylor Polynomials · Tutorial 800 of 998

Deriving Coefficients by Matching Derivatives

Derive the Taylor coefficient formula from derivative matching, and see why the \(k\)th derivative at the center must be divided by \(k!\).

Beginner 9 min read

What You'll Learn

  • State the derivative-matching condition for a Taylor polynomial of degree n.
  • Differentiate powers of x minus a and evaluate them at the center.
  • Derive the coefficient formula f^(k)(a)/k! for every coefficient.
  • Apply the formula to functions at specified centers and verify the derivative matches.
  • Recognize and correct the error of omitting the factorial.

Why Derivatives Determine the Coefficients

A Taylor polynomial is designed to agree with a function near a chosen center \(a\). One way to impose that agreement is to require the polynomial and function to have the same value, slope, and higher derivatives at \(a\). These conditions do more than make the polynomial resemble the function: they determine each coefficient in turn.

The key is to write the polynomial using powers of \(x-a\). At the center, those powers have a useful property: differentiating \(k\) times makes the \(k\)th power contribute a nonzero value, while the other powers contribute zero. The size of that contribution is \(k!\), which explains the factorial in the Taylor coefficient formula.

Set Up the Matching Conditions

Let \(n\) be a nonnegative integer, let \(a\) be a real number, and suppose \(f\) has derivatives through order \(n\) at \(a\). A polynomial of degree at most \(n\), written in powers of \(x-a\), has the form

$$ P_n(x)=c_0+c_1(x-a)+c_2(x-a)^2+\cdots+c_n(x-a)^n =\sum_{j=0}^{n}c_j(x-a)^j. $$

To match the function’s derivatives through order \(n\), require that \(P_n^{(k)}(a)=f^{(k)}(a)\) for each integer \(k\) from \(0\) to \(n\). The order-zero condition means \(P_n(a)=f(a)\). For positive \(k\), the condition matches the \(k\)th derivatives at the center.

Definition: The degree-\(n\) Taylor polynomial of \(f\) centered at \(a\) is the polynomial \(P_n\) whose derivatives at \(a\), from order \(0\) through order \(n\), match those of \(f\). The coefficient formula follows by applying these matching conditions to the powers of \(x-a\).

The phrase “degree at most \(n\)” allows some of the highest coefficients to be zero. The derivative-matching setup requires only that the relevant derivatives of \(f\) exist at \(a\); it does not require that \(f\) equal this polynomial away from the center.

How the Shifted Powers Behave

Consider one term \((x-a)^j\) and differentiate it \(k\) times. If \(k\leq j\), repeated application of the power rule gives

$$ \frac{d^k}{dx^k}(x-a)^j =j(j-1)\cdots(j-k+1)(x-a)^{j-k}. $$

If \(k>j\), the derivative is zero because differentiating a degree-\(j\) polynomial more than \(j\) times gives zero. Now evaluate at \(x=a\). When \(j>k\), the remaining power has positive exponent and vanishes. When \(j=k\), no power remains, and the product of factors is \(k!\). When \(j<k\), the derivative is already zero.

$$ \left.\frac{d^k}{dx^k}(x-a)^j\right|_{x=a} = \begin{cases} k!,&j=k,\\ 0,&j\ne k. \end{cases} $$

Here \(0!=1\), so the statement includes \(k=0\): the zeroth derivative is the original term, and \((x-a)^j\) evaluated at \(a\) is \(1\) if \(j=0\) and \(0\) otherwise.

Deriving the Coefficient Formula

Differentiate \(P_n(x)=\sum_{j=0}^{n}c_j(x-a)^j\) exactly \(k\) times and evaluate at \(a\). Differentiation and evaluation apply term by term because the sum is finite. By the behavior of shifted powers, every term disappears except the one whose exponent is \(k\). Thus \(P_n^{(k)}(a)=k!c_k\). The matching condition says this value must be \(f^{(k)}(a)\), so solving for \(c_k\) gives the result.

1
Write the polynomial in shifted powers.
\(P_n(x)=\sum_{j=0}^{n}c_j(x-a)^j\).
2
Differentiate \(k\) times and evaluate at the center.
At \(x=a\), only the term with exponent \(k\) contributes, with value \(k!c_k\).
3
Apply derivative matching and solve.
\(k!c_k=f^{(k)}(a)\), so \(c_k=f^{(k)}(a)/k!\).
Theorem: If \(P_n\) matches the derivatives of \(f\) through order \(n\) at \(a\), then for each \(k=0,1,\ldots,n\), its coefficient of \((x-a)^k\) is $$ c_k=\frac{f^{(k)}(a)}{k!}. $$ Therefore the polynomial has the form $$ P_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k. $$

This argument also explains the role of each derivative: the value \(f^{(k)}(a)\) is not itself the coefficient in general. It equals \(k!\) times that coefficient because the \(k\)th derivative of \((x-a)^k\), evaluated at \(a\), is \(k!\). For \(k=0\), the formula reads \(c_0=f(a)\), as expected from matching the function’s value.

Worked Examples

Worked Example: Matching a Cubic at a Nonzero Center

Find the degree-three Taylor polynomial for \(f(x)=x^3-2x+4\) centered at \(a=1\), using derivative matching.

First calculate the required derivatives:

$$ \begin{aligned} f(x)&=x^3-2x+4,\\ f'(x)&=3x^2-2,\\ f''(x)&=6x,\\ f'''(x)&=6. \end{aligned} $$

Evaluate each at \(x=1\):

$$ \begin{aligned} f(1)&=1-2+4=3,\\ f'(1)&=3(1)^2-2=1,\\ f''(1)&=6(1)=6,\\ f'''(1)&=6. \end{aligned} $$

Use \(c_k=f^{(k)}(1)/k!\). The coefficients are \(c_0=3/0!=3\), \(c_1=1/1!=1\), \(c_2=6/2!=6/2=3\), and \(c_3=6/3!=6/6=1\). Therefore

$$ P_3(x)=3+(x-1)+3(x-1)^2+(x-1)^3. $$

Check by expanding. Since \((x-1)^2=x^2-2x+1\) and \((x-1)^3=x^3-3x^2+3x-1\),

$$ \begin{aligned} P_3(x) &=3+x-1+3(x^2-2x+1)+(x^3-3x^2+3x-1)\\ &=x^3-2x+4=f(x). \end{aligned} $$

In particular, \(P_3\) and \(f\) have the same derivatives through order three at \(1\). The expansion confirms the result directly in this case.

Worked Example: A Function with a Product in Its Derivatives

Find the degree-three Taylor polynomial for \(f(x)=x^2e^x\) centered at \(a=0\).

Differentiate using the product rule:

$$ \begin{aligned} f(x)&=x^2e^x,\\ f'(x)&=2xe^x+x^2e^x=e^x(x^2+2x),\\ f''(x)&=e^x(x^2+2x)+e^x(2x+2)=e^x(x^2+4x+2),\\ f'''(x)&=e^x(x^2+4x+2)+e^x(2x+4)=e^x(x^2+6x+6). \end{aligned} $$

At the center, \(e^0=1\), so

$$ f(0)=0,\qquad f'(0)=0,\qquad f''(0)=2,\qquad f'''(0)=6. $$

The coefficients are \(c_0=0\), \(c_1=0\), \(c_2=2/2!=1\), and \(c_3=6/3!=1\). Hence

$$ P_3(x)=x^2+x^3. $$

Verify the matching directly: \(P_3'(x)=2x+3x^2\), \(P_3''(x)=2+6x\), and \(P_3'''(x)=6\). At zero these give \(P_3(0)=0\), \(P_3'(0)=0\), \(P_3''(0)=2\), and \(P_3'''(0)=6\), which agree with the derivatives of \(f\) calculated above.

Worked Example: A Fourth-Degree Polynomial at Zero

Find the degree-four Taylor polynomial for \(f(x)=e^{x^2}\) centered at \(a=0\).

Differentiate successively using the chain rule and product rule:

$$ \begin{aligned} f'(x)&=2xe^{x^2},\\ f''(x)&=(2+4x^2)e^{x^2},\\ f'''(x)&=(12x+8x^3)e^{x^2},\\ f^{(4)}(x)&=(12+48x^2+16x^4)e^{x^2}. \end{aligned} $$

Substitute \(x=0\):

$$ f(0)=1,\qquad f'(0)=0,\qquad f''(0)=2,\qquad f'''(0)=0,\qquad f^{(4)}(0)=12. $$

Divide each value by the corresponding factorial. The coefficients are \(1/0!=1\), \(0/1!=0\), \(2/2!=1\), \(0/3!=0\), and \(12/4!=12/24=1/2\). Therefore

$$ P_4(x)=1+x^2+\frac{1}{2}x^4. $$

For a check, its derivatives are \(P_4'(x)=2x+2x^3\), \(P_4''(x)=2+6x^2\), \(P_4'''(x)=12x\), and \(P_4^{(4)}(x)=12\). At zero their values are \(1,0,2,0,12\), including the polynomial itself as the order-zero derivative. These match the corresponding values of \(f\).

A Common Factorial Mistake

A frequent error is to use \(f^{(k)}(a)\) directly as the coefficient of \((x-a)^k\). That ignores the factor produced by differentiating the power \(k\) times. For example, let \(f(x)=x^2\) at \(a=0\), and suppose we try \(P_2(x)=c_0+c_1x+c_2x^2\). Since \(f''(0)=2\), the incorrect choice \(c_2=2\) would give \(P_2(x)=2x^2\). But

$$ P_2''(x)=4 \qquad\text{and}\qquad P_2''(0)=4\ne f''(0)=2. $$

The correction is to solve the matching equation \(P_2''(0)=2!c_2=f''(0)=2\). Thus \(c_2=2/2!=1\), giving \(P_2(x)=x^2\), whose second derivative at zero is indeed \(2\). The factorial is therefore required for the derivative-matching condition to hold.

Why the Derivation Matters

The coefficient formula is not an arbitrary convention to memorize. It follows from the way derivatives act on powers centered at \(a\). Expressing the polynomial in powers of \(x-a\) makes each matching condition isolate exactly one coefficient. This gives a systematic route from derivative information to a polynomial model.

It also provides a practical check on calculations: after forming a Taylor polynomial, differentiate it and evaluate at the center. Its derivatives of orders \(0\) through \(n\) should reproduce the corresponding derivative values of the function. A mismatch usually indicates an incorrect derivative, an omitted factorial, or a mistake in evaluating at the center.

Derivative matching describes how the polynomial behaves at the center; by itself, it does not state how accurate the polynomial is at points away from the center. Questions about approximation error require additional results. Here the conclusion is specifically about the coefficients needed to match the prescribed derivatives.

Check Your Understanding

Use the derivative-matching argument, rather than memorizing coefficients, to answer these questions.

  1. Why does evaluating the \(k\)th derivative of \((x-a)^j\) at \(a\) give zero when \(j\ne k\)?
  2. For a Taylor polynomial centered at \(a\), what equation relates \(c_k\) to \(f^{(k)}(a)\)?
  3. For \(f(x)=x^3\) centered at \(a=0\), calculate the coefficient of \(x^3\) and verify the third derivative match.
  4. What incorrect coefficient would result from omitting \(k!\) when matching the second derivative of \(f(x)=x^2\) at zero?
  5. What must be true about the derivatives of \(f\) at \(a\) in order to form its degree-\(n\) Taylor polynomial by this method?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon