Why the Finite-Interval Form Matters
An integral such as \(\int_L^U x e^{ax}\sin(bx)\,dx\) combines three features: a polynomial factor, exponential growth or decay, and oscillation. The linear factor calls for integration by parts, while the sine and cosine terms are linked when differentiated or integrated. Treating those trigonometric integrals as a pair produces a compact method that works for any finite endpoints.
For a definite integral, the endpoints are part of the calculation, not an afterthought. In particular, the factor \(x\) means the upper and lower boundary terms need not disappear even when one endpoint is zero. We will keep those terms explicit and use the resulting antiderivatives to evaluate both the sine-weighted and cosine-weighted cases.
The Paired Antiderivatives
Write \(D=a^2+b^2\). When \(D>0\), equivalently when \(a\) and \(b\) are not both zero, define
A product-rule differentiation gives \(S_0'(x)=e^{ax}\sin(bx)\) and \(C_0'(x)=e^{ax}\cos(bx)\). These are the paired antiderivatives for the exponential-sine and exponential-cosine terms. Integrating those antiderivatives once more gives the useful cyclic identities
For example, the derivative of \((aS_0-bC_0)/D\) is \[ \frac{a e^{ax}\sin(bx)-b e^{ax}\cos(bx)}{D}=S_0(x). \] Similarly, the derivative of \((aC_0+bS_0)/D\) is \(C_0(x)\). The two antiderivatives are coupled: integrating the sine expression involves both \(S_0\) and \(C_0\), and integrating the cosine expression does too.
Deriving the Linear-Weight Formulas
Apply integration by parts to \(x e^{ax}\sin(bx)\), taking \(u=x\) and \(dv=e^{ax}\sin(bx)\,dx\). Then \(du=dx\) and \(v=S_0(x)\). Thus an antiderivative is \(xS_0-\int S_0\,dx\). The cyclic identity above evaluates the remaining integral. The cosine case follows by taking \(v=C_0(x)\) instead.
The derivative check is also the reason the method works. For the sine case, differentiating \(xS_0\) gives \(S_0+x e^{ax}\sin(bx)\); differentiating the subtracted cyclic term gives \(S_0\). They cancel, leaving the desired integrand. For the cosine case the same cancellation leaves \(x e^{ax}\cos(bx)\). The Fundamental Theorem of Calculus then gives the endpoint differences.
Use \(S_0\) and \(C_0\) with the same \(D=a^2+b^2\).
Integration by parts gives \(xS_0-\int S_0\,dx\) or \(xC_0-\int C_0\,dx\).
Replace the remaining integral by its paired expression, keeping its sign.
Compute \(F(U)-F(L)\), including every boundary term.
If desired, the two antiderivatives can be written directly without \(S_0\) and \(C_0\):
These expanded forms follow by substituting \(S_0\) and \(C_0\) into the theorem. They are convenient for endpoint evaluation, but the paired form often makes the integration-by-parts logic easier to see.
Worked Examples
Worked Example: A Sine Integral with Matching Parameters
Evaluate \(\int_0^\pi x e^x\sin x\,dx\). Here \(a=1\), \(b=1\), and \(D=1^2+1^2=2\). Therefore
The sine antiderivative is
At the upper endpoint, \(\sin\pi=0\) and \(\cos\pi=-1\), so \(F_s(\pi)=\frac{e^\pi}{2}(\pi-1)\). At the lower endpoint, \(F_s(0)=\frac12\). Hence
Check: writing \(g(x)=x(\sin x-\cos x)+\cos x\), product-rule differentiation gives \(g'(x)=-\cos x+x(\cos x+\sin x)\). Therefore \(g(x)+g'(x)=2x\sin x\), and \(F_s'(x)=\frac{e^x}{2}(g+g')=xe^x\sin x\), as required. The endpoint substitution above then verifies the definite value.
Worked Example: A Cosine Integral over a Full Oscillation
Evaluate \(\int_0^\pi x e^x\cos(2x)\,dx\). Here \(a=1\), \(b=2\), and \(D=5\). We have
Using \(F_c=xC_0-(C_0+2S_0)/5\), first combine the cyclic term: \[ C_0+2S_0=\frac{e^x(-3\cos 2x+4\sin 2x)}{5}. \] Thus
At \(x=\pi\), \(\cos(2\pi)=1\) and \(\sin(2\pi)=0\), giving \(F_c(\pi)=\frac{e^\pi}{5}(\pi+3/5)\). At \(x=0\), the term multiplied by \(x\) is zero, while the remaining term gives \(F_c(0)=3/25\). Therefore
Check: set \(h=x(\cos 2x+2\sin 2x)+(3\cos 2x-4\sin 2x)/5\). Differentiating gives \(h'= \cos 2x+2\sin 2x+x(-2\sin 2x+4\cos 2x)+(-6\sin 2x-8\cos 2x)/5\). Adding \(h\) cancels the non-\(x\) terms and leaves \(5x\cos 2x\). Hence \(F_c'=e^x(h+h')/5=xe^x\cos 2x\).
Worked Example: A Decaying Exponential-Sine Integral
Evaluate \(\int_0^{\pi/2} x e^{-x}\sin(2x)\,dx\). Now \(a=-1\), \(b=2\), and \(D=5\). The paired antiderivatives are
The cyclic term is \((aS_0-bC_0)/D=(-S_0-2C_0)/5\), so \(F_s=xS_0+(S_0+2C_0)/5\). Combining these terms gives
At \(x=\pi/2\), the angle is \(\pi\), so the sine is zero and the cosine is \(-1\). Thus \(F_s(\pi/2)=\frac{e^{-\pi/2}}{5}(\pi+4/5)=\frac{e^{-\pi/2}(5\pi+4)}{25}\). At \(x=0\), \(F_s(0)=-4/25\). It follows that
Check: differentiating the displayed \(F_s\) by the product rule, or using the theorem with \(a=-1\), \(b=2\), gives \(F_s'(x)=xe^{-x}\sin(2x)\). Substituting the two endpoints gives the stated difference, including the nonzero lower-end value.
Conditions, Endpoint Choices, and a Sign Pitfall
The formulas with \(D\) in the denominator require \(a^2+b^2>0\). If \(a=b=0\), the integrands reduce directly to \(x\sin 0=0\) and \(x\cos 0=x\). Therefore
This handles the only degenerate parameter pair. There is no need for \(a\) or \(b\) individually to be nonzero: for example, the formulas apply when \(a=0,b\ne0\), or \(b=0,a\ne0\). The interval endpoints can be any finite real numbers; if the order is reversed, the usual signed-integral rule gives \(\int_U^L=-\int_L^U\).
A frequent error is to lose a minus sign in the cyclic sine step. For \(a=b=1\), the correct identity is \(\int S_0\,dx=(S_0-C_0)/2\). If one incorrectly uses \((S_0+C_0)/2\), its derivative is \((e^x\sin x+e^x\cos x)/2\), which is not \(S_0=e^x(\sin x-\cos x)/2\). The incorrect expression therefore cannot be used as an antiderivative of \(S_0\). Keeping the paired identities visible until after integration by parts helps prevent this sign error.
Another endpoint mistake is to keep only the term containing \(x\) in \(F_s\) or \(F_c\). The remaining cyclic term is part of the antiderivative and can be nonzero even when \(x=0\), as the examples show. The safe procedure is to evaluate the complete \(F(U)\), evaluate the complete \(F(L)\), and subtract.
Why This Method Is Useful
The polynomial factor is reduced by one degree through integration by parts, while the exponential-trigonometric pair returns to the same two-function system. For a linear factor, the reduction ends after one integration-by-parts step. The cyclic antiderivatives make that final remainder explicit, so there is no unresolved integral left.
The same structure also explains why endpoint simplification can be substantial. When \(bU\) or \(bL\) is a familiar angle, sine and cosine may take simple exact values. That simplifies evaluation, but it does not remove the need to include all terms in the endpoint antiderivative. For general finite endpoints, the formula remains valid without any period assumption.
Check Your Understanding
Use the paired antiderivatives and endpoint formulas to answer these questions.
- What condition on \(a\) and \(b\) is needed for the formulas involving \(D=a^2+b^2\)?
- In the sine case, which cyclic expression is an antiderivative of \(S_0\)?
- Why does differentiating \(xS_0-(aS_0-bC_0)/D\) leave \(x e^{ax}\sin(bx)\)?
- Evaluate \(\int_0^1 x\cos x\,dx\) using the cosine formula.
- What are the sine-weighted and cosine-weighted integrals when \(a=b=0\)?