Why Keep Track of Both Contributions?
The integral of \(x e^{kx}\) over a finite interval combines a changing linear factor with an exponential factor. Its evaluation is short, but it contains two distinct contributions: one from the interval’s endpoints and one from integrating the remaining exponential. Keeping these contributions separate makes the calculation easier to check and helps prevent a common sign error.
Throughout, \(a\) and \(b\) are finite real numbers with \(a\le b\), and \(k\) is a nonzero real constant. The focus is the definite integral
The assumption \(k\ne 0\) matters because the antiderivative of \(e^{kx}\) includes division by \(k\). If \(a=b\), the definite integral is zero, as the formula below also shows. For a reversed interval, the usual convention \(\int_a^b f(x)\,dx=-\int_b^a f(x)\,dx\) applies.
Formula and Its Two Parts
Use integration by parts with \(u=x\) and \(dv=e^{kx}\,dx\). Then \(du=dx\), while \(v=e^{kx}/k\). The definite integration-by-parts formula gives
The bracketed expression is the endpoint contribution. The integral that remains is elementary, but it must still be evaluated and subtracted. Since \(k\) is constant and nonzero,
Thus the two contributions, kept separate, are
Combining them gives a compact version of the same result:
The compact form follows by putting the endpoint contribution over the denominator \(k^2\), then collecting the terms at \(b\) and at \(a\). The two forms are equivalent; the separated form is often safer during a calculation because it displays where the subtraction comes from.
Why the Formula Works
The calculation is an application of the product rule, expressed over a definite interval. This also provides a direct justification of the formula. Define
Differentiate each term. By the product rule,
The two terms involving \(e^{kx}/k\) cancel, so
Therefore \(F\) is an antiderivative of the integrand. The Fundamental Theorem of Calculus says that the definite integral is \(F(b)-F(a)\). Substituting the endpoints gives exactly the stated formula. The cancellation in the derivative explains why the endpoint expression and the subtracted exponential integral must appear together.
Worked Examples
Worked Example: A Positive Exponent on an Interval Starting at Zero
Evaluate \(\int_0^1 x e^x\,dx\). Here \(k=1\), \(a=0\), and \(b=1\). First calculate the endpoint contribution:
Next calculate the remaining integral, including the minus sign from integration by parts:
Add the two parts:
Check by differentiating the antiderivative \(F(x)=(x-1)e^x\):
Its endpoint difference is \(F(1)-F(0)=0-(-1)=1\), agreeing with the integration-by-parts calculation.
Worked Example: A Negative Exponent
Evaluate \(\int_0^1 x e^{-x}\,dx\). Now \(k=-1\), so the factors \(1/k\) and \(1/k^2\) have different signs and values. The endpoint contribution is
The remaining integral, with the required subtraction, is
Combining the contributions gives
Check with \(F(x)=-(x+1)e^{-x}\). Differentiation gives
Also, \(F(1)-F(0)=-2/e-(-1)=1-2/e\), as required. The integrand is nonnegative on \([0,1]\), and the result is positive because \(e>2\); this is a useful sign check.
Worked Example: Both Endpoints Contribute
Evaluate \(\int_1^2 x e^x\,dx\). With \(k=1\), the endpoint contribution contains a nonzero term at each end:
The remaining integral, including its minus sign, is
Adding the parts,
For a check, an antiderivative is \(F(x)=(x-1)e^x\), since
Its endpoint difference is \(F(2)-F(1)=e^2-0=e^2\). In particular, the lower endpoint term cannot be dropped even though it cancels with part of the remaining integral in the final simplification.
A Reliable Calculation Sequence
When evaluating a particular integral, it is useful to keep the parameter values and the two contributions visible until the final line. This makes the boundary evaluation and the subtraction independently checkable.
Identify finite endpoints \(a\) and \(b\), and verify that \(k\ne0\).
Compute \(b e^{kb}/k-a e^{ka}/k\), retaining both endpoint values.
Compute \((e^{kb}-e^{ka})/k^2\), then subtract the entire quantity.
Simplify the exact result and verify it with an antiderivative or another appropriate sign check.
Common Mistake: Omitting the Remaining Integral
A frequent error is to perform the endpoint evaluation from the first term of integration by parts and treat it as the complete answer. For example, on \([0,1]\) with \(k=1\), this incorrect calculation stops at
That is only the endpoint contribution. It is not the value of the original integral. The correction is to include the remaining integral with its minus sign:
A related sign error is to subtract only the first endpoint value of the remaining integral, rather than the complete difference \(e^{kb}-e^{ka}\). The bracket notation means “value at \(b\) minus value at \(a\),” and the minus sign from integration by parts applies to that whole difference.
Interpreting the Result
For \(k>0\) and \(0\le a<b\), the integrand \(x e^{kx}\) is nonnegative, so the integral must be nonnegative. This does not mean the endpoint contribution alone must equal the integral; the remaining term may substantially change it. For \(k<0\), the exponential decreases as \(x\) increases, but the integrand on a nonnegative interval is still nonnegative. These simple observations can detect a sign mistake without replacing the calculation.
The formula is also consistent with an interval of zero length. Setting \(b=a\), both endpoint differences vanish, so the result is zero. The condition \(k\ne0\) should not be discarded casually: the displayed formula contains division by \(k\). When \(k=0\), the integrand is simply \(x\), and that case is evaluated directly as \(\int_a^b x\,dx=(b^2-a^2)/2\).
The main practical lesson is to preserve the structure of integration by parts: first record the boundary term, then evaluate the integral that remains, and only then combine them. The compact formula is efficient for substitution, while the separated form shows why each part is present.
Check Your Understanding
For each question, keep the endpoint term and the remaining integral distinct before simplifying.
- State the conditions on \(a\), \(b\), and \(k\) for the displayed exponential-moment formula to apply.
- For \(\int_0^1 x e^{2x}\,dx\), write down the endpoint contribution and the subtracted remaining integral before combining them.
- Why does integration by parts produce a minus sign in front of the remaining integral?
- Evaluate \(\int_1^2 x e^{-x}\,dx\) using the separated form of the formula.
- What direct calculation applies when \(k=0\), and why should the nonzero-\(k\) formula not be used in that case?