Skip to main content
\(\newcommand{\dollar}{\$} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\arctanh}{arctanh} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section5.4Integration by Parts

Motivating Questions
  • How do we evaluate indefinite integrals that involve products of basic functions such as \(\int x \sin(x) \, dx\) and \(\int x e^x \, dx\text{?}\)

  • 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

\begin{equation*} \int x \sin(x) \, dx. \end{equation*}

Here, there is not a composite function present, but rather a product of the basic functions \(f(x) = x\) and \(g(x) = \sin(x)\text{.}\) 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 5.4.1 we refresh our understanding of the Product Rule and then investigate some indefinite integrals that involve products of basic functions.

Preview Activity5.4.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\text{,}\) then

\begin{equation*} \frac{d}{dx} \left[ f(x) \cdot g(x) \right] = f(x) \cdot g'(x) + g(x) \cdot f'(x). \end{equation*}

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

    1. \(g(x) = x\sin(x)\)

    2. \(h(x) = xe^x\)

    3. \(p(x) = x\ln(x)\)

    4. \(q(x) = x^2 \cos(x)\)

    5. \(r(x) = e^x \sin(x)\)

  2. Use your work in (a) to help you evaluate the following indefinite integrals. Use differentiation to check your work.

    1. \(\int xe^x + e^x \, dx\)

    2. \(\int e^x(\sin(x) + \cos(x)) \, dx\)

    3. \(\int 2x\cos(x) - x^2 \sin(x) \, dx\)

    4. \(\int x\cos(x) + \sin(x) \, dx\)

    5. \(\int 1 + \ln(x) \, dx\)

  3. 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

    \begin{equation*} \int x\cos(x) \, dx. \end{equation*}
    1. First, observe that

      \begin{equation*} \frac{d}{dx} \left[ x\sin(x) \right] = x\cos(x) + \sin(x). \end{equation*}

      Integrating both sides indefinitely and using the fact that the integral of a sum is the sum of the integrals, we find that

      \begin{equation*} \int \left(\frac{d}{dx} \left[ x\sin(x) \right] \right) \, dx = \int x\cos(x) \, dx + \int \sin(x) \, dx. \end{equation*}

      In this last equation, evaluate the indefinite integral on the left side as well as the rightmost indefinite integral on the right.

    2. In the most recent equation from (i.), solve the equation for the expression \(\int x \cos(x) \, dx\text{.}\)

    3. For which product of basic functions have you now found the antiderivative?

Subsection5.4.1Reversing the Product Rule: Integration by Parts

Problem (c) in Preview Activity 5.4.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

\begin{equation*} \frac{d}{dx} \left[ f(x) g(x) \right] = f(x) g'(x) + g(x) f'(x). \end{equation*}

Integrating both sides of this equation indefinitely with respect to \(x\text{,}\) it follows that

\begin{equation} \int \frac{d}{dx} \left[ f(x) g(x) \right] \, dx = \int f(x) g'(x) \, dx + \int g(x) f'(x) \, dx. \tag{5.4.1} \end{equation}

On the left in Equation (5.4.1), 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

\begin{equation} f(x) g(x) = \int f(x) g'(x) \, dx + \int g(x) f'(x) \, dx. \tag{5.4.2} \end{equation}

The most important thing to observe about Equation (5.4.2) 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\text{,}\) if we can integrate \(f(x) g'(x)\text{,}\) then we know the indefinite integral of \(g(x) f'(x)\text{,}\) and vice versa. To that end, we choose the first indefinite integral on the left in Equation (5.4.2) and solve for it to generate the rule

\begin{equation} \int f(x) g'(x) \, dx = f(x) g(x) - \int g(x) f'(x) \, dx. \tag{5.4.3} \end{equation}

Often we express Equation (5.4.3) in terms of the variables \(u\) and \(v\text{,}\) where \(u = f(x)\) and \(v = g(x)\text{.}\) Note that in differential notation, \(du = f'(x) \, dx\) and \(dv = g'(x) \, dx\text{,}\) and thus we can state the rule for Integration by Parts in its most common form as follows.

