Tutorials › Calculus II › The Indefinite Integration By Parts Formula

Integration by Parts I · Tutorial 27 of 998

The Indefinite Integration By Parts Formula

Use the product rule in reverse to integrate products, keep track of constants, and check your result by differentiating.

Beginner 12 min read

What You'll Learn

  • State the indefinite integration by parts formula and its conditions
  • Translate between \(u\), \(dv\), \(du\), and \(v\) and ordinary function notation
  • Apply the formula once and more than once in an integral
  • Handle an integral that reappears after repeated integration by parts
  • Track the constant of integration in an indefinite formula
  • Verify an antiderivative by differentiating it

Why Integration by Parts Works

Some integrals involve a product of functions, and the usual reverse-chain-rule pattern may not directly produce an antiderivative. Integration by parts provides another route: it rewrites an integral of a product as a related integral in which one factor has been differentiated and the other integrated.

The formula is the product rule read in reverse. Its usefulness depends on choosing a split that makes the new integral manageable, but the formula itself is simple. In this tutorial, we will state it precisely, apply it to several products, and verify the answers by differentiation.

The Indefinite Formula and Its Notation

Suppose \(u\) is a differentiable function of \(x\), and suppose \(g\) has an antiderivative \(v\) on the interval under consideration. Write \(dv=g(x)\,dx\), so that \(v'=g\), and write \(du=u'(x)\,dx\). The indefinite integration by parts formula is

$$ \int u\,dv=uv-\int v\,du. $$

In ordinary function notation, the same formula is

