# 5.4: Integration by Parts

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

Skills to Develop

In this section, we strive to understand the ideas generated by the following important questions:

- How do we evaluate indefinite integrals that involve products of basic functions such as R x sin(x) dx and R xex dx?
- What is the method of integration by parts and how can we consistently apply it to integrate products of basic functions?
- How does the algebraic structure of functions guide us in identifying u and dv in using integration by parts?

In Section 5.3, we learned the technique of u-substitution for evaluating indefinite integrals that involve certain composite functions. For example, the indefinite integral

\[\int^x_3 \sin(x^4 )\, dx\]

is perfectly suited to u-substitution, since not only is there a composite function present, but also the inner function’s derivative (up to a constant) is multiplying the composite function. Through u-substitution, we learned a general situation where recognizing the algebraic structure of a function can enable us to find its antiderivative. It is natural to ask similar questions to those we considered in Section 5.3 about functions with a different elementary algebraic structure: those that are the product of basic functions. For instance, suppose we are interested in evaluating the indefinite integral

\[\int x \sin(x) \,dx.\]

Here, there is not a composite function present, but rather a product of the basic functions

\[f (x) = x\]

and

\[g(x) = \sin(x).\]

From our work in Section 2.3 with the Product Rule, we know that it is relatively complicated to compute the derivative of the product of two functions, so we should expect that antidifferentiating a product should be similarly involved. In addition, intuitively we expect that evaluating

\[\int x \sin(x) \,dx\]

will involve somehow reversing the Product Rule. To that end, in Preview Activity \(\PageIndex{1}\) we refresh our understanding of the Product Rule and then investigate some indefinite integrals that involve products of basic functions.

Preview Activity \(\PageIndex{1}\)

In Section 2.3, we developed the Product Rule and studied how it is employed to differentiate a product of two functions. In particular, recall that if f and g are differentiable functions of x, then

\[\dfrac{d}{dx} [ f (x) · g(x)] = f (x) · g ' (x) + g(x) · f ' (x).\]

