Tutorials › AP Calculus › Cyclic Integration by Parts for Trigonometric-Exponential Products

Numerical and BC Integration Methods · Tutorial 521 of 999

Cyclic Integration by Parts for Trigonometric-Exponential Products

Use repeated integration by parts to make the original trigonometric-exponential integral reappear, then solve for it.

Advanced 9 min read

What You'll Learn

  • Set up the two linked integrals for exponential-cosine and exponential-sine products.
  • Derive the cyclic integration-by-parts formulas and understand why solving the cycle works.
  • Find antiderivatives for products involving general exponential and trigonometric rates.
  • Evaluate a definite integral using the resulting antiderivative and boundary values.
  • Recognize and correct sign errors in the cyclic equations.

When Integration by Parts Comes Back to Its Starting Point

Some integrals do not become simpler after one use of integration by parts. Instead, a second use produces the original integral again. This is not a dead end: the repeated appearance of the original integral creates an equation that can be solved for it.

This happens naturally with products of an exponential function and a sine or cosine function. Differentiating sine and cosine moves back and forth between them, while integrating an exponential reproduces an exponential. After two integrations by parts, the first trigonometric function returns. The method is therefore called cyclic integration by parts.

Key idea: When repeated integration by parts expresses an unknown integral in terms of itself and known functions, collect the integral terms on one side and solve the resulting equation.

The Paired Integrals

Let \(a\) and \(b\) be real constants, and first assume \(a\ne 0\). Define \(I\) and \(J\) to be antiderivatives of the two integrands:

$$ I' = e^{ax}\cos(bx), \qquad J' = e^{ax}\sin(bx). $$

Equivalently, we can write \(I=\int e^{ax}\cos(bx)\,dx\) and \(J=\int e^{ax}\sin(bx)\,dx\), understanding that indefinite antiderivatives are determined up to an additive constant. For the first integration by parts, take \(u=\cos(bx)\) and \(dv=e^{ax}\,dx\). Then \(du=-b\sin(bx)\,dx\) and \(v=e^{ax}/a\), giving

$$ I=\frac{e^{ax}\cos(bx)}{a}+\frac{b}{a}J+C_1. $$

For the second integral, take \(u=\sin(bx)\) and \(dv=e^{ax}\,dx\). Now \(du=b\cos(bx)\,dx\), so

$$ J=\frac{e^{ax}\sin(bx)}{a}-\frac{b}{a}I+C_2. $$

The cycle is visible: the equation for \(I\) contains \(J\), and the equation for \(J\) contains \(I\). The constants \(C_1\) and \(C_2\) do not affect the integration-by-parts relationships between derivatives; when we solve for an indefinite antiderivative, their contributions combine into a single arbitrary constant.

Deriving the General Formulas

Substitute the second relation into the first. Keeping track of the coefficients gives

$$ \begin{aligned} I &=\frac{e^{ax}\cos(bx)}{a} +\frac{b}{a}\left(\frac{e^{ax}\sin(bx)}{a}-\frac{b}{a}I\right)+C\\ &=\frac{e^{ax}\cos(bx)}{a} +\frac{b e^{ax}\sin(bx)}{a^2} -\frac{b^2}{a^2}I+C. \end{aligned} $$

Move the term involving \(I\) to the left and multiply through by \(a^2\):

$$ (a^2+b^2)I=e^{ax}\bigl(a\cos(bx)+b\sin(bx)\bigr)+C. $$

The same elimination can be done for \(J\). Substitute the first relation into the second, or use the first solved formula in the second. This gives the paired antiderivatives below. In each formula, the arbitrary constant is written once at the end.

Theorem: If \(a\) and \(b\) are real and not both zero, then $$ \int e^{ax}\cos(bx)\,dx =\frac{e^{ax}\bigl(a\cos(bx)+b\sin(bx)\bigr)}{a^2+b^2}+C, $$ and $$ \int e^{ax}\sin(bx)\,dx =\frac{e^{ax}\bigl(a\sin(bx)-b\cos(bx)\bigr)}{a^2+b^2}+C. $$

