Tutorials › Calculus II › Recurrences for Polynomial-Trigonometric Integrals

Repeated and Tabular Parts · Tutorial 59 of 998

Recurrences for Polynomial-Trigonometric Integrals

Learn how integration by parts reduces polynomial–trigonometric integrals to lower powers and how to use the resulting recurrences reliably.

Intermediate 9 min read

What You'll Learn

  • Define the sine and cosine antiderivative families for a nonzero frequency.
  • Derive the first-order recurrences using integration by parts.
  • Combine the recurrences to reduce the polynomial power by two.
  • Identify the base cases and handle the lowest powers correctly.
  • Compute polynomial–trigonometric antiderivatives and check them by differentiation.
  • Recognize common sign and frequency errors in recurrence calculations.

Why Use a Recurrence?

Integration by parts can reduce an integral containing a polynomial and a trigonometric function to another integral of the same type but with a lower power of \(x\). Rather than repeat the full integration-by-parts calculation for every power, we can record that reduction as a recurrence: a formula that expresses a family member in terms of lower-index members and explicit terms.

For polynomial–trigonometric integrals, the power often drops by two when the sine and cosine recurrences are combined. The process therefore ends at a base case involving either a constant or a first power of \(x\). Keeping the frequency and signs visible is essential: both affect the coefficients in the recurrence.

Define the Integral Families

Let \(b\) be a nonzero real number and let \(n\) be a nonnegative integer. We use \(S_n\) and \(C_n\) for particular antiderivatives of the following integrands:

$$ S_n'(x)=x^n\sin(bx), \qquad C_n'(x)=x^n\cos(bx). $$

We choose the base antiderivatives \(S_0(x)=-\cos(bx)/b\) and \(C_0(x)=\sin(bx)/b\), and define the higher-index particular antiderivatives using the recurrences derived below. Any other antiderivative of the same integrand differs from the chosen one by an additive constant. The condition \(b\ne 0\) matters because the formulas divide by \(b\); the zero-frequency case has different, simpler integrands.

Definition: \(S_n\) and \(C_n\) denote particular antiderivatives of \(x^n\sin(bx)\) and \(x^n\cos(bx)\), respectively, for fixed \(b\ne 0\). An indefinite integral written using these functions may include an arbitrary constant.

The base cases follow directly from the elementary antiderivatives of sine and cosine. For \(n=1\), one integration by parts gives formulas that will also serve as the lowest-power checks:

$$ S_0=-\frac{\cos(bx)}{b}, \qquad C_0=\frac{\sin(bx)}{b}, \qquad S_1=-\frac{x\cos(bx)}{b}+\frac{\sin(bx)}{b^2}, \qquad C_1=\frac{x\sin(bx)}{b}+\frac{\cos(bx)}{b^2}. $$

Derive the First-Order Recurrences

For \(S_n\), integrate \(x^n\sin(bx)\) by parts, taking \(u=x^n\) and \(dv=\sin(bx)\,dx\). Then \(du=nx^{n-1}\,dx\) and \(v=-\cos(bx)/b\). For \(n\ge 1\), this gives

$$ S_n(x) = -\frac{x^n\cos(bx)}{b} + \frac{n}{b}C_{n-1}(x). $$

For \(C_n\), take \(u=x^n\) and \(dv=\cos(bx)\,dx\), so \(du=nx^{n-1}\,dx\) and \(v=\sin(bx)/b\). The result, again for \(n\ge 1\), is

$$ C_n(x) = \frac{x^n\sin(bx)}{b} - \frac{n}{b}S_{n-1}(x). $$

These formulas are exact for the chosen particular antiderivatives defined from the base cases. If they are used to describe arbitrary indefinite integrals, an additive constant must be included. Each recurrence lowers the polynomial power by one but switches between the sine and cosine families.

Reduce the Power by Two

Substituting one first-order recurrence into the other produces a recurrence involving only sine integrals, or only cosine integrals. For example, when \(n\ge 2\), substitute the formula for \(C_{n-1}\) into the formula for \(S_n\):