- For each of the following functions, use the Product Rule to find the function’s derivative. Be sure to label each derivative by name (e.g., the derivative of g(x) should be labeled g ' (x)).
- g(x) = x sin(x)
- h(x) = xex
- p(x) = x ln(x)
- q(x) = x 2 cos(x)
- r(x) = e x sin(x)

- Use your work in (a) to help you evaluate the following indefinite integrals. Use differentiation to check your work.
- Z xex + e x dx
- Z e x (sin(x) + cos(x)) dx
- Z 2x cos(x) − x 2 sin(x) dx
- Z x cos(x) + sin(x) dx v. Z 1 + ln(x) dx

- Observe that the examples in (b) work nicely because of the derivatives you were asked to calculate in (a). Each integrand in (b) is precisely the result of differentiating one of the products of basic functions found in (a). To see what happens when an integrand is still a product but not necessarily the result of differentiating an elementary product, we consider how to evaluate Z x cos(x) dx.
- First, observe that d dx [x sin(x)] = x cos(x) + sin(x). Integrating both sides indefinitely and using the fact that the integral of a sum is the sum of the integrals, we find that Z d dx [x sin(x)] ! dx = Z x cos(x) dx + Z sin(x) dx. In this last equation, evaluate the indefinite integral on the left side as well as the rightmost indefinite integral on the right.
- In the most recent equation from (i.), solve the equation for the expression \([\int x \cos(x) \,dx.\]
- For which product of basic functions have you now found the antiderivative?

### Reversing the Product Rule: Integration by Parts

Problem (c) in Preview Activity \(\PageIndex{1}\) provides a clue for how we develop the general technique known as Integration by Parts, which comes from reversing the Product Rule. Recall that the Product Rule states that

\[\dfrac{d}{dx} [ f (x)g(x)] = f (x)g ' (x) + g(x) f ' (x).\]

Integrating both sides of this equation indefinitely with respect to x, it follows that

\[\int \dfrac{d}{ dx} [ f (x)g(x)] dx = \int f (x)g ' (x) dx + \int g(x) f ' (x) dx. \label{5.6}\]

On the left in Equation \ref{5.6}, we recognize that we have the indefinite integral of the derivative of a function which, up to an additional constant, is the original function itself. Temporarily omitting the constant that may arise, we equivalently have

\[f (x)g(x) =\int f (x)g (x) dx + \int g(x) f ' (x) dx. \label{5.7} \]

The most important thing to observe about Equation \ref{5.7} is that it provides us with a choice of two integrals to evaluate. That is, in a situation where we can identify two functions f and g, if we can integrate \(f (x)g' (x)\), then we know the indefinite integral of \(g(x) f' (x)\), and vice versa. To that end, we choose the first indefinite integral on the left in Equation \ref{5.7} and solve for it to generate the rule

\[\int f (x)g ' (x) dx = f (x)g(x) − \int g(x) f '(x) dx. \label{5.8} \]

Often we express Equation \ref{5.8} in terms of the variables u and v, where u = f (x) and v = g(x). Note that in differential notation,

\[du = f' (x) dx\]

and

\[dv = g ' (x) dx\]

and thus we can state the rule for Integration by Parts in its most common form as follows.

\[\int u dv = uv − \int v du. \label{IBP}\]

To apply Integration by Parts, we look for a product of basic functions that we can identify as u and dv. If we can antidifferentiate dv to find v, and evaluating R v du is not more difficult than evaluating R u dv, then this substitution usually proves to be fruitful. To demonstrate, we consider the following example.

Example \(\PageIndex{1}\):

Evaluate the indefinite integral \[\int x \cos(x)\, dx\] using Integration by Parts.

**Solution**

Whenever we are trying to integrate a product of basic functions through Integration by Parts, we are presented with a choice for u and dv. In the current problem, we can either let \(u = x\) and \(dv = \cos(x)\, dx\), or let \(u = \cos(x)\) and \(dv = x \,dx\). While there is not a universal rule for how to choose u and dv, a good guideline is this: do so in a way that R v du is at least as simple as the original problem R u dv. In this setting, this leads us to choose 6 u = x and dv = cos(x) dx, from which it follows that du = 1 dx and v = sin(x). With this substitution, the rule for Integration by Parts tells us that

\[\int x \cos(x) dx = x \sin(x) − \int \sin(x) · 1 dx. 6\]

Observe that if we considered the alternate choice, and let u = cos(x) and dv = x dx, then du = − sin(x) dx and v = 1 2 x 2 , from which we would write

\[\int x cos(x) dx = 1 2 x 2 cos(x) − Z 1 2 x 2 (− sin(x)) dx.\]

Thus we have replaced the problem of integrating \(x \cos(x)\) with that of integrating \(\frac{1}{2} x^2 \sin(x)\); the latter is clearly more complicated, which shows that this alternate choice is not as helpful as the first choice.

At this point, all that remains to do is evaluate the (simpler) integral R sin(x) · 1 dx. Doing so, we find

\[\int x \cos(x) dx = x sin(x) − (− \os(x)) + C = x \sin(x) + \cos(x) + C.\]

There are at least two additional important observations to make from Example \(\PageIndex{1}\). First, the general technique of Integration by Parts involves trading the problem of integrating the product of two functions for the problem of integrating the product of two related functions. In particular, we convert the problem of evaluating R u dv for that of evaluating R v du. This perspective clearly shapes our choice of u and v. In Example \(\PageIndex{1}\), the original integral to evaluate was R x cos(x) dx, and through the substitution provided by Integration by Parts, we were instead able to evaluate

\[\int \sin(x) · 1 dx.\]

Note that the original function \(x\) was replaced by its derivative, while \(\cos(x)\) was replaced by its antiderivative. Second, observe that when we get to the final stage of evaluating the last remaining antiderivative, it is at this step that we include the integration constant, +C.

Activity \(\PageIndex{2}\):

Evaluate each of the following indefinite integrals. Check each antiderivative that you find by differentiating.

- \(\int te−t dt\)
- \(\int 4x sin(3x) dx\)
- \(\int z sec2 (z) dz\)
- \(\int x ln(x) dx\)

### Some Subtleties with Integration by Parts

There are situations where Integration by Parts is not an obvious choice, but the technique is appropriate nonetheless. One guide to understanding why is the observation that integration by parts allows us to replace one function in a product with its derivative while replacing the other with its antiderivative. For instance, consider the problem of evaluating Z arctan(x) dx. Initially, this problem seems ill-suited to Integration by Parts, since there does not appear to be a product of functions present. But if we note that

\[arctan(x) = arctan(x) · 1,\]

and realize that we know the derivative of arctan(x) as well as the antiderivative of 1, we see the possibility for the substitution u = arctan(x) and dv = 1 dx. We explore this substitution further in Activity \(\PageIndex{2}\).

In a related problem, if we consider

\[\int t^3 \sin(t^2 ) \,dt,\]

two key observations can be made about the algebraic structure of the integrand: there is a composite function present in sin(t 2 ), and there is not an obvious function-derivative pair, as we have t 3 present (rather than simply t) multiplying sin(t 2 ). This problem exemplifies the situation where we sometimes use both u-substitution and Integration by Parts in a single problem. If we write t 3 = t · t 2 and consider the indefinite integral Z t · t 2 · sin(t 2 ) dt, we can use a mix of the two techniques we have recently learned. First, let z = t 2 so that dz = 2t dt, and thus t dt = 1 2 dz. (We are using the variable z to perform a “zsubstitution” since u will be used subsequently in executing Integration by Parts.) Under this z-substitution, we now have

\[\int t · t^2 · \sin(t^2) dt = \int z · \sin(z) · 1 2 dz.\]

The remaining integral is a standard one that can be evaluated by parts. This, too, is explored further in Activity \(\PageIndex{2}\). The problems briefly introduced here exemplify that we sometimes must think creatively in choosing the variables for substitution in Integration by Parts, as well as that it is entirely possible that we will need to use the technique of substitution for an additional change of variables within the process of integrating by parts.

Activity \(\PageIndex{3}\)

Evaluate each of the following indefinite integrals, using the provided hints.

- Evaluate R arctan(x) dx by using Integration by Parts with the substitution u = arctan(x) and dv = 1 dx.
- Evaluate R ln(z) dz. Consider a similar substitution to the one in (a).
- Use the substitution z = t 2 to transform the integral R t 3 sin(t 2 ) dt to a new integral in the variable z, and evaluate that new integral by parts.
- Evaluate R s 5 e s 3 ds using an approach similar to that described in (c).
- Evaluate R e 2t cos(e t ) dt. You will find it helpful to note that e 2t = e t · e t .

### Using Integration by Parts Multiple Times

We have seen that the technique of Integration by Parts is well suited to integrating the product of basic functions, and that it allows us to essentially trade a given integrand for a new one where one function in the product is replaced by its derivative, while the other is replaced by its antiderivative. The main goal in this trade of R u dv for R v du is to have the new integral not be more challenging to evaluate than the original one. At times, it turns out that it can be necessary to apply Integration by Parts more than once in order to ultimately evaluate a given indefinite integral. For example, if we consider R t 2 e t dt and let u = t 2 and dv = e t dt, then it follows that du = 2t dt and v = e t , thus

\[t 2 e t dt = t 2 e t − \int 2tet dt.\]

The integral on the righthand side is simpler to evaluate than the one on the left, but it still requires Integration by Parts. Now letting u = 2t and dv = e t dt, we have du = 2 dt and v = e t , so that

\[Z t^2 e t dt = t^2 e t − 2tet − \int 2e t dt! .\]

Note the key role of the parentheses, as it is essential to distribute the minus sign to the entire value of the integral R 2tet dt. The final integral on the right in the most recent equation is a basic one; evaluating that integral and distributing the minus sign, we find

\[\int t^2 e t dt = t^2 e t − 2tet + 2e t + C.\]

Of course, situations are possible where even more than two applications of Integration by Parts may be necessary. For instance, in the preceding example, it is apparent that if the integrand was t 3 e t instead, we would have to use Integration by Parts three times. Next, we consider the slightly different scenario presented by the definite integral R e t cos(t) dt. Here, we can choose to let u be either e t or cos(t); we pick \(u = \cos(t)\), and thus dv = e t dt. With du = − sin(t) dt and v = e t , Integration by Parts tells us that

\[\int e t cos(t) dt = e t cos(t) − \int e t (− sin(t)) dt, \]

or equivalently that

\[\int e t cos(t) dt = e t cos(t) + \int e t sin(t) dt \label{5.9}\]

Observe that the integral on the right in Equation \ref{5.9}, R e t sin(t) dt, while not being more complicated than the original integral we want to evaluate, it is essentially identical to R e t cos(t) dt. While the overall situation isn’t necessarily better than what we started with, the problem hasn’t gotten worse. Thus, we proceed by integrating by parts again. This time we let u = sin(t) and dv = e t dt, so that du = cos(t) dt and v = e t , which implies

\[\int e^t \cos(t) \,dt = e^t \cos(t) + e^t \sin(t) − \int e^t \cos(t) \,dt! \label{5.10} \]

We seem to be back where we started, as two applications of Integration by Parts has led us back to the original problem, R e t cos(t) dt. But if we look closely at Equation \ref{5.10}, we see that we can use algebra to solve for the value of the desired integral. In particular, adding R e t cos(t) dt to both sides of the equation, we have

\[2 \int e t cos(t) dt = e t cos(t) + e^t \sin(t),\]

and therefore

\[\int e t cos(t) dt = 1 2 e t cos(t) + e t sin(t) + C.\]

Note that since we never actually encountered an integral we could evaluate directly, we didn’t have the opportunity to add the integration constant C until the final step, at which point we include it as part of the most general antiderivative that we sought from the outset in evaluating an indefinite integral.

Activity \(\PageIndex{4}\)

Evaluate each of the following indefinite integrals.

- Z x 2 sin(x) dx
- Z t 3 ln(t) dt
- Z e z sin(z) dz
- Z s 2 e 3s ds
- Z t arctan(t) dt (Hint: At a certain point in this problem, it is very helpful to note that t 2 1+t 2 = 1 − 1 1+t 2 .) C

### Evaluating Definite Integrals Using Integration by Parts

Just as we saw with u-substitution in Section 5.3, we can use the technique of Integration by Parts to evaluate a definite integral. Say, for example, we wish to find the exact value of

\[\int^{π/2}_0 t \sin(t) dt.\]

One option is to evaluate the related indefinite integral to find that

\[R t sin(t) dt = −t cos(t)+ sin(t) + C,\]

and then use the resulting antiderivative along with the Fundamental Theorem of Calculus to find that

\[\int^{π/2}_0 t sin(t) dt = (−t cos(t) + sin(t)) π/2 0 = − π 2 cos( π 2 ) + sin( π 2 ) − (−0 cos(0) + sin(0)) = 1.\]

Alternatively, we can apply Integration by Parts and work with definite integrals throughout. In this perspective, it is essential to remember to evaluate the product uv over the given limits of integration. To that end, using the substitution u = t and dv = sin(t) dt, so that du = dt and v = − cos(t), we write

\[\int^{π/2}_0 t sin(t) dt = −t cos(t) π/2 0 − Z π/2 0 (− cos(t)) dt = −t cos(t) π/2 0 + sin(t) π/2 0 = − π 2 cos( π 2 ) + sin( π 2 ) − (−0 cos(0) + sin(0)) = 1.\]

As with any substitution technique, it is important to remember the overall goal of the problem, to use notation carefully and completely, and to think about our end result to ensure that it makes sense in the context of the question being answered. When u-substitution and Integration by Parts Fail to Help As we close this section, it is important to note that both integration techniques we have discussed apply in relatively limited circumstances. In particular, it is not hard to find examples of functions for which neither technique produces an antiderivative; indeed, there are many, many functions that appear elementary but that do not have an elementary algebraic antiderivative. For instance, if we consider the indefinite integrals

\[\int e^{x^ 2} dx\]

and

\[\int x \tan(x) dx,\]

neither u-substitution nor Integration by Parts proves fruitful. While there are other integration techniques, some of which we will consider briefly, none of them enables us to find an algebraic antiderivative for e x 2 or x tan(x). There are at least two key observations to make: one, we do know from the Second Fundamental Theorem of Calculus that we can construct an integral antiderivative for each function; and two, antidifferentiation is much, much harder in general than differentiation. In particular, we observe that F(x) = R x 0 e t 2 dt is an antiderivative of f (x) = e x 2 , and G(x) = R x 0 t tan(t) dt is an antiderivative of g(x) = x tan(x). But finding an elementary algebraic formula that doesn’t involve integrals for either F or G turns out not only to be impossible through u-substitution or Integration by Parts, but indeed impossible altogether.

### Summary

In this section, we encountered the following important ideas:

- Through the method of Integration by Parts, we can evaluate indefinite integrals that involve products of basic functions such as R x sin(x) dx and R x ln(x) dx through a substitution that enables us to effectively trade one of the functions in the product for its derivative, and the other for its antiderivative, in an effort to find a different product of functions that is easier to integrate.
- If we are given an integral whose algebraic structure we can identify as a product of basic functions in the form R f (x)g 0 (x) dx, we can use the substitution u = f (x) and dv = g 0 (x) dx and apply the rule Z u dv = uv − Z v du in an effort to evaluate the original integral R f (x)g 0 (x) dx by instead evaluating R v du = R f 0 (x)g(x) dx.
- When deciding to integrate by parts, we normally have a product of functions present in the integrand and we have to select both u and dv. That selection is guided by the overall principal that we desire the new integral R v du to not be any more difficult or complicated than the original integral R u dv. In addition, it is often helpful to recognize if one of the functions present is much easier to differentiate than antidifferentiate (such as ln(x)), in which case that function often is best assigned the variable u. For sure, when choosing dv, the corresponding function must be one that we can antidifferentiate.

### Contributors

Matt Boelkins (Grand Valley State University), David Austin (Grand Valley State University), Steve Schlicker (Grand Valley State University)