The cyclic integration-by-parts derivation used \(a\ne0\), because it required integrating \(e^{ax}\) as \(e^{ax}/a\). If \(a=0\) and \(b\ne0\), the formulas still hold, but the integrals are found directly from the basic antiderivatives of sine and cosine. If \(b=0\) and \(a\ne0\), the formulas reduce to the antiderivative of \(e^{ax}\) for the cosine integral and zero for the sine integral. If \(a=b=0\), the integrands are \(1\) and \(0\), respectively, and the displayed formulas do not apply because their denominator is zero.

Worked Examples

Worked Example: Integrate an Exponential Times a Cosine

Find \(\int e^{2x}\cos(3x)\,dx\) by cyclic integration by parts. Write \(I=\int e^{2x}\cos(3x)\,dx\) and \(J=\int e^{2x}\sin(3x)\,dx\). Integrating the exponential factor gives

$$ I=\frac{e^{2x}\cos(3x)}{2}+\frac{3}{2}J+C_1. $$

For \(J\), integration by parts gives

$$ J=\frac{e^{2x}\sin(3x)}{2}-\frac{3}{2}I+C_2. $$

Substitute the expression for \(J\) into the expression for \(I\), combining additive constants into \(C\):

$$ \begin{aligned} I &=\frac{e^{2x}\cos(3x)}{2} +\frac{3}{2}\left(\frac{e^{2x}\sin(3x)}{2}-\frac{3}{2}I\right)+C\\ &=\frac{e^{2x}\cos(3x)}{2} +\frac{3e^{2x}\sin(3x)}{4}-\frac{9}{4}I+C. \end{aligned} $$

Therefore \(\frac{13}{4}I=e^{2x}\bigl(\frac12\cos(3x)+\frac34\sin(3x)\bigr)+C\), so

$$ \int e^{2x}\cos(3x)\,dx =\frac{e^{2x}\bigl(2\cos(3x)+3\sin(3x)\bigr)}{13}+C. $$

Check by differentiating. The derivative of the numerator’s product, before division by \(13\), is \(e^{2x}\bigl(2(2\cos(3x)-3\sin(3x))+3(2\sin(3x)+3\cos(3x))\bigr)\). The cosine coefficient is \(4+9=13\), and the sine coefficient is \(-6+6=0\). Dividing by \(13\) leaves \(e^{2x}\cos(3x)\), as required.

Worked Example: Integrate an Exponential Times a Sine

Find \(\int e^x\sin(2x)\,dx\). Set \(J=\int e^x\sin(2x)\,dx\) and \(I=\int e^x\cos(2x)\,dx\). Integration by parts gives

$$ I=e^x\cos(2x)+2J+C_1, \qquad J=e^x\sin(2x)-2I+C_2. $$

Substitute the expression for \(I\) into the equation for \(J\), absorbing constants into \(C\):

$$ \begin{aligned} J &=e^x\sin(2x)-2\bigl(e^x\cos(2x)+2J\bigr)+C\\ &=e^x\sin(2x)-2e^x\cos(2x)-4J+C. \end{aligned} $$

Thus \(5J=e^x\bigl(\sin(2x)-2\cos(2x)\bigr)+C\), and

$$ \int e^x\sin(2x)\,dx =\frac{e^x\bigl(\sin(2x)-2\cos(2x)\bigr)}{5}+C. $$

For a check, differentiate the proposed antiderivative. The product rule gives \(e^x/5\) times \(\sin(2x)-2\cos(2x)+2\cos(2x)+4\sin(2x)\). The cosine terms cancel and the sine terms total \(5\sin(2x)\), so the derivative is \(e^x\sin(2x)\).

Worked Example: Evaluate a Definite Integral

Evaluate \(\int_0^{\pi/2}e^x\cos x\,dx\). From the paired formula with \(a=b=1\), an antiderivative is \(F(x)=\frac12e^x(\cos x+\sin x)\). Apply the Fundamental Theorem of Calculus by evaluating at both endpoints:

$$ \begin{aligned} \int_0^{\pi/2}e^x\cos x\,dx &=F\left(\frac{\pi}{2}\right)-F(0)\\ &=\frac12e^{\pi/2}\left(\cos\frac{\pi}{2}+\sin\frac{\pi}{2}\right) -\frac12e^0(\cos 0+\sin 0)\\ &=\frac12e^{\pi/2}(0+1)-\frac12(1)(1+0)\\ &=\frac{e^{\pi/2}-1}{2}. \end{aligned} $$

Differentiate \(F(x)\) to check the antiderivative: \(F'(x)=\frac12e^x(\cos x+\sin x)+\frac12e^x(-\sin x+\cos x)=e^x\cos x\). The endpoint subtraction and the antiderivative are both verified.

Why Solving the Cycle Works

Integration by parts is an identity that follows from the product rule. For differentiable functions \(u\) and \(v\), the product rule says \((uv)'=u'v+uv'\). Integrating both sides over an interval gives the integration-by-parts identity, and the same relationship holds for antiderivatives up to a constant. In the trigonometric-exponential case, the first integration creates the paired integral, and the second creates the original one. Because the original integral appears with a coefficient, the result is an ordinary linear equation in that integral.

The denominator \(a^2+b^2\) records the coefficient produced when the cycle is closed. It is positive whenever \(a\) and \(b\) are not both zero, so dividing by it is valid in the stated cases. The formulas can also be checked independently: differentiating each right-hand side uses the product rule and the derivatives of sine and cosine, and the terms involving the unwanted trigonometric function cancel.

A Sign Error to Avoid

The signs in the second integration by parts matter. For example, let \(I=\int e^x\cos x\,dx\) and \(J=\int e^x\sin x\,dx\). Correctly applying integration by parts gives \(I=e^x\cos x+J+C_1\) and \(J=e^x\sin x-I+C_2\). The minus sign in the second equation comes from differentiating \(\sin x\): its derivative is \(+\cos x\), so the integration-by-parts subtraction produces \(-I\).

A common incorrect step is to write \(J=e^x\sin x+I\), changing that minus sign to a plus. Substituting this false equation into \(I=e^x\cos x+J\) would give \(I=e^x(\cos x+\sin x)+I\), and hence \(0=e^x(\cos x+\sin x)\), which is not an identity. The contradiction is a warning to revisit the integration by parts. With the correct sign, substitution gives \(I=e^x(\cos x+\sin x)-I+C\), so \(2I=e^x(\cos x+\sin x)+C\), as expected.

Using the Method Efficiently

Before beginning, check whether the integrand has the form \(e^{ax}\cos(bx)\) or \(e^{ax}\sin(bx)\), with constant rates \(a\) and \(b\). Set up both paired integrals, and keep the signs from differentiating the trigonometric factor explicit. After substituting one equation into the other, gather all copies of the target integral on the same side. Finally, verify the result by differentiation; this is particularly useful because a sign error can leave a plausible-looking expression that is nevertheless incorrect.

1
Name both integrals.
Use one for the cosine product and one for the sine product so the returning integral is easy to identify.
2
Integrate by parts twice.
Record the derivative of each trigonometric factor carefully, including its factor of \(b\).
3
Substitute and solve.
Replace the paired integral, collect the target integral, and divide by its resulting coefficient.
4
Check by differentiation.
Use the product rule to confirm that the proposed antiderivative differentiates to the original integrand.

Cyclic integration by parts is useful because it turns a repeated procedure into a finite algebraic calculation. Once the cycle has returned to its starting point, continuing to integrate by parts is unnecessary: solving the equation is the step that completes the method.

Check Your Understanding

For each question, keep track of the signs and verify any antiderivative by differentiation.

  1. For \(\int e^{3x}\cos(2x)\,dx\), what are the two paired integrals and the integration-by-parts equations?
  2. Use the paired formulas to find \(\int e^{2x}\sin x\,dx\).
  3. Why does the cyclic method require a separate direct check when \(a=0\)?
  4. What antiderivative does the cosine formula give when \(b=0\) and \(a\ne0\)?
  5. For \(a=b=1\), identify the sign in the equation for \(\int e^x\sin x\,dx\) that is essential to closing the cycle.

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