Why These Integrals Come in Pairs
When a power of \(x\) multiplies a sine or cosine function, integration by parts reduces the power of \(x\). But the first integration by parts does not generally leave an integral of the same trigonometric type: a sine integral produces a cosine integral, and a cosine integral produces a sine integral. The two families therefore need to be handled together.
For example, integrating \(x^n\sin(bx)\) by parts leaves an integral involving \(x^{n-1}\cos(bx)\). Integrating \(x^n\cos(bx)\) by parts leaves one involving \(x^{n-1}\sin(bx)\). These linked formulas are called coupled recurrences: each family is expressed using the other family at a lower polynomial power.
The assumption \(b\ne 0\) matters because the antiderivatives of \(\sin(bx)\) and \(\cos(bx)\) used in integration by parts contain \(1/b\). If \(b=0\), the integrands are instead \(0\) and \(x^n\), respectively, and can be integrated directly without these recurrences.
The Paired Recurrences
For each positive integer \(n\), integration by parts gives the following pair:
Here \(S_n\) and \(C_n\) denote antiderivatives, and a constant may be added to either right-hand side. The formulas say that computing \(S_n\) requires \(C_{n-1}\), while computing \(C_n\) requires \(S_{n-1}\). Both recurrences lower the polynomial power by one.
The base cases, obtained by integrating the trigonometric functions directly, are
The symbol \(C\) in these base cases represents an arbitrary constant; it is not the indexed integral \(C_n\). In calculations, constants from successive indefinite integrations can be combined into one final constant.
Deriving the Recurrences
For the sine integral, choose \(u=x^n\) and \(dv=\sin(bx)\,dx\). Then \(du=nx^{n-1}\,dx\) and \(v=-\cos(bx)/b\). Substitution into the integration-by-parts identity \(\int u\,dv=uv-\int v\,du\) gives
For the cosine integral, choose \(u=x^n\) and \(dv=\cos(bx)\,dx\). In this case, \(du=nx^{n-1}\,dx\) and \(v=\sin(bx)/b\). Thus
This also explains why the formulas are coupled: differentiating sine gives cosine, and differentiating cosine gives negative sine. The two integration-by-parts calculations therefore exchange the trigonometric factor, while the derivative of \(x^n\) reduces its power. The reduction stops at power zero, where the base cases are known.
Worked Examples
Worked Example: A First-Order Pair with \(b=3\)
Find antiderivatives of \(x\sin(3x)\) and \(x\cos(3x)\). Begin with the base cases \(S_0=-\cos(3x)/3\) and \(C_0=\sin(3x)/3\).
For the sine integral, use the recurrence with \(n=1\):
For the cosine integral,
Check the first answer by differentiating:
For the second answer,
Both derivatives reproduce the corresponding integrands.
Worked Example: A Second-Order Sine Integral with \(b=2\)
Evaluate \(\int x^2\sin(2x)\,dx\). The recurrence first requires \(C_1\), so find that lower-power cosine integral using \(C_0=\sin(2x)/2\) and \(S_0=-\cos(2x)/2\):
Now apply the sine recurrence with \(n=2\):
Differentiate the result to check it:
The terms introduced by differentiating the lower-order parts cancel, leaving exactly the required integrand.
Worked Example: A Third-Order Sine Integral with \(b=1\)
Evaluate \(\int x^3\sin x\,dx\). The recurrence gives \(S_3=-x^3\cos x+3C_2\). To obtain \(C_2\), first calculate \(S_1\):
Then use the cosine recurrence for \(n=2\):
Substitute this into the formula for \(S_3\):
For the check, differentiate each term and collect like terms:
The \(x^2\cos x\), \(x\sin x\), and \(\cos x\) terms cancel, confirming the antiderivative.
A Common Sign Error
The minus sign in the cosine recurrence is easy to lose. For \(n=1\) and \(b=2\), the correct formula is \(C_1=x\sin(2x)/2-S_0/2\). Since \(S_0=-\cos(2x)/2\), the result is \(C_1=x\sin(2x)/2+\cos(2x)/4\).
A common incorrect calculation changes the recurrence itself to \(C_n=x^n\sin(bx)/b+nS_{n-1}/b\). It would give the wrong candidate \(x\sin(2x)/2-\cos(2x)/4\). Differentiating exposes the problem:
This is not \(x\cos(2x)\). The correction is to retain the minus sign before \(nS_{n-1}/b\) in the recurrence. Substituting the negative base case \(S_0=-\cos(2x)/2\) then produces a positive cosine term in the antiderivative. Checking by differentiation is a reliable way to catch this particular error.
Using the Pair Effectively
For a positive integer power, the practical procedure is to choose the recurrence matching the trigonometric factor in the original integral, then compute the required lower-power integral from the other family. Continue until reaching \(S_0\) or \(C_0\). At every stage, keep track of both the factor \(n/b\) and the sign in the appropriate recurrence.
Use the formula for \(S_n\) if the integrand contains sine, and the formula for \(C_n\) if it contains cosine.
The recurrence requires the other family with power \(n-1\); evaluate that lower-power integral before substituting.
Use \(S_0=-\cos(bx)/b\) or \(C_0=\sin(bx)/b\), combine constants, and differentiate the final expression.
The recurrences are useful because they turn a family of integrals into a systematic sequence of lower powers rather than requiring a new strategy for every exponent. They also make the relationship between sine and cosine integrals explicit. The recurrence formulas themselves are the main result here; repeatedly substituting one into the other to obtain a formula involving only one family is a further algebraic step.
Check Your Understanding
Answer these questions using the formulas and reasoning in this tutorial.
- State the restrictions on \(n\) and \(b\) for the paired recurrences, and explain why the condition on \(b\) is needed.
- Write the recurrence for \(S_n\) and identify which lower-power integral it requires.
- Write the recurrence for \(C_n\). What is the sign before the \(S_{n-1}\) term?
- Use the base cases to find \(S_1\) when \(b=1\), including an arbitrary constant.
- Explain why differentiating a proposed antiderivative is an effective check for a sign error.