Tutorials › Calculus II › Linear Polynomial Factors with Exponential Sines

Repeated and Tabular Parts · Tutorial 68 of 998

Linear Polynomial Factors with Exponential Sines

Reduce ∫(px+q)e^{ax} sin(bx) dx to one parts step plus the cyclic formula for ∫e^{ax} sin(bx) dx, then check the result by differentiating.

Intermediate 10 min read

What You'll Learn

  • Recall the cyclic antiderivatives of e^{ax} sin(bx) and e^{ax} cos(bx).
  • Apply one integration by parts to remove the linear factor px + q.
  • Assemble the general formula with the quantity a² + b².
  • Evaluate specific integrals and definite integrals with exact arithmetic.
  • Verify the answer by differentiation using the product rule.

A Linear Factor Times an Exponential Sine

Earlier tutorials showed that \(\int e^{ax}\sin bx\,dx\) requires integrating by parts twice and solving for the integral, a cyclic argument. When a linear polynomial \(px+q\) multiplies the integrand, the method still works, but the polynomial must be reduced as well. The efficient plan is to apply integration by parts once to remove the polynomial, which leaves integrals of \(e^{ax}\sin bx\) and \(e^{ax}\cos bx\), and then to use the two cyclic formulas.

Write \(\Delta=a^2+b^2\), which appears in every denominator below. The formulas assume that \(a\) and \(b\) are not both zero, so that \(\Delta>0\).

The Two Cyclic Formulas

$$ \int e^{ax}\sin bx\,dx=\frac{e^{ax}(a\sin bx-b\cos bx)}{\Delta}+C,\qquad \int e^{ax}\cos bx\,dx=\frac{e^{ax}(a\cos bx+b\sin bx)}{\Delta}+C. $$

Differentiating either formula with the product rule confirms it. For instance, the derivative of \(e^{ax}(a\sin bx-b\cos bx)\) is \(e^{ax}\bigl[a(a\sin bx-b\cos bx)+ab\cos bx+b^2\sin bx\bigr]=e^{ax}\Delta\sin bx\), and dividing by \(\Delta\) gives the integrand.

Deriving the General Result

Let \(u=px+q\) and \(dv=e^{ax}\sin bx\,dx\). Then \(du=p\,dx\) and \(v=\frac{e^{ax}(a\sin bx-b\cos bx)}{\Delta}\). Integration by parts gives

$$ \int(px+q)e^{ax}\sin bx\,dx=(px+q)\frac{e^{ax}(a\sin bx-b\cos bx)}{\Delta}-\frac{p}{\Delta}\int e^{ax}(a\sin bx-b\cos bx)\,dx. $$

The remaining integral uses both cyclic formulas: \(a\int e^{ax}\sin bx\,dx-b\int e^{ax}\cos bx\,dx=\frac{e^{ax}}{\Delta}\bigl[a(a\sin bx-b\cos bx)-b(a\cos bx+b\sin bx)\bigr]=\frac{e^{ax}\bigl[(a^2-b^2)\sin bx-2ab\cos bx\bigr]}{\Delta}\). Putting the pieces together:

Result: \(\displaystyle\int(px+q)e^{ax}\sin bx\,dx=\frac{e^{ax}}{\Delta}\Bigl\{\Bigl[a(px+q)-\frac{p(a^2-b^2)}{\Delta}\Bigr]\sin bx-\Bigl[b(px+q)-\frac{2abp}{\Delta}\Bigr]\cos bx\Bigr\}+C\), where \(\Delta=a^2+b^2\).

In practice, do not memorize this formula. Learn the two-step procedure and carry the specific numbers through it, as the examples below do.

Worked Examples

Worked Example: a = b = 1

Find \(\int xe^{x}\sin x\,dx\).

Here \(p=1\), \(q=0\), \(a=b=1\), and \(\Delta=2\). Then \(a^2-b^2=0\) and \(2ab=2\). The first bracket of the general formula is \(a(px+q)-\frac{p(a^2-b^2)}{\Delta}=x\), and the second is \(b(px+q)-\frac{2abp}{\Delta}=x-1\). Therefore the antiderivative is \(\frac{e^x}{2}\bigl[x\sin x-(x-1)\cos x\bigr]\), or

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

