Why the Stopping Point Matters
Repeated integration by parts is especially efficient when one factor is a polynomial. Differentiating a polynomial eventually produces zero, so the process has a natural stopping point. But stopping at the right moment matters: the last nonzero polynomial derivative still contributes a product to the answer.
For a definite integral, there is a related distinction. Once the repeated integration-by-parts formula has been expanded, each product contributes an endpoint difference. Those boundary terms are not the same as an unevaluated remainder integral. Keeping the two roles separate prevents both omitted terms and sign errors.
The Polynomial Derivative Chain
Let \(p\) be a polynomial of degree \(n\). Its successive derivatives are \(p,p',p'',\ldots,p^{(n)}\), where \(p^{(k)}\) denotes the \(k\)th derivative. The final derivative \(p^{(n)}\) is a nonzero constant, and \(p^{(n+1)}=0\).
Suppose the other factor in the integrand is \(g(x)\), and suppose it has the antiderivatives needed below on the interval under consideration. Write \(V_1\) for an antiderivative of \(g\), \(V_2\) for an antiderivative of \(V_1\), and, in general, \(V_{k+1}\) for an antiderivative of \(V_k\). Thus \(V_1'=g\), \(V_2'=V_1\), and so on.
The table pairs the \(k\)th polynomial derivative with the \((k+1)\)st entry in the integration column. Alternating signs are attached to these products, beginning with a plus sign.
Why the Repeated Formula Works
The formula follows by applying integration by parts repeatedly. At every step, the derivative moves from the polynomial to the next antiderivative, and the sign of the remaining integral changes. The sign change applies to the whole remaining expression, including the next product.
Using \(u=p\) and \(dv=g(x)\,dx\), so that \(du=p'(x)\,dx\) and \(v=V_1\), gives \(\int p g\,dx=pV_1-\int p'V_1\,dx\).
Since \(V_2'=V_1\), integration by parts gives \(\int p'V_1\,dx=p'V_2-\int p''V_2\,dx\). The minus sign already outside this integral applies to both terms, so the next product in the original expression is \(-p'V_2\).
Repeating the same operation gives successive products \(pV_1,-p'V_2,+p''V_3,\ldots\), with the sign changing at each step.
After the product involving \(p^{(n)}V_{n+1}\), the remaining integral contains \(p^{(n+1)}=0\), and is therefore zero.
For a polynomial \(p\) of degree \(n\), the complete repeated formula is therefore
Here \(C\) is an arbitrary constant. The formula follows provided the indicated antiderivatives exist on the interval being considered. Equivalently, before using \(p^{(n+1)}=0\), the repeated calculation has a final remainder \((-1)^{n+1}\int p^{(n+1)}V_{n+1}\,dx\), which is zero for a degree-\(n\) polynomial.
Worked Example: The Last Product for a Quadratic
Worked Example: The Last Product for a Quadratic
Evaluate \(\int x^2e^x\,dx\) using repeated integration by parts. Here \(p(x)=x^2\), and successive antiderivatives of \(e^x\) are all \(e^x\).
The polynomial derivatives are \(p=x^2\), \(p'=2x\), \(p''=2\), and \(p'''=0\). The corresponding antiderivatives are \(V_1=e^x\), \(V_2=e^x\), and \(V_3=e^x\). The last nonzero derivative is \(p''=2\), so its product with \(V_3\) must be included.
Check by differentiating the proposed antiderivative:
The derivative is the original integrand, as required.
Indefinite Integrals and Definite Boundary Terms
For an indefinite integral, the repeated formula gives a sum of functions, followed by an arbitrary constant. Since the polynomial derivative chain terminates, the remainder integral is zero. There are no endpoints to substitute.
For a definite integral on \([a,b]\), the same integration-by-parts steps produce endpoint differences. If \(F\) is any function, \([F(x)]_a^b\) means \(F(b)-F(a)\). Thus the polynomial formula becomes
This version assumes the functions involved are defined and sufficiently differentiable on the interval so that the integrations by parts and endpoint evaluations are valid. Each displayed product is evaluated at both bounds; the boundary contribution is its value at \(b\) minus its value at \(a\). A vanished remainder integral does not mean the boundary products vanish.
Worked Example: A Definite Integral with Several Boundary Contributions
Worked Example: A Definite Integral with Several Boundary Contributions
Evaluate \(\int_0^1 x^2e^x\,dx\). The derivative and antiderivative chains are the same as in the preceding calculation, so the definite formula gives
Evaluate the first boundary difference: \(x^2e^x\) equals \(e\) at \(x=1\) and \(0\) at \(x=0\), giving \(e-0=e\). For the second, \(2xe^x\) equals \(2e\) at \(1\) and \(0\) at \(0\); with its preceding minus sign, the contribution is \(-(2e-0)=-2e\). For the third, \(2e^x\) equals \(2e\) at \(1\) and \(2\) at \(0\), giving \(2e-2\).
As a check, the antiderivative from the preceding example is \(F(x)=e^x(x^2-2x+2)\). Its endpoint difference is \(F(1)-F(0)=e(1)-2=e-2\), agreeing with the boundary-term calculation.
Worked Example: A Trigonometric Integration Column
Worked Example: A Trigonometric Integration Column
Evaluate \(\int x\cos x\,dx\), then use the result to find \(\int_0^\pi x\cos x\,dx\). The polynomial is \(p=x\), so \(p'=1\) is its last nonzero derivative and \(p''=0\). The integration column begins with \(V_1=\sin x\), an antiderivative of \(\cos x\), and then \(V_2=-\cos x\), an antiderivative of \(\sin x\).
Include the product from the last nonzero derivative:
Differentiate to check: \(\frac{d}{dx}(x\sin x+\cos x)=\sin x+x\cos x-\sin x=x\cos x\).
Now evaluate at the endpoints. At \(x=\pi\), the antiderivative without \(C\) is \(\pi\sin\pi+\cos\pi=0-1=-1\). At \(x=0\), it is \(0\sin 0+\cos 0=0+1=1\). Hence
The boundary values, not the zero remainder alone, determine this definite integral.
A Common Stopping and Sign Error
A frequent mistake is either to stop before including the last nonzero derivative’s product or to mishandle the minus sign on the remaining integral. For \(x^2e^x\), the first integration-by-parts step is
The inner integral is \(2xe^x-2e^x\). The minus sign in front of the entire inner integral must be distributed to both terms:
A wrong calculation might write \(-\int 2xe^x\,dx=+2xe^x-2e^x\). This reverses the sign of the whole evaluated expression. It also fails the derivative check: differentiating \(x^2e^x+2xe^x-2e^x\) gives \(e^x(x^2+4x)\), not \(x^2e^x\). The corrected antiderivative \(x^2e^x-2xe^x+2e^x\) differentiates to \(x^2e^x\).
A separate stopping error is to write \(x^2e^x-2xe^x\) and omit \(+2e^x\). The derivative of this incomplete expression is \(x^2e^x-2e^x\), so it is not an antiderivative. The omitted term is precisely the product from \(p''=2\), the final nonzero derivative.
A Reliable Stopping Check
Before reading off a table or writing a repeated formula, identify the polynomial’s degree and list its derivatives through the first zero. Then pair each nonzero derivative with the next antiderivative in the other column. The final product uses the last nonzero derivative; the zero row marks the point after which there are no further products.
For a degree-\(n\) polynomial, list \(p,p',\ldots,p^{(n)}\), and confirm \(p^{(n+1)}=0\).
To pair with \(p^{(n)}\), obtain \(V_{n+1}\).
Use signs \(+,-,+,-,\ldots\), through \((-1)^n p^{(n)}V_{n+1}\).
For an indefinite integral, add \(C\). For a definite integral, evaluate each product as a separate upper-minus-lower boundary difference.
This check is useful because it addresses two different questions: whether the table has stopped at the right row, and whether the resulting expression is being interpreted correctly. For an indefinite answer, differentiate it. For a definite answer, evaluate all displayed boundary terms, or evaluate a checked antiderivative at the two bounds. Both checks should agree with the setup.
Check Your Understanding
Use the derivative chain and endpoint interpretation to answer these questions.
- If \(p\) has degree \(4\), which derivative is the last nonzero one, and which derivative makes the remaining integral vanish?
- For a degree-\(n\) polynomial, what is the index and sign of the final table product?
- In \(\int p(x)g(x)\,dx\), what does the zero remainder mean, and what still has to be included in the antiderivative?
- For a definite integral, explain what \([p'(x)V_2(x)]_a^b\) means.
- In the calculation \(\int x^2e^x\,dx=x^2e^x-\int 2xe^x\,dx\), why must the next product be \(-2xe^x\), rather than \(+2xe^x\)?