\begin{equation*} \int u \, dv = uv - \int v \, du. \end{equation*}

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

Example5.4.1

Evaluate the indefinite integral

\begin{equation*} \int x\cos(x) \, dx \end{equation*}

using Integration by Parts.

Solution

There are at least two additional important observations to make from Example 5.4.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 \(\int u \, dv\) for that of evaluating \(\int v \, du\text{.}\) This perspective clearly shapes our choice of \(u\) and \(v\text{.}\) In Example 5.4.1, the original integral to evaluate was \(\int x \cos(x) \,dx\text{,}\) and through the substitution provided by Integration by Parts, we were instead able to evaluate \(\int \sin(x) \cdot 1 \, dx\text{.}\) 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\text{.}\)

Activity5.4.2

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

  1. \(\int te^{-t} \, dt\)

  2. \(\int 4x \sin(3x) \, dx\)

  3. \(\int z \sec^2(z) \,dz\)

  4. \(\int x \ln(x) \, dx\)

Subsection5.4.2Some 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

\begin{equation*} \int \arctan(x) \, dx. \end{equation*}

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) \cdot 1\text{,}\) and realize that we know the derivative of \(\arctan(x)\) as well as the antiderivative of \(1\text{,}\) we see the possibility for the substitution \(u = \arctan(x)\) and \(dv = 1 \, dx\text{.}\) We explore this substitution further in Activity 5.4.3.

In a related problem, if we consider \(\int t^3 \sin(t^2) \, dt\text{,}\) two key observations can be made about the algebraic structure of the integrand: there is a composite function present in \(\sin(t^2)\text{,}\) and there is not an obvious function-derivative pair, as we have \(t^3\) present (rather than simply \(t\)) multiplying \(\sin(t^2)\text{.}\) 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 \cdot t^2\) and consider the indefinite integral

\begin{equation*} \int t \cdot t^2 \cdot \sin(t^2) \, dt, \end{equation*}

we can use a mix of the two techniques we have recently learned. First, let \(z = t^2\) so that \(dz = 2t \, dt\text{,}\) and thus \(t \, dt = \frac{1}{2} \, dz\text{.}\) (We are using the variable \(z\) to perform a “\(z\)-substitution” since \(u\) will be used subsequently in executing Integration by Parts.) Under this \(z\)-substitution, we now have

\begin{equation*} \int t \cdot t^2 \cdot \sin(t^2) \, dt = \int z \cdot \sin(z) \cdot \frac{1}{2} \, dz. \end{equation*}

The remaining integral is a standard one that can be evaluated by parts. This, too, is explored further in Activity 5.4.3.

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.

Activity5.4.3

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

  1. Evaluate \(\int \arctan(x) \, dx\) by using Integration by Parts with the substitution \(u = \arctan(x)\) and \(dv = 1 \, dx\text{.}\)

  2. Evaluate \(\int \ln(z) \,dz\text{.}\) Consider a similar substitution to the one in (a).

  3. Use the substitution \(z = t^2\) to transform the integral \(\int t^3 \sin(t^2) \, dt\) to a new integral in the variable \(z\text{,}\) and evaluate that new integral by parts.

  4. Evaluate \(\int s^5 e^{s^3} \, ds\) using an approach similar to that described in (c).

  5. Evaluate \(\int e^{2t} \cos(e^t) \, dt\text{.}\) You will find it helpful to note that \(e^{2t} = e^t \cdot e^t.\)

Subsection5.4.3Using 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 \(\int u \, dv\) for \(\int 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 \(\int t^2 e^t \, dt\) and let \(u = t^2\) and \(dv = e^t \, dt\text{,}\) then it follows that \(du = 2t \, dt\) and \(v = e^t\text{,}\) thus

\begin{equation*} \int t^2 e^t \, dt = t^2 e^t - \int 2t e^t \, dt. \end{equation*}

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\text{,}\) we have \(du = 2\, dt\) and \(v = e^t\text{,}\) so that