Differentiating confirms the answer: the product rule produces \(\frac{e^x}{2}\bigl[x\sin x+(1-x)\cos x+\sin x+x\cos x-\cos x-(1-x)\sin x\bigr]\), and the bracket simplifies to \(2x\sin x\).

Worked Example: A Decaying Exponential

Find \(\int(2x+1)e^{-x}\sin2x\,dx\).

Here \(p=2\), \(q=1\), \(a=-1\), \(b=2\), and \(\Delta=5\). Then \(a^2-b^2=-3\) and \(2ab=-4\). The first bracket is \(a(px+q)-\frac{p(a^2-b^2)}{\Delta}=-(2x+1)+\frac65=-2x+\frac15\), and the second is \(b(px+q)-\frac{2abp}{\Delta}=2(2x+1)+\frac85=4x+\frac{18}{5}\). Multiplying through by \(\frac{1}{\Delta}=\frac15\) and clearing fractions gives

$$ \int(2x+1)e^{-x}\sin2x\,dx=\frac{e^{-x}}{25}\bigl[(1-10x)\sin2x-(20x+18)\cos2x\bigr]+C. $$

The decay of the exponential means the antiderivative also decays, and the linear factors dominate the amplitude at large \(x\).

Worked Example: A Growing Exponential

Find \(\int(x-3)e^{2x}\sin x\,dx\).

Here \(p=1\), \(q=-3\), \(a=2\), \(b=1\), and \(\Delta=5\). The first bracket is \(2(x-3)-\frac35=2x-\frac{33}{5}\), and the second is \((x-3)-\frac45=x-\frac{19}{5}\). Dividing by \(\Delta=5\) and clearing fractions gives

$$ \int(x-3)e^{2x}\sin x\,dx=\frac{e^{2x}}{25}\bigl[(10x-33)\sin x+(19-5x)\cos x\bigr]+C. $$

The fractions \(\frac{33}{5}\) and \(\frac{19}{5}\) come from combining the constant \(q=-3\) with the correction terms, which is where arithmetic slips are most common. Differentiating the answer is the safest check.

Worked Example: A Definite Integral

Evaluate \(\int_0^{\pi}xe^{x}\sin x\,dx\).

Using the first example, at \(x=\pi\) we have \(\sin\pi=0\) and \(\cos\pi=-1\), so the bracket equals \(-(1-\pi)=\pi-1\). At \(x=0\) the bracket equals \(1\). Therefore

$$ \int_0^{\pi}xe^x\sin x\,dx=\frac{e^{\pi}(\pi-1)}{2}-\frac12\approx24.3. $$

The large value reflects the growth of \(e^x\) over \([0,\pi]\), where \(e^\pi\approx23.1\).

A Reliable Procedure

1
Identify the constants.
Read off \(p,q,a,b\) and compute \(\Delta=a^2+b^2\).
2
Choose the parts.
Take \(u=px+q\) and \(dv=e^{ax}\sin bx\,dx\).
3
Use the cyclic formula for v.
\(v=\frac{e^{ax}(a\sin bx-b\cos bx)}{\Delta}\).
4
Integrate the remaining exponential-trigonometric term.
Apply both cyclic formulas, then divide by \(\Delta\) again.
5
Differentiate to check.
Confirm that all non-polynomial terms recombine to \((px+q)e^{ax}\sin bx\).

Common Mistakes

The leading mistakes are forgetting that \(\Delta\) appears squared in the correction term, mixing the signs in \(a\sin bx-b\cos bx\), and dropping the factor \(p\) in front of the reduction integral. Another is to skip the check: with four parameters in the formula, a sign slip is very likely, and differentiation catches it quickly. It also helps to keep fractions until the last step and clear them only once, so that the common denominator \(\Delta^2\) is handled in one place rather than in several.

Practice Problems with Answers

