Tutorials › AP Calculus › Higher Derivatives of Products

Higher Derivatives and Motion · Tutorial 229 of 999

Higher Derivatives of Products

Learn to organize third and fourth derivatives of products with the correct coefficients and verify the results efficiently.

Intermediate 10 min read

What You'll Learn

  • Apply the product rule repeatedly to calculate third and fourth derivatives.
  • Recognize the coefficient patterns for two-factor products.
  • Explain how the coefficients arise from collecting like terms.
  • Find higher derivatives of products involving powers, exponentials, and trigonometric functions.
  • Check a fourth derivative by differentiating the third derivative.
  • Avoid omitting or misplacing coefficients in repeated product-rule calculations.

Why Higher Derivatives of Products Need Care

The product rule gives the derivative of a product of two functions, but differentiating that product again creates several new terms. By the third and fourth derivatives, some terms occur more than once. Collecting those repeated terms produces coefficients that are easy to miss if each differentiation is done mentally.

A reliable method is to apply the product rule one derivative at a time, then organize the result by how many derivatives fall on each factor. This works for products of powers, exponentials, and trigonometric functions, provided the factors have all the derivatives being used.

Definition: If \(f\) and \(g\) have derivatives through order \(n\) on an interval, the \(n\)th derivative of their product is found by repeatedly differentiating \(f(x)g(x)\) with the product rule. The order of a derivative is indicated by a superscript in parentheses, such as \(f^{(3)}\); \(f^{(0)}\) means \(f\) itself.

The Third and Fourth Derivative Formulas