\begin{equation*} \int t^2 e^t \, dt = t^2 e^t - \left( 2t e^t - \int 2 e^t \, dt \right). \end{equation*}

Note the key role of the parentheses, as it is essential to distribute the minus sign to the entire value of the integral \(\int 2t e^t \, dt\text{.}\) 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

\begin{equation*} \int t^2 e^t \, dt = t^2 e^t - 2t e^t + 2 e^t + C. \end{equation*}

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^3e^t\) instead, we would have to use Integration by Parts three times.

Next, we consider the slightly different scenario presented by the definite integral \(\int e^t \cos(t) \, dt\text{.}\) Here, we can choose to let \(u\) be either \(e^t\) or \(\cos(t)\text{;}\) we pick \(u = \cos(t)\text{,}\) and thus \(dv = e^t \, dt\text{.}\) With \(du = -\sin(t) \, dt\) and \(v = e^t\text{,}\) Integration by Parts tells us that

\begin{equation*} \int e^t \cos(t) \, dt = e^t \cos(t) - \int e^t (-\sin(t))\, dt, \end{equation*}

or equivalently that

\begin{equation} \int e^t \cos(t) \, dt = e^t \cos(t) + \int e^t \sin(t) \, dt \tag{5.4.4} \end{equation}

Observe that the integral on the right in Equation (5.4.4), \(\int e^t \sin(t) \, dt\text{,}\) while not being more complicated than the original integral we want to evaluate, it is essentially identical to \(\int e^t \cos(t) \, dt\text{.}\) 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\text{,}\) so that \(du = \cos(t) \, dt\) and \(v = e^t\text{,}\) which implies

\begin{equation} \int e^t \cos(t) \, dt = e^t \cos(t) + \left( e^t \sin(t) - \int e^t \cos(t) \, dt \right) \tag{5.4.5} \end{equation}

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

\begin{equation*} 2 \int e^t \cos(t) \, dt = e^t \cos(t) + e^t \sin(t), \end{equation*}

and therefore

\begin{equation*} \int e^t \cos(t) \, dt = \frac{1}{2} \left( e^t \cos(t) + e^t \sin(t) \right) + C. \end{equation*}

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.

Activity5.4.4

Evaluate each of the following indefinite integrals.

  1. \(\int x^2 \sin(x) \, dx\)

  2. \(\int t^3 \ln(t) \, dt\)

  3. \(\int e^z \sin(z) \, dz\)

  4. \(\int s^2 e^{3s} \, ds\)

  5. \(\int t \arctan(t) \,dt\) (Hint: At a certain point in this problem, it is very helpful to note that \(\frac{t^2}{1+t^2} = 1 - \frac{1}{1+t^2}.\))

Subsection5.4.4Evaluating 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

\begin{equation*} \int_0^{\pi/2} t\sin(t) \, dt. \end{equation*}

One option is to evaluate the related indefinite integral to find that \(\int 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

\begin{align*} \int_0^{\pi/2} t\sin(t) \, dt =\mathstrut \amp \left( -t \cos(t) + \sin(t) \right) \bigg\vert_0^{\pi/2}\\ =\mathstrut \amp \left( -\frac{\pi}{2} \cos(\frac{\pi}{2}) + \sin(\frac{\pi}{2}) \right) - \left( -0 \cos(0) + \sin(0) \right)\\ =\mathstrut \amp 1. \end{align*}

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\text{,}\) so that \(du = dt\) and \(v = -\cos(t)\text{,}\) we write

\begin{align*} \int_0^{\pi/2} t\sin(t) \, dt =\mathstrut \amp -t \cos(t) \bigg\vert_0^{\pi/2} - \int_0^{\pi/2} (-\cos(t)) \, dt\\ =\mathstrut \amp -t \cos(t) \bigg\vert_0^{\pi/2} + \sin(t) \bigg\vert_0^{\pi/2}\\ =\mathstrut \amp \left( -\frac{\pi}{2} \cos(\frac{\pi}{2}) + \sin(\frac{\pi}{2}) \right) - \left( -0 \cos(0) + \sin(0) \right)\\ =\mathstrut \amp 1. \end{align*}

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.

Subsection5.4.5When \(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

\begin{equation*} \int e^{x^2} \, dx \ \ \text{and} \ \ \int x \tan(x) \, dx, \end{equation*}

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)\text{.}\) 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) = \int_0^x e^{t^2} \, dt\) is an antiderivative of \(f(x) = e^{x^2}\text{,}\) and \(G(x) = \int_0^{x} t \tan(t) \, dt\) is an antiderivative of \(g(x) = x \tan(x)\text{.}\) 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.

Subsection5.4.6Summary

  • Through the method of Integration by Parts, we can evaluate indefinite integrals that involve products of basic functions such as \(\int x \sin(x) \, dx\) and \(\int 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 \(\int f(x) g'(x) \, dx\text{,}\) we can use the substitution \(u = f(x)\) and \(dv = g'(x) \,dx\) and apply the rule

    \begin{equation*} \int u \, dv = uv - \int v \, du \end{equation*}

    in an effort to evaluate the original integral \(\int f(x) g'(x) \, dx\) by instead evaluating \(\int v \, du = \int f'(x) g(x) \, dx\text{.}\)

  • 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\text{.}\) That selection is guided by the overall principal that we desire the new integral \(\int v \, du\) to not be any more difficult or complicated than the original integral \(\int u \, dv\text{.}\) 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\text{.}\) For sure, when choosing \(dv\text{,}\) the corresponding function must be one that we can antidifferentiate.

Subsection5.4.7Exercises

1
2
3
4
5

Let \(f(t) = te^{-2t}\) and \(F(x) = \int_0^x f(t) \, dt\text{.}\)

  1. Determine \(F'(x)\text{.}\)

  2. Use the First FTC to find a formula for \(F\) that does not involve an integral.

  3. Is \(F\) an increasing or decreasing function for \(x \gt 0\text{?}\) Why?

6

Consider the indefinite integral given by \(\int e^{2x} \cos(e^x) \, dx\text{.}\)

  1. Noting that \(e^{2x} = e^x \cdot e^x\text{,}\) use the substitution \(z = e^{x}\) to determine a new, equivalent integral in the variable \(z\text{.}\)

  2. Evaluate the integral you found in (a) using an appropriate technique.

  3. How is the problem of evaluating \(\int e^{2x} \cos(e^{2x}) \, dx\) different from evaluating the integral in (a)? Do so.

  4. Evaluate each of the following integrals as well, keeping in mind the approach(es) used earlier in this problem:

    • \(\int e^{2x} \sin(e^x) \, dx\)

    • \(\int e^{3x} \sin(e^{3x}) \, dx\)

    • \(\int xe^{x^2} \cos(e^{x^2}) \sin(e^{x^2}) \, dx\)

7

For each of the following indefinite integrals, determine whether you would use \(u\)-substitution, integration by parts, neither*, or both to evaluate the integral. In each case, write one sentence to explain your reasoning, and include a statement of any substitutions used. (That is, if you decide in a problem to let \(u = e^{3x}\text{,}\) you should state that, as well as that \(du = 3e^{3x} \, dx\text{.}\)) Finally, use your chosen approach to evaluate each integral. (* one of the following problems does not have an elementary antiderivative and you are not expected to actually evaluate this integral; this will correspond with a choice of “neither” among those given.)

  1. \(\int x^2 \cos(x^3) \, dx\)

  2. \(\int x^5 \cos(x^3) \, dx\)  (Hint: \(x^5 = x^2 \cdot x^3\))

  3. \(\int x\ln(x^2) \, dx\)

  4. \(\int \sin(x^4) \, dx\)

  5. \(\int x^3 \sin(x^4) \, dx\)

  6. \(\int x^7 \sin(x^4) \, dx\)