$$ \int u(x)g(x)\,dx = u(x)v(x)-\int v(x)u'(x)\,dx, \qquad v'(x)=g(x). $$
Definition: In an integration by parts calculation, \(u\) is the factor to differentiate, \(du=u'(x)\,dx\) is its differential, \(dv\) is the factor to integrate, and \(v\) is an antiderivative of the function in \(dv\). The formula replaces \(\int u\,dv\) with \(uv-\int v\,du\).

The notation \(dv\) does not mean that a new variable has been introduced. It records the part of the integrand that will be integrated to obtain \(v\). Likewise, \(du\) records the derivative of \(u\), including the factor \(dx\). For example, if \(u=x\) and \(dv=\cos(2x)\,dx\), then \(du=dx\) and \(v=\tfrac12\sin(2x)\).

Because this is an indefinite integral, an antiderivative is determined only up to an additive constant. The formula is therefore understood as an equality between families of antiderivatives, with the constant of integration included in the final answer.

Why the Formula Is True

The product rule says that the derivative of a product \(uv\) is \(u'v+uv'\). Rearranging and integrating gives the integration by parts formula. The following verification also shows directly that the right-hand side has the required derivative.

1
Differentiate the product.
For differentiable \(u\) and \(v\), the product rule gives \((uv)'=u'v+uv'\).
2
Rearrange the equality.
Subtract \(u'v\) from both sides to obtain \(uv'= (uv)'-vu'\).
3
Integrate both sides.
Since \(v'=g\), integrating \(u v' = (uv)'-v u'\) with respect to \(x\) yields \(\int u g(x)\,dx=uv-\int v u'(x)\,dx\), up to an additive constant.

In differential notation, \(v'\,dx=dv\) and \(u'\,dx=du\), so the same identity is \(\int u\,dv=uv-\int v\,du\). The conditions matter: the factors must have the derivatives and antiderivative needed for these expressions on the interval where the formula is applied.

Applying the Formula Once

Here is a direct application. The calculation identifies each part, uses the formula, evaluates the remaining integral, and then checks the resulting antiderivative.

Worked Example: Integrating \(x\cos(2x)\)

Evaluate \(\int x\cos(2x)\,dx\). Set \(u=x\), so \(du=dx\). Set \(dv=\cos(2x)\,dx\). Since an antiderivative of \(\cos(2x)\) is \(\tfrac12\sin(2x)\), we have \(v=\tfrac12\sin(2x)\).

Apply the formula:

$$ \begin{aligned} \int x\cos(2x)\,dx &=x\left(\frac12\sin(2x)\right) -\int \left(\frac12\sin(2x)\right)\,dx\\ &=\frac{x}{2}\sin(2x) -\frac12\left(-\frac12\cos(2x)\right)+C\\ &=\frac{x}{2}\sin(2x)+\frac14\cos(2x)+C. \end{aligned} $$

Check by differentiation:

$$ \begin{aligned} \frac{d}{dx}\left(\frac{x}{2}\sin(2x)+\frac14\cos(2x)\right) &=\frac12\sin(2x)+x\cos(2x)-\frac12\sin(2x)\\ &=x\cos(2x). \end{aligned} $$

The derivative is the original integrand, so the antiderivative is verified.

Applying the Formula More Than Once

Sometimes the first application produces another product integral. If that new integral is tractable by parts, apply the formula again. Keep the minus sign from the first application visible; it affects every term that follows.

Worked Example: Integrating \(x^2\cos x\)

Let \(I=\int x^2\cos x\,dx\). In the first application, choose \(u=x^2\), \(du=2x\,dx\), \(dv=\cos x\,dx\), and \(v=\sin x\). Then

$$ I=x^2\sin x-2\int x\sin x\,dx. $$

Now evaluate \(J=\int x\sin x\,dx\). Choose \(u=x\), \(du=dx\), \(dv=\sin x\,dx\), and \(v=-\cos x\). Thus

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

Substitute this expression for \(J\) into the equation for \(I\):

$$ \begin{aligned} I&=x^2\sin x-2(-x\cos x+\sin x)+C\\ &=x^2\sin x+2x\cos x-2\sin x+C. \end{aligned} $$

Check the result by differentiating:

$$ \begin{aligned} \frac{d}{dx}(x^2\sin x+2x\cos x-2\sin x) &=2x\sin x+x^2\cos x+2\cos x-2x\sin x-2\cos x\\ &=x^2\cos x. \end{aligned} $$

The terms involving \(x\sin x\) and \(\cos x\) cancel, leaving the original integrand.

When the Original Integral Reappears

A repeated application can bring back the integral you started with. In that situation, the equation is not stuck: treat the integral as an unknown quantity and solve the resulting algebraic equation. The next example shows why the equality must be rearranged before the antiderivative is stated.

Worked Example: Integrating \(e^x\sin x\)

Let \(I=\int e^x\sin x\,dx\). First choose \(u=e^x\), \(du=e^x\,dx\), \(dv=\sin x\,dx\), and \(v=-\cos x\). Integration by parts gives

$$ I=-e^x\cos x+\int e^x\cos x\,dx. $$

Call the remaining integral \(J=\int e^x\cos x\,dx\). Apply integration by parts with \(u=e^x\), \(du=e^x\,dx\), \(dv=\cos x\,dx\), and \(v=\sin x\):

$$ J=e^x\sin x-\int e^x\sin x\,dx =e^x\sin x-I. $$

Substitute this expression for \(J\) into the equation for \(I\):

$$ I=-e^x\cos x+e^x\sin x-I. $$

Add \(I\) to both sides and divide by \(2\):

$$ 2I=e^x(\sin x-\cos x), \qquad I=\frac12e^x(\sin x-\cos x)+C. $$

Check by differentiation:

$$ \begin{aligned} \frac{d}{dx}\left(\frac12e^x(\sin x-\cos x)\right) &=\frac12e^x(\sin x-\cos x) +\frac12e^x(\cos x+\sin x)\\ &=e^x\sin x. \end{aligned} $$

The repeated integral was handled as an algebraic unknown, and differentiation confirms the answer.

Constants and the Indefinite Equality

When using integration by parts, it is usually clearest to carry one \(+C\) at the end of the complete calculation. Intermediate integrals can be written as antiderivative expressions without attaching a separate constant each time, as long as the final answer includes an arbitrary constant.

For instance, in the calculation of \(J=\int x\sin x\,dx\), the expression \(-x\cos x+\sin x\) is one antiderivative. Every other antiderivative differs from it by a constant. When \(J\) is substituted into a larger indefinite integral, that constant is absorbed into the final \(C\). If a constant is multiplied during substitution, it remains an arbitrary constant after multiplication and is still absorbed into the final \(C\).

Takeaway: An indefinite integration by parts result should include \(+C\). Constants introduced at intermediate stages do not need to be tracked separately when all the work concerns the same indefinite integral.

A Common Sign Error

The minus sign in \(\int u\,dv=uv-\int v\,du\) is part of the formula. A frequent mistake is to omit it, especially when \(v\) is itself negative. A concrete calculation makes the error easy to detect.

Worked Example: Correcting a Sign Error in \(\int x\sin x\,dx\)

Take \(u=x\), \(du=dx\), \(dv=\sin x\,dx\), and \(v=-\cos x\). A wrong calculation might write

$$ \int x\sin x\,dx \mathrel{\color{red}{=}} uv+\int v\,du =-x\cos x-\int\cos x\,dx =-x\cos x-\sin x+C. $$

This has used a plus sign where the formula requires a minus sign. Differentiating the proposed answer exposes the problem:

$$ \frac{d}{dx}(-x\cos x-\sin x) =-\cos x+x\sin x-\cos x =x\sin x-2\cos x, $$

which is not the original integrand. Apply the formula with its correct sign:

$$ \begin{aligned} \int x\sin x\,dx &=uv-\int v\,du\\ &=-x\cos x-\int(-\cos x)\,dx\\ &=-x\cos x+\sin x+C. \end{aligned} $$

Now differentiate the corrected result:

$$ \frac{d}{dx}(-x\cos x+\sin x) =-\cos x+x\sin x+\cos x =x\sin x. $$

The sign is correct, and the derivative matches the integrand.

Checking an Indefinite Result

Differentiation provides a direct check for any proposed antiderivative. If \(F(x)\) is claimed to be an antiderivative of \(f(x)\) on an interval, then the necessary check is \(F'(x)=f(x)\) throughout that interval. This test catches many errors in the product term, the remaining integral, and the sign.

The check also clarifies the role of \(C\): the derivative of a constant is zero, so every function \(F(x)+C\) has the same derivative. Conversely, on an interval, any two antiderivatives of the same function differ by a constant. Thus the final \(+C\) represents the full family of antiderivatives, not an extra term that changes the derivative.

Integration by parts is useful when the product rule, read backward, replaces the original integral with one that can be evaluated. The formula does not guarantee that the new integral is simpler; each application must still be computed correctly. Writing down \(u\), \(dv\), \(du\), and \(v\) before substituting helps keep the calculation organized, while differentiation provides a reliable final check.

Check Your Understanding

Use the formula and the verification method from this tutorial to answer these questions.

  1. If \(u=x^2\) and \(dv=\sin(3x)\,dx\), what are \(du\) and \(v\)?
  2. State the indefinite integration by parts formula in both differential notation and ordinary function notation.
  3. In \(\int x\sin x\,dx\), identify the sign error in the calculation \(-x\cos x-\sin x+C\) by differentiating it.
  4. When an integration by parts calculation gives \(I=A-I\), what algebraic step isolates \(I\)?
  5. What equation should you check after proposing \(F(x)+C\) as an antiderivative of \(f(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