Start with the product rule, \((fg)'=f'g+fg'\). Differentiating a second time gives \((fg)''=f''g+2f'g'+fg''\). Differentiating again and collecting terms gives the third-derivative formula:

$$ (fg)'''=f'''g+3f''g'+3f'g''+fg'''. $$

Differentiating once more gives the fourth-derivative formula:

$$ (fg)''''=f''''g+4f'''g'+6f''g''+4f'g'''+fg''''. $$

The coefficients \(1,3,3,1\) and \(1,4,6,4,1\) reflect how many times the same derivative combination appears during repeated applications of the product rule. They are not extra factors attached by a separate differentiation rule; they come from collecting like terms.

Why the Coefficients Appear

The second derivative is a useful starting point for seeing the pattern. Differentiate each term in \((fg)''=f''g+2f'g'+fg''\). Each differentiation uses the product rule:

$$ \begin{aligned} (fg)''' &=(f'''g+f''g')+2(f''g'+f'g'')+(f'g''+fg''')\\ &=f'''g+3f''g'+3f'g''+fg'''. \end{aligned} $$

For the fourth derivative, differentiate the four terms in the third-derivative formula. Again, collect terms that have the same derivatives on the two factors:

$$ \begin{aligned} (fg)'''' &=(f''''g+f'''g') +3(f'''g'+f''g'')\\ &\quad+3(f''g''+f'g''') +(f'g'''+fg'''')\\ &=f''''g+4f'''g'+6f''g''+4f'g'''+fg''''. \end{aligned} $$

For instance, \(f'''g'\) appears once from differentiating \(f'''g\), and three more times from differentiating \(3f''g'\). Its total coefficient is \(1+3=4\). The same collecting process gives the coefficient \(6\) on \(f''g''\).

1
Differentiate each term.
Apply the product rule to both factors in every term of the current derivative.
2
Group matching terms.
Terms with the same derivative on each factor are like terms and must be combined.
3
Check the derivative order.
In every term of the \(n\)th derivative, the derivative orders on the two factors add to \(n\).

This also explains why the coefficients follow the familiar pattern from Pascal’s triangle: when moving from one derivative to the next, each existing term contributes to two terms, and matching contributions are added. The direct derivations above establish the formulas needed here without requiring a memorized higher-order rule.

Worked Example: A Power Times an Exponential

Worked Example: Find the Third and Fourth Derivatives of \(x^2e^{3x}\)

Let \(f(x)=x^2\) and \(g(x)=e^{3x}\). Their derivatives are

$$ \begin{aligned} f&=x^2, & f'&=2x, & f''&=2, & f'''&=0, & f''''&=0,\\ g&=e^{3x}, & g'&=3e^{3x}, & g''&=9e^{3x}, & g'''&=27e^{3x}, & g''''&=81e^{3x}. \end{aligned} $$

Use the third-derivative formula and substitute each factor derivative:

$$ \begin{aligned} y''' &=f'''g+3f''g'+3f'g''+fg'''\\ &=0\cdot e^{3x}+3(2)(3e^{3x}) +3(2x)(9e^{3x})+x^2(27e^{3x})\\ &=18e^{3x}+54xe^{3x}+27x^2e^{3x}\\ &=e^{3x}(27x^2+54x+18). \end{aligned} $$

For the fourth derivative:

$$ \begin{aligned} y'''' &=f''''g+4f'''g'+6f''g''+4f'g'''+fg''''\\ &=0\cdot e^{3x}+4(0)(3e^{3x}) +6(2)(9e^{3x})+4(2x)(27e^{3x})+x^2(81e^{3x})\\ &=108e^{3x}+216xe^{3x}+81x^2e^{3x}\\ &=e^{3x}(81x^2+216x+108). \end{aligned} $$

Check by differentiating the third derivative. The product rule gives

$$ \begin{aligned} \frac{d}{dx}\left[e^{3x}(27x^2+54x+18)\right] &=3e^{3x}(27x^2+54x+18) +e^{3x}(54x+54)\\ &=e^{3x}(81x^2+162x+54+54x+54)\\ &=e^{3x}(81x^2+216x+108), \end{aligned} $$

which agrees with the fourth derivative.

Worked Example: A Power Times a Trigonometric Function

Worked Example: Find the Third and Fourth Derivatives of \(x^3\sin x\)

Take \(f(x)=x^3\) and \(g(x)=\sin x\). The derivatives needed are

$$ \begin{aligned} f&=x^3, & f'&=3x^2, & f''&=6x, & f'''&=6, & f''''&=0,\\ g&=\sin x, & g'&=\cos x, & g''&=-\sin x, &g'''&=-\cos x, &g''''&=\sin x. \end{aligned} $$

Apply the third-derivative formula:

$$ \begin{aligned} y''' &=f'''g+3f''g'+3f'g''+fg'''\\ &=6\sin x+3(6x)\cos x+3(3x^2)(-\sin x)+x^3(-\cos x)\\ &=6\sin x+18x\cos x-9x^2\sin x-x^3\cos x\\ &=(18x-x^3)\cos x+(6-9x^2)\sin x. \end{aligned} $$

For the fourth derivative:

$$ \begin{aligned} y'''' &=f''''g+4f'''g'+6f''g''+4f'g'''+fg''''\\ &=0\cdot\sin x+4(6)\cos x+6(6x)(-\sin x) +4(3x^2)(-\cos x)+x^3\sin x\\ &=24\cos x-36x\sin x-12x^2\cos x+x^3\sin x\\ &=(24-12x^2)\cos x+(x^3-36x)\sin x. \end{aligned} $$

Check by differentiating the expression for \(y'''\). Set \(A=18x-x^3\) and \(B=6-9x^2\), so \(y'''=A\cos x+B\sin x\). Then \(A'=18-3x^2\) and \(B'=-18x\), giving

$$ \begin{aligned} y'''' &=A'\cos x-A\sin x+B'\sin x+B\cos x\\ &=(18-3x^2+6-9x^2)\cos x\\ &\quad+[-(18x-x^3)-18x]\sin x\\ &=(24-12x^2)\cos x+(x^3-36x)\sin x. \end{aligned} $$

This matches the result from the fourth-derivative product formula.

Worked Example: Evaluate Derivatives at a Point

Worked Example: Find the Third and Fourth Derivatives of \(e^x\cos(2x)\) at \(x=0\)

Let \(f(x)=e^x\) and \(g(x)=\cos(2x)\). Every derivative of \(f\) is \(e^x\). The derivatives of \(g\) through order four are

$$ g'=-2\sin(2x),\qquad g''=-4\cos(2x),\qquad g'''=8\sin(2x),\qquad g''''=16\cos(2x). $$

At \(x=0\), \(e^0=1\), \(\cos(0)=1\), and \(\sin(0)=0\). Thus the factor values are \(f=f'=f''=f'''=f''''=1\), \(g=1\), \(g'=0\), \(g''=-4\), \(g'''=0\), and \(g''''=16\). Substitute them into the formulas:

$$ \begin{aligned} y'''(0) &=f'''(0)g(0)+3f''(0)g'(0)+3f'(0)g''(0)+f(0)g'''(0)\\ &=(1)(1)+3(1)(0)+3(1)(-4)+(1)(0)\\ &=1-12=-11, \end{aligned} $$
$$ \begin{aligned} y''''(0) &=f''''(0)g(0)+4f'''(0)g'(0)+6f''(0)g''(0)\\ &\quad+4f'(0)g'''(0)+f(0)g''''(0)\\ &=(1)(1)+4(1)(0)+6(1)(-4)+4(1)(0)+(1)(16)\\ &=1-24+16=-7. \end{aligned} $$

Check by differentiating explicitly. First,

$$ \begin{aligned} y'&=e^x(\cos(2x)-2\sin(2x)),\\ y''&=e^x(-3\cos(2x)-4\sin(2x)),\\ y'''&=e^x(-11\cos(2x)+2\sin(2x)),\\ y''''&=e^x(-7\cos(2x)+24\sin(2x)). \end{aligned} $$

For example, differentiating \(y'''=e^x(-11\cos(2x)+2\sin(2x))\) gives \(y''''=e^x(-7\cos(2x)+24\sin(2x))\). At \(x=0\), this equals \(1(-7+0)=-7\), agreeing with the formula calculation; similarly \(y'''(0)=1(-11+0)=-11\).

A Common Coefficient Mistake

A frequent error is to differentiate the product correctly in some terms but fail to combine repeated terms. For the third derivative, one might write

$$ (fg)''' \;\text{incorrectly as}\; f'''g+f''g'+f'g''+fg'''. $$

This expression includes the four possible derivative placements, but it ignores the fact that \(f''g'\) and \(f'g''\) arise in more than one way during repeated differentiation. The complete calculation is

$$ \begin{aligned} (fg)''' &=(f''g+2f'g'+fg'')'\\ &=f'''g+f''g'+2f''g'+2f'g''+f'g''+fg'''\\ &=f'''g+3f''g'+3f'g''+fg'''. \end{aligned} $$

The correction is to differentiate every existing term and collect like terms before writing the result. A useful check is that the derivative orders in each term add to the total: for example, the orders in \(f''g'\) add to \(2+1=3\).

Choosing an Efficient Approach

For a product of two factors, the formulas are most useful when the derivatives of each factor are easy to list. A power eventually has zero derivatives; an exponential has a predictable derivative pattern; and sine and cosine cycle through a short sequence of derivatives. Write those factor derivatives first, then substitute into the organized formula.

For a fourth derivative, a final check is especially valuable: differentiate the expression for the third derivative and compare it with the result from the fourth-derivative formula. This check can reveal a missing coefficient or a sign error in a trigonometric derivative. If the problem asks only for a derivative at a point, it is often efficient to evaluate the factor derivatives at that point and substitute those values directly, as in the last example.

Key takeaway: For two factors, the third-derivative coefficients are \(1,3,3,1\), and the fourth-derivative coefficients are \(1,4,6,4,1\). Apply the product rule repeatedly, combine matching terms, and verify the result by differentiating the preceding derivative when practical.

Check Your Understanding

Use the product-rule formulas and show enough intermediate steps to track each coefficient.

  1. Find the third derivative of \(x^2\sin x\).
  2. Find the fourth derivative of \(x e^{2x}\).
  3. For \(y=e^x\sin x\), use the product formulas to find \(y'''(0)\).
  4. Explain why the coefficient of \(f''g''\) in the fourth derivative is \(6\).
  5. Identify the error in writing \((fg)''''=f''''g+f'''g'+f''g''+f'g'''+fg''''\).

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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