Try each problem before reading the answer. Every answer below was checked by differentiation or by numerical integration.

  1. Find an antiderivative of \(xe^x\sin x\). Hint: here \(\Delta=2\). Answer: \(\frac{e^x}{2}[x\sin x+(1-x)\cos x]\)
  2. Evaluate \(\int_0^{\pi}xe^x\sin x\,dx\). Hint: use \(\sin\pi=0\), \(\cos\pi=-1\). Answer: \(\frac{e^\pi(\pi-1)}{2}-\frac12\)
  3. Find an antiderivative of \((x-3)e^{2x}\sin x\). Hint: here \(\Delta=5\). Answer: \(\frac{e^{2x}}{25}[(10x-33)\sin x+(19-5x)\cos x]\)
  4. Evaluate \(\int_0^{\pi}(2x+1)e^{-x}\sin2x\,dx\). Hint: evaluate the second example at \(0\) and \(\pi\). Answer: \(\frac{2}{25}\bigl(9-(10\pi+9)e^{-\pi}\bigr)\approx0.580\)
Takeaway: For \((px+q)e^{ax}\sin bx\), integrate by parts once with \(u=px+q\), use the cyclic formulas to supply \(v\) and the leftover integral, and keep \(\Delta=a^2+b^2\) in every denominator.

Why the Answer Has This Form

Every antiderivative in this family has the shape \(e^{ax}\bigl[(Ax+B)\sin bx+(Cx+D)\cos bx\bigr]\) with constants \(A,B,C,D\). The exponential and the trigonometric pair are preserved by differentiation, and the linear factor stays linear. This suggests a second method, undetermined coefficients: assume that shape, differentiate, and match coefficients of \(xe^{ax}\sin bx\), \(xe^{ax}\cos bx\), \(e^{ax}\sin bx\), and \(e^{ax}\cos bx\) with those of the integrand. It yields four linear equations and the same answer. The parts method is faster to carry out by hand, but the form tells you what to expect and helps when checking.

Special Cases

If \(a=0\), the integrand is \((px+q)\sin bx\), and \(\Delta=b^2\). The general formula reduces to \(-\frac{(px+q)\cos bx}{b}+\frac{p\sin bx}{b^2}\), which is the familiar result from a single parts step. If \(b=0\), the integrand is zero and the formula degenerates, so the case does not arise. If \(p=0\), the polynomial is constant and the formula returns \(q\) times the cyclic formula.

A Numerical Spot Check

Test the first example at \(x=1\). The integrand \(xe^x\sin x\) equals \(e\sin1=2.7183\cdot0.8415=2.287\). The derivative of the antiderivative \(\frac{e^x}{2}[x\sin x+(1-x)\cos x]\) at \(x=1\) is, by the computation in that example, \(\frac{e}{2}\cdot2\sin1=e\sin1\), which matches. A single-point check like this does not prove the formula, but a mismatch would reveal an error immediately, and it takes only a few seconds.

For a definite integral, a rough numerical estimate is also reassuring. The integral \(\int_0^\pi xe^x\sin x\,dx\approx24.3\) can be compared with a Simpson estimate from the values \(0\), \(\frac\pi2e^{\pi/2}\approx7.56\), and \(0\) at \(0\), \(\frac\pi2\), and \(\pi\): \(\frac{\pi/2}{3}(0+4\cdot7.56+0)\approx15.8\). The coarse rule is low because the integrand peaks beyond \(\frac\pi2\), where the exponential growth is larger, but it is the right order of magnitude. A finer rule with more points would close the gap, and any error in the exact answer of the size of a missing factor of \(2\) or \(e\) would show up even at this coarse level.

Where This Fits in the Course

This tutorial belongs to the module “Repeated and Tabular Parts”. The tutorial just before it is “Deriving Recurrences for Exponential-Trigonometric Moments,” and the one that follows is “Quadratic Polynomial Factors with Exponential Cosines.” It combines the polynomial reduction of tabular parts with the cyclic argument you have already used.

Check Your Understanding

Use the procedure and examples above to answer these questions.

  1. What is \(\Delta\) for \(e^{3x}\sin 4x\)?
  2. Why does one integration by parts remove the linear factor?
  3. Evaluate \(\int_0^\pi xe^x\sin x\,dx\).
  4. Which cyclic formula is needed for the leftover integral?
  5. Differentiate \(\frac{e^x}{2}[x\sin x+(1-x)\cos x]\) and confirm that the result is \(xe^x\sin x\).

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