Why This Product Has a Compact Antiderivative
An exponential multiplied by a trigonometric function can look as if it requires integration by parts repeatedly. In this case, however, integration by parts returns to the same two types of integrals. The resulting pair of equations can be solved together, giving a compact formula.
The parameters have different roles. The number \(a\) is the exponential rate in \(e^{ax}\), while \(b\) is the angular frequency in \(\cos(bx)\). Both affect the coefficients in the antiderivative. Keeping track of them carefully is essential, especially for the signs and the denominator.
The Formula
When \(a\) and \(b\) are not both zero, the antiderivative is
The denominator is the sum of the squares of the rate and frequency. It is positive whenever at least one of \(a\) and \(b\) is nonzero, so the formula is defined in precisely those cases. If both are zero, the integrand is \(1\), and its antiderivative is \(x+C\).
The formula can be remembered by noting that the coefficient of cosine in the numerator is \(a\), while the coefficient of sine is \(b\). The sine term has a plus sign. The derivation below explains why these coefficients and signs occur.
Derivation by Cyclic Integration by Parts
First suppose \(b\ne 0\). Write \(I\) for an antiderivative of \(e^{ax}\cos(bx)\), and \(J\) for an antiderivative of \(e^{ax}\sin(bx)\). Integration by parts gives an equation for each. In these indefinite-integral equations, additive constants are understood and can be combined into the final constant.
For \(I\), take \(u=e^{ax}\) and \(dv=\cos(bx)\,dx\). Then \(du=ae^{ax}\,dx\) and \(v=\sin(bx)/b\), so
For \(J\), take \(u=e^{ax}\) and \(dv=\sin(bx)\,dx\). Now \(v=-\cos(bx)/b\), which gives
Substitute the second equation into the first. Each term matters: the minus sign in front of \(J\) changes the sign of both terms obtained from the expression for \(J\).
Move the last term involving \(I\) to the left, then multiply by \(b^2\). Since \(b\ne0\), these steps are valid.
When \(a\) and \(b\) are not both zero, division by \(a^2+b^2\) yields the stated expression for \(I\), with an arbitrary constant added. This derivation directly establishes the formula whenever \(b\ne0\). If \(b=0\) and \(a\ne0\), the cosine factor is constant and direct integration gives the same formula. The case \(a=b=0\) is handled separately because the displayed denominator would be zero.
Worked Examples
Worked Example: Rate 2 and Frequency 3
Find an antiderivative of \(e^{2x}\cos(3x)\). Here \(a=2\), \(b=3\), and \(a^2+b^2=2^2+3^2=4+9=13\). Substitution into the formula gives
Check by differentiating. The product rule gives one contribution from \(e^{2x}\) and one from the trigonometric expression:
The derivative is the original integrand, so \(F(x)+C\) is the required family of antiderivatives.
Worked Example: A Negative Exponential Rate
Find an antiderivative of \(e^{-x}\cos(2x)\). The parameters are \(a=-1\) and \(b=2\), so \(a^2+b^2=1+4=5\). The formula gives
To check the result, differentiate the exponential and the expression in parentheses. The derivative of \(-\cos(2x)\) is \(2\sin(2x)\), and that of \(2\sin(2x)\) is \(4\cos(2x)\). Therefore,
The negative rate changes the coefficient of cosine in the numerator to \(-1\), but the frequency coefficient remains \(2\). The derivative check confirms both signs.
Worked Example: Zero Frequency
Find an antiderivative of \(e^{3x}\cos(0x)\). Since \(\cos(0x)=1\), the integrand is \(e^{3x}\). In the general formula, \(a=3\), \(b=0\), and \(a^2+b^2=9\), giving
Differentiate to verify:
This case can also be integrated directly. It illustrates that a zero frequency is allowed in the formula as long as the exponential rate is nonzero.
Worked Example: Zero Exponential Rate
Find an antiderivative of \(e^{0x}\cos(4x)\). Here \(e^{0x}=1\), so the integrand is \(\cos(4x)\). The parameters are \(a=0\), \(b=4\), and \(a^2+b^2=16\). Thus,
Differentiating gives
The formula also covers a pure cosine because its denominator remains nonzero when \(b\ne0\), even though \(a=0\).
Checking the Formula Directly
There is a short way to verify the general result that also reveals why the numerator has its particular form. Assume \(a\) and \(b\) are not both zero, and set \(D=a^2+b^2\). Differentiate the proposed expression using the product rule and the chain rule.
The sine terms cancel, while the cosine terms combine to give exactly \(a^2+b^2\). Dividing by that quantity therefore leaves the desired integrand. This verification also checks the formula for either zero-parameter case, provided the parameters are not both zero.
A Common Sign Error
A frequent mistake is to put a minus sign before the sine term. For \(a=2\) and \(b=3\), that incorrect choice would be
This is not an antiderivative of \(e^{2x}\cos(3x)\). Differentiating it shows exactly where it fails:
The result includes an unwanted sine term and has the wrong cosine coefficient. The correction is to use a plus sign between \(a\cos(bx)\) and \(b\sin(bx)\). With that sign, the sine terms from differentiating cancel, as the direct verification demonstrates.
Choosing and Using the Formula
Before substituting parameters, identify which number is the exponential rate and which is the frequency. In \(e^{ax}\cos(bx)\), \(a\) multiplies \(x\) in the exponent, and \(b\) multiplies \(x\) inside the cosine. Then calculate the denominator as \(a^2+b^2\); do not replace it with \(a+b\) or omit the square on either parameter.
The parameter cases can be summarized as follows:
| Parameter condition | Antiderivative |
|---|---|
| \(a\ne0\), \(b\ne0\) | \(\dfrac{e^{ax}(a\cos(bx)+b\sin(bx))}{a^2+b^2}+C\) |
| \(a\ne0\), \(b=0\) | \(\dfrac{e^{ax}}{a}+C\) |
| \(a=0\), \(b\ne0\) | \(\dfrac{\sin(bx)}{b}+C\) |
| \(a=0\), \(b=0\) | \(x+C\) |
The general expression reproduces the middle two cases when exactly one parameter is zero. The last case must be separated because then \(a^2+b^2=0\). As a practical habit, differentiate the proposed answer: the product rule and chain rule expose sign, coefficient, and frequency errors immediately.
Check Your Understanding
Answer these questions by applying the formula and checking the result where appropriate.
- Find an antiderivative of \(e^{x}\cos(2x)\), and verify it by differentiation.
- For \(e^{-2x}\cos(3x)\), what are \(a\), \(b\), and \(a^2+b^2\)?
- Explain why the formula applies when \(a=0\) but \(b\ne0\).
- What is an antiderivative of \(e^{0x}\cos(0x)\), and why can the general fraction not be used in this case?
- When differentiating the general formula, which terms cancel, and which terms combine to produce the denominator?