$$ \begin{aligned} S_n &=-\frac{x^n\cos(bx)}{b}+\frac{n}{b}C_{n-1}\\ &=-\frac{x^n\cos(bx)}{b} +\frac{n x^{n-1}\sin(bx)}{b^2} -\frac{n(n-1)}{b^2}S_{n-2}. \end{aligned} $$

For the cosine family, substitute the formula for \(S_{n-1}\) into the formula for \(C_n\). This gives

$$ \begin{aligned} C_n &=\frac{x^n\sin(bx)}{b}-\frac{n}{b}S_{n-1}\\ &=\frac{x^n\sin(bx)}{b} +\frac{n x^{n-1}\cos(bx)}{b^2} -\frac{n(n-1)}{b^2}C_{n-2}. \end{aligned} $$
Theorem: For \(b\ne 0\) and integer \(n\ge 2\), $$ S_n=-\frac{x^n\cos(bx)}{b}+\frac{n x^{n-1}\sin(bx)}{b^2}-\frac{n(n-1)}{b^2}S_{n-2}, $$ $$ C_n=\frac{x^n\sin(bx)}{b}+\frac{n x^{n-1}\cos(bx)}{b^2}-\frac{n(n-1)}{b^2}C_{n-2}. $$

The two-step reduction is useful because it keeps each calculation within one family. Repeating it eventually reaches \(S_0\) or \(C_0\) when the starting power is even, and \(S_1\) or \(C_1\) when the starting power is odd. Those are the required base cases.

Worked Examples

Worked Example: Integrate \(x^2\sin(2x)\)

Here \(n=2\) and \(b=2\). Use the two-step sine recurrence, ending at \(S_0\):

$$ \begin{aligned} S_2 &=-\frac{x^2\cos(2x)}{2} +\frac{2x\sin(2x)}{2^2} -\frac{2(1)}{2^2}S_0\\ &=-\frac{x^2\cos(2x)}{2} +\frac{x\sin(2x)}{2} -\frac{1}{2}\left(-\frac{\cos(2x)}{2}\right)\\ &=-\frac{x^2\cos(2x)}{2} +\frac{x\sin(2x)}{2} +\frac{\cos(2x)}{4}. \end{aligned} $$

Thus the indefinite integral is the expression above plus \(C\). Check by differentiating its terms:

$$ \begin{aligned} \frac{d}{dx}\left(-\frac{x^2\cos(2x)}{2}\right) &=-x\cos(2x)+x^2\sin(2x),\\ \frac{d}{dx}\left(\frac{x\sin(2x)}{2}\right) &=\frac{\sin(2x)}{2}+x\cos(2x),\\ \frac{d}{dx}\left(\frac{\cos(2x)}{4}\right) &=-\frac{\sin(2x)}{2}. \end{aligned} $$

Adding these derivatives cancels the \(x\cos(2x)\) and \(\sin(2x)\) terms, leaving \(x^2\sin(2x)\), as required.

Worked Example: Integrate \(x^3\cos(x)\)

Set \(b=1\) and use the two-step cosine recurrence. Because the power is odd, the reduction ends at \(C_1\):

$$ \begin{aligned} C_3 &=x^3\sin(x)+3x^2\cos(x)-6C_1\\ &=x^3\sin(x)+3x^2\cos(x) -6\bigl(x\sin(x)+\cos(x)\bigr)\\ &=(x^3-6x)\sin(x)+(3x^2-6)\cos(x). \end{aligned} $$

Here \(C_1=x\sin(x)+\cos(x)\), obtained from the first-order recurrence or the stated base formula. Differentiate the result, using the product rule on both terms:

$$ \begin{aligned} \frac{d}{dx}\bigl((x^3-6x)\sin(x)\bigr) &=(3x^2-6)\sin(x)+(x^3-6x)\cos(x),\\ \frac{d}{dx}\bigl((3x^2-6)\cos(x)\bigr) &=6x\cos(x)-(3x^2-6)\sin(x). \end{aligned} $$

The sine terms cancel. The cosine terms combine to \((x^3-6x+6x)\cos(x)=x^3\cos(x)\). Therefore the antiderivative is correct, up to an arbitrary constant.

Worked Example: Integrate \(x^4\cos(x)\)

