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
In ordinary function notation, the same formula is
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.
For differentiable \(u\) and \(v\), the product rule gives \((uv)'=u'v+uv'\).
Subtract \(u'v\) from both sides to obtain \(uv'= (uv)'-vu'\).
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:
Check by differentiation:
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
Now evaluate \(J=\int x\sin x\,dx\). Choose \(u=x\), \(du=dx\), \(dv=\sin x\,dx\), and \(v=-\cos x\). Thus
Substitute this expression for \(J\) into the equation for \(I\):
Check the result by differentiating:
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
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\):
Substitute this expression for \(J\) into the equation for \(I\):
Add \(I\) to both sides and divide by \(2\):
Check by differentiation:
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\).
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
This has used a plus sign where the formula requires a minus sign. Differentiating the proposed answer exposes the problem:
which is not the original integrand. Apply the formula with its correct sign:
Now differentiate the corrected result:
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.
- If \(u=x^2\) and \(dv=\sin(3x)\,dx\), what are \(du\) and \(v\)?
- State the indefinite integration by parts formula in both differential notation and ordinary function notation.
- In \(\int x\sin x\,dx\), identify the sign error in the calculation \(-x\cos x-\sin x+C\) by differentiating it.
- When an integration by parts calculation gives \(I=A-I\), what algebraic step isolates \(I\)?
- What equation should you check after proposing \(F(x)+C\) as an antiderivative of \(f(x)\)?