Why These Integrals Form a Pair
Integrals of the form \(e^{ax}\sin(bx)\) and \(e^{ax}\cos(bx)\) are linked: integrating either one by parts introduces the other. Rather than treating that appearance as an obstacle, we can use it to form two equations and solve them together.
Throughout, \(a\) is any real constant and \(b\) is a nonzero real constant. The condition \(b\ne 0\) is needed to use the antiderivatives of sine and cosine in the integration-by-parts steps. The method will also work when \(a=0\); no division by \(a\) is required.
The symbol \(\doteq\) is useful because an indefinite integral represents a family of functions differing by constants. The recurrences below describe the relationship between those families. We will solve the pair and then verify the resulting formulas directly by differentiation.
Deriving the Coupled Recurrences
Begin with \(S=\int e^{ax}\sin(bx)\,dx\). For integration by parts, choose \(u=e^{ax}\) and \(dv=\sin(bx)\,dx\). Then \(du=ae^{ax}\,dx\) and \(v=-\cos(bx)/b\). Since \(b\ne0\), this choice of \(v\) is valid.
Now apply integration by parts to \(C=\int e^{ax}\cos(bx)\,dx\), choosing \(u=e^{ax}\) and \(dv=\cos(bx)\,dx\). Here \(du=ae^{ax}\,dx\) and \(v=\sin(bx)/b\), so the second recurrence is
Each recurrence contains the other integral. Taken together, however, they form a pair of linear equations in \(S\) and \(C\). The coupled structure is the key: substitute one relation into the other, or eliminate one integral by algebra.
Solving the Pair
Clear the denominators by multiplying both equations by \(b\). Substitution then eliminates one of the integrals. For \(S\), substitute \(bC\doteq e^{ax}\sin(bx)-aS\) into the first equation after multiplying it by \(b\):
Move the term \(-a^2S\) to the left and collect the terms involving \(S\):
Because \(a\) and \(b\) are real and \(b\ne0\), \(a^2+b^2>0\). We may divide by this quantity. Eliminating \(S\) in the same way gives the corresponding expression for \(C\). Therefore the antiderivative formulas are
Here \(K_1\) and \(K_2\) are arbitrary constants. They are written separately because the two indefinite integrals are separate families of antiderivatives. The denominator is never zero under the stated assumptions, including when \(a=0\).
Why the Formulas Work
The integration-by-parts recurrences explain how the two integrals depend on each other. The final formulas can also be justified completely by differentiation. This independent check is especially useful because a sign error in either recurrence can produce a plausible-looking but incorrect result.
Let \(F(x)=e^{ax}(a\sin(bx)-b\cos(bx))/(a^2+b^2)\). By the product rule, its derivative is \(e^{ax}\) times the derivative of the bracket, plus \(ae^{ax}\) times the bracket, all divided by \(a^2+b^2\). The derivative of the bracket is \(ab\cos(bx)+b^2\sin(bx)\). Hence
The cosine formula checks similarly. If \(G(x)=e^{ax}(a\cos(bx)+b\sin(bx))/(a^2+b^2)\), the derivative of the bracket is \(-ab\sin(bx)+b^2\cos(bx)\). Therefore
Both candidates differentiate to their respective integrands, so each is an antiderivative. Any other antiderivative of the same function differs by a constant on an interval, which accounts for \(K_1\) and \(K_2\).
Worked Examples
Worked Example: A Positive Exponential Rate
Find both \(\int e^{2x}\sin(3x)\,dx\) and \(\int e^{2x}\cos(3x)\,dx\). Here \(a=2\), \(b=3\), and \(a^2+b^2=2^2+3^2=4+9=13\). Substitution into the formulas gives
Check the sine antiderivative by differentiating its nonconstant part:
For the cosine antiderivative, differentiation gives
Worked Example: A Negative Exponential Rate
Evaluate \(\int e^{-x}\sin(2x)\,dx\). The parameters are \(a=-1\) and \(b=2\), so \(a^2+b^2=(-1)^2+2^2=1+4=5\). The numerator is \(e^{-x}(-\sin(2x)-2\cos(2x))\). Thus
To check, differentiate the displayed expression without its constant. Write it as \(\frac{1}{5}e^{-x}P(x)\) with \(P(x)=-\sin(2x)-2\cos(2x)\), so \(P'(x)=-2\cos(2x)+4\sin(2x)\). The product rule, including the derivative \(-e^{-x}\) of \(e^{-x}\), gives
The derivative equals the integrand, so the antiderivative is \(-\frac{e^{-x}(\sin(2x)+2\cos(2x))}{5}+K\), as given by the general formula. The check also illustrates why product-rule signs should be written out before collecting terms.
Worked Example: Zero Exponential Rate
Find both integrals when \(a=0\) and \(b=4\). The denominator is \(0^2+4^2=16\). With \(a=0\), the sine formula has numerator \(-b\cos(bx)\) and the cosine formula has numerator \(b\sin(bx)\). Substitution gives
Differentiate to verify both results:
This example emphasizes that the numerator and denominator must both be substituted and simplified correctly; the general formula remains valid at \(a=0\).
A Sign Pitfall to Avoid
A frequent mistake is to use \(v=\cos(bx)/b\) as an antiderivative of \(\sin(bx)\). That is incorrect because
not \(\sin(bx)\). The correct antiderivative is \(v=-\cos(bx)/b\), since its derivative is \(\sin(bx)\). Using the wrong sign produces a wrong first recurrence, and the error then spreads into the solved formula. A reliable check at the integration-by-parts stage is to differentiate each chosen \(v\) before proceeding.
Another tempting but invalid shortcut is to divide by \(a\) while solving. The parameter \(a\) is allowed to be zero, so such a step would exclude a valid case. The elimination above divides only by \(a^2+b^2\), which is positive because \(b\ne0\). That condition is sufficient and includes both positive, negative, and zero values of \(a\).
When the Coupled Method Is Useful
The recurrences are useful when integration by parts produces a cycle rather than a simpler integral. One recurrence alone does not finish the calculation: it introduces the companion integral. The second recurrence supplies the additional equation needed to eliminate both unknown integrals algebraically.
The resulting expressions are compact, but the method also provides a dependable route to them: identify the two related integrals, derive both equations with their signs intact, solve the coupled pair, and differentiate the result. Keeping those steps distinct helps reveal whether a problem is in the integration-by-parts setup, the algebra, or the final verification.
Check Your Understanding
Use the recurrence pair and the final formulas to answer the following questions.
- What choices of \(u\) and \(dv\) produce the recurrence for \(S\), and why must \(b\) be nonzero?
- Write the recurrence for \(C\) and identify where its minus sign comes from.
- Why is it valid to divide by \(a^2+b^2\) for all real \(a\) when \(b\ne0\)?
- Use the formulas to find \(\int e^{3x}\cos(2x)\,dx\).
- Explain why the recurrence equations for indefinite integrals are understood up to additive constants.