Now \(n=4\) and \(b=1\). First reduce to \(C_2\), then use the even-power base case:

$$ \begin{aligned} C_4 &=x^4\sin(x)+4x^3\cos(x)-12C_2,\\ C_2 &=x^2\sin(x)+2x\cos(x)-2C_0\\ &=(x^2-2)\sin(x)+2x\cos(x), \qquad C_0=\sin(x). \end{aligned} $$

Substitute the expression for \(C_2\) into \(C_4\), multiplying each term by \(-12\):

$$ \begin{aligned} C_4 &=x^4\sin(x)+4x^3\cos(x) -12\bigl((x^2-2)\sin(x)+2x\cos(x)\bigr)\\ &=(x^4-12x^2+24)\sin(x)+(4x^3-24x)\cos(x). \end{aligned} $$

To check, let \(A=x^4-12x^2+24\) and \(B=4x^3-24x\). The derivative of \(A\sin(x)+B\cos(x)\) is \((A'-B)\sin(x)+(A+B')\cos(x)\). Here \(A'=4x^3-24x=B\) and \(B'=12x^2-24\), so

$$ (A'-B)\sin(x)+(A+B')\cos(x) =0\cdot\sin(x)+x^4\cos(x). $$

This confirms the antiderivative. The check also shows why it is useful to collect the sine and cosine coefficients before differentiating.

A Reliable Recurrence Procedure

When using these formulas, identify the family, frequency, and starting power before substituting. Then reduce the index in steps of two until a base case is reached. A short record of the procedure helps prevent a dropped factor or a sign error:

1
Record the parameters.
Write down whether the integral is in the \(S_n\) or \(C_n\) family, the integer \(n\), and the nonzero frequency \(b\).
2
Apply the two-step recurrence.
Keep the terms involving \(b\) and \(b^2\) in the same positions as in the formula.
3
Continue to a base case.
Use \(S_0,C_0,S_1,\) or \(C_1\), as determined by the parity of \(n\).
4
Differentiate to check.
Use the product rule and confirm that all extra sine and cosine terms cancel.

Common Pitfall: Losing the Sign or a Factor of \(b\)

A frequent error is to use a positive cosine term in \(S_0\). Since the derivative of \(\cos(bx)\) is \(-b\sin(bx)\), the correct base antiderivative is \(-\cos(bx)/b\), not \(+\cos(bx)/b\). For example, the incorrect choice would give

$$ \frac{d}{dx}\left(\frac{\cos(bx)}{b}\right)=-\sin(bx), $$

which has the wrong sign. The correction is

$$ \frac{d}{dx}\left(-\frac{\cos(bx)}{b}\right)=\sin(bx). $$

A related mistake is to forget that differentiating \(\sin(bx)\) or \(\cos(bx)\) introduces a factor of \(b\). This is why the first integration produces \(1/b\), and the two-step recurrence contains \(1/b^2\). A useful final check is to differentiate the proposed expression rather than relying only on visual pattern matching.

Why the Recurrences Matter

Each recurrence captures the same integration-by-parts mechanism in a reusable form. The first-order versions switch between sine and cosine while lowering the power by one. The two-step versions lower the power by two without changing families, which gives a direct route to the base cases. This makes the calculation systematic for any nonnegative integer power, rather than a collection of unrelated formulas.

The recurrences also make assumptions explicit. They require an integer power \(n\ge 1\) for the first-order formulas, \(n\ge 2\) for the two-step formulas, and \(b\ne 0\) throughout. At \(n=0\) or \(n=1\), use the base cases instead of applying a recurrence with an index below zero. Once the antiderivative is obtained, differentiating it checks both the coefficients and the signs.

Check Your Understanding

Try each question by writing the relevant recurrence before substituting values.

  1. State the first-order recurrence for \(S_n\) and identify the restrictions on \(n\) and \(b\).
  2. Use the two-step recurrence to express \(S_4\) in terms of \(S_2\) and explicit trigonometric terms.
  3. Why does the two-step recurrence reduce the index by two rather than by one?
  4. Which base case is needed to evaluate \(C_5\), and why?
  5. Differentiate \(S_0=-\cos(bx)/b\) to verify its integrand.

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

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