Why a Coefficient Pattern Appears
When a polynomial is multiplied by an exponential, repeated integration by parts reduces the degree of the polynomial one step at a time. For \(x^n e^{ax}\), the process eventually stops because differentiating \(x^n\) repeatedly leads to zero. The terms that accumulate have a predictable pattern: factorials come from successive powers of \(n\), and powers of \(a\) come from repeatedly integrating the exponential.
Recognizing this pattern lets us write an antiderivative for any nonnegative integer power \(n\), without rebuilding a tabular integration calculation from scratch each time. The parameter \(a\) must be nonzero for the formula below, because its coefficients contain powers of \(1/a\).
The finite sum is the coefficient pattern of interest. Written term by term, it begins
The sum ends with a constant term inside the parentheses, namely \((-1)^n n!/a^{n+1}\). At the \(k\)-th term, the factorial ratio \(n!/(n-k)!\) is the product \(n(n-1)\cdots(n-k+1)\); for \(k=0\), that product is empty and the ratio is \(1\). Thus the numerical factors are not simply \(1, n, n^2,\ldots\): they are successive falling products of integers.
Deriving the Formula from Integration by Parts
Repeated integration by parts gives a recurrence. To avoid ambiguity about constants while deriving it, let \(J_n\) denote a particular antiderivative of \(x^n e^{ax}\). The integration-by-parts identity \(\int u\,dv=uv-\int v\,du\), applied with \(u=x^n\) and \(dv=e^{ax}\,dx\), gives the recurrence below for \(n\ge 1\). Since an antiderivative of \(e^{ax}\) is \(e^{ax}/a\), the starting case is \(J_0=e^{ax}/a\).
Each use of the recurrence contributes one more term. For example, the first substitution produces
Continuing in the same way, each substitution supplies an additional factor \(-1/a\), while the polynomial degree supplies the next descending integer. After \(n\) substitutions the remaining antiderivative is \(J_0\), so the expansion terminates:
For the term indexed by \(k\), the descending product contains \(k\) factors, from \(n\) down to \(n-k+1\). That product is \(n!/(n-k)!\). There have also been \(k+1\) divisions by \(a\), including the first integration of the exponential, and the sign has changed \(k\) times. These observations give exactly the stated coefficient.
Why the Formula Differentiates Correctly
The recurrence explains how the formula is found. We can also verify directly why its adjacent terms cancel when differentiated. Define the polynomial
The proposed antiderivative is \(e^{ax}P_n(x)\). By the product rule, its derivative is \(e^{ax}(aP_n+P_n')\). The term of degree \(n\) in \(aP_n+P_n'\) comes only from \(a c_0x^n\), and \(a c_0=1\), so that term is \(x^n\). For each \(k\) from \(1\) through \(n\), the coefficient of \(x^{n-k}\) has two contributions: \(a c_k\) from \(aP_n\), and \((n-k+1)c_{k-1}\) from differentiating the preceding power in \(P_n\). Their sum is zero:
All powers below \(x^n\) therefore cancel, leaving \(aP_n+P_n'=x^n\). Consequently,
This verifies the formula for every allowed \(n\) and \(a\), not only for a particular example.
Worked Examples
Worked Example: Integrate \(x^3e^{2x}\)
Here \(n=3\) and \(a=2\), so the four terms correspond to \(k=0,1,2,3\). Substituting into the formula gives
To check, set \(P(x)=x^3/2-3x^2/4+3x/4-3/8\). Then
The derivative equals the original integrand, as required.
Worked Example: Integrate \(x^4e^{-x}\)
Now \(n=4\) and \(a=-1\). Because \(a\) is negative, its powers affect the signs. Substitution gives
Let \(P(x)=-x^4-4x^3-12x^2-24x-24\). Differentiating the polynomial gives \(P'(x)=-4x^3-12x^2-24x-24\). Since the derivative of \(e^{-x}\) is \(-e^{-x}\), the product rule gives
This check also shows why a negative \(a\) does not invalidate the formula: its powers are retained in the coefficients, and the cancellations still work.
Worked Example: Integrate \(x^2e^{3x}\)
For \(n=2\) and \(a=3\), there are three terms. The factorial ratio for the last term is \(2!/0!=2\):
Let \(P(x)=x^2/3-2x/9+2/27\). Then \(P'(x)=2x/3-2/9\), and
The check confirms both the \(1/a^{k+1}\) powers and the factorial factor in the constant term.
A Common Coefficient Error
A frequent mistake is to include the alternating signs and powers of \(a\) but omit the descending factors from differentiating \(x^n\). For instance, an incorrect attempt at \(\int x^2e^{2x}\,dx\) might use
Differentiating this proposed answer does not give the integrand. If \(Q(x)=x^2/2-x/4+1/8\), then \(Q'(x)=x-1/4\), and
which contains an unwanted \(x/2\) term. The missing factor is \(n=2\) in the second term and \(2\cdot1\) in the third. The corrected calculation is
Indeed, if \(R(x)=x^2/2-x/2+1/4\), then \(R'(x)=x-1/2\) and \(2R(x)=x^2-x+1/2\). Thus \(R'+2R=x^2\), confirming the corrected answer.
Conditions and Practical Use
The formula is intended for \(n=0,1,2,\ldots\) and \(a\ne0\). The finite endpoint of the sum depends on \(n\) being a nonnegative integer: differentiating the monomial eventually gives zero, so the repeated integration-by-parts process ends. If \(a=0\), the displayed formula cannot be used because it divides by powers of \(a\); in that separate case the integrand is \(x^n\), whose antiderivative is \(x^{n+1}/(n+1)+C\).
For a specific problem, first identify \(n\) and \(a\), then write every term through \(k=n\). Keep the powers of \(a\) visible until substituting its value, especially when \(a\) is negative or has magnitude other than \(1\). Finally, differentiate the proposed antiderivative: the exponential factor contributes \(a\), and the polynomial derivative cancels all but the leading \(x^n\).
Check Your Understanding
Use the coefficient formula, and check proposed antiderivatives by differentiating them.
- State the allowed values of \(n\) and \(a\) for the formula.
- Write the coefficient of \(x^{n-2}e^{ax}\) in terms of \(n\) and \(a\), when \(n\ge2\).
- Use the formula to find an antiderivative of \(xe^{4x}\).
- Why does the sum stop after the term indexed by \(k=n\)?
- What error results from omitting the descending factorial factors, and how can differentiation reveal it?