Tutorials › Calculus II › Boundary Terms and Stopping Rules in Repeated Integration

Repeated and Tabular Parts · Tutorial 73 of 998

Boundary Terms and Stopping Rules in Repeated Integration

Use the polynomial derivative chain to stop repeated integration by parts correctly and keep the final product or boundary term.

Intermediate 10 min read

What You'll Learn

  • Determine the last nonzero derivative of a polynomial and use it as the stopping point.
  • Match each derivative row with the next antiderivative in a tabular integration table.
  • Derive the repeated integration-by-parts formula and its zero-remainder case.
  • Distinguish an indefinite integral’s remainder from endpoint evaluations in a definite integral.
  • Check table signs and final terms by differentiating or evaluating at the bounds.

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.

Central rule: If the polynomial has degree \(n\), retain the product involving its \(n\)th derivative. The next derivative is zero, so the remaining integral vanishes.

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.

Definition: In repeated integration by parts with polynomial factor \(p\), the final table product is \((-1)^n p^{(n)}V_{n+1}\). It is included because \(p^{(n)}\) is the last nonzero derivative. The zero derivative \(p^{(n+1)}\) signals that the process stops; it does not erase the preceding product.

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.

1
Apply integration by parts once.
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\).
2
Expand the remaining integral.
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\).
3
Continue with alternating signs.
Repeating the same operation gives successive products \(pV_1,-p'V_2,+p''V_3,\ldots\), with the sign changing at each step.
4
Stop at the zero derivative.
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

$$ \int p(x)g(x)\,dx = \sum_{k=0}^{n}(-1)^k p^{(k)}(x)V_{k+1}(x)+C. $$

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.

$$ \int x^2e^x\,dx =x^2e^x-2xe^x+2e^x+C =e^x(x^2-2x+2)+C. $$

Check by differentiating the proposed antiderivative:

$$ \frac{d}{dx}\left[e^x(x^2-2x+2)\right] =e^x(x^2-2x+2)+e^x(2x-2) =e^x x^2. $$

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

$$ \int_a^b p(x)g(x)\,dx = \sum_{k=0}^{n}(-1)^k \left[p^{(k)}(x)V_{k+1}(x)\right]_a^b. $$

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

$$ \int_0^1 x^2e^x\,dx = [x^2e^x]_0^1-[2xe^x]_0^1+[2e^x]_0^1. $$

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\).

$$ \int_0^1 x^2e^x\,dx =e-2e+(2e-2)=e-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:

$$ \int x\cos x\,dx =x\sin x-1(-\cos x)+C =x\sin x+\cos x+C. $$

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

$$ \int_0^\pi x\cos x\,dx=(-1)-1=-2. $$

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

$$ \int x^2e^x\,dx=x^2e^x-\int 2xe^x\,dx. $$

The inner integral is \(2xe^x-2e^x\). The minus sign in front of the entire inner integral must be distributed to both terms:

$$ -\left(2xe^x-2e^x\right)=-2xe^x+2e^x. $$

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.

1
Differentiate until zero.
For a degree-\(n\) polynomial, list \(p,p',\ldots,p^{(n)}\), and confirm \(p^{(n+1)}=0\).
2
Integrate the other factor as many times as needed.
To pair with \(p^{(n)}\), obtain \(V_{n+1}\).
3
Include every diagonal product.
Use signs \(+,-,+,-,\ldots\), through \((-1)^n p^{(n)}V_{n+1}\).
4
Interpret the result for the integral type.
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.

  1. If \(p\) has degree \(4\), which derivative is the last nonzero one, and which derivative makes the remaining integral vanish?
  2. For a degree-\(n\) polynomial, what is the index and sign of the final table product?
  3. In \(\int p(x)g(x)\,dx\), what does the zero remainder mean, and what still has to be included in the antiderivative?
  4. For a definite integral, explain what \([p'(x)V_2(x)]_a^b\) means.
  5. 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\)?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon