Skip to main content

Section 5.4 Integration by Parts

In Section 5.3, we learned the technique of \(u\)-substitution for evaluating indefinite integrals. For example, the indefinite integral \(\int x^3 \sin(x^4) \, dx\) is perfectly suited to \(u\)-substitution, because one factor is a composite function and the other factor is the derivative (up to a constant) of the inner function. Recognizing the algebraic structure of a function can help us to find its antiderivative.

Next we consider integrands with a different elementary algebraic structure: a product of basic functions. For instance, suppose we are interested in evaluating the indefinite integral

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

The integrand is the product of the basic functions \(f(x) = x\) and \(g(x) = \sin(x)\text{.}\) 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. 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 Activity 5.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)\text{.} \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\text{.} \end{equation*}
    1. First, observe that

      \begin{equation*} \frac{d}{dx} \left[ x\sin(x) \right] = x\cos(x) + \sin(x)\text{.} \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\text{.} \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?

Subsection 5.4.1 Reversing the Product Rule: Integration by Parts

Problem (c) in Preview Activity 5.4.1 provides a clue to 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)\text{.} \end{equation*}

Integrating both sides of this equation indefinitely with respect to \(x\text{,}\) we find

\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\text{.}\label{PhC}\tag{5.4.1} \end{equation}

On the left side of Equation (5.4.1), we have the indefinite integral of the derivative of a function. Temporarily omitting the constant that may arise, we have

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

We solve for the first indefinite integral on the left to generate the rule

\begin{equation} \int f(x) g'(x) \, dx = f(x) g(x) - \int g(x) f'(x) \, dx\text{.}\label{bvU}\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{.}\) In differential notation, \(du = f'(x) \, dx\) and \(dv = g'(x) \, dx\text{,}\) so 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\text{.} \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.

Evaluate the indefinite integral

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

using integration by parts.

Solution

When we use integration by parts, we have a choice for \(u\) and \(dv\text{.}\) In this problem, we can either let \(u = x\) and \(dv = \cos(x) \, dx\text{,}\) or let \(u = \cos(x)\) and \(dv = x \, dx\text{.}\) While there is not a universal rule for how to choose \(u\) and \(dv\text{,}\) a good guideline is this: do so in a way that \(\int v \, du\) is at least as simple as the original problem \(\int u \, dv\text{.}\)

This leads us to choose 1 \(u = x\) and \(dv = \cos(x) \, dx\text{,}\) from which it follows that \(du = 1 \, dx\) and \(v = \sin(x)\text{.}\) With this substitution, the rule for integration by parts tells us that

\begin{equation*} \int x \cos(x) \, dx = x \sin(x) - \int \sin(x) \cdot 1 \, dx\text{.} \end{equation*}
Observe that if we considered the alternate choice, and let \(u = \cos(x)\) and \(dv = x \, dx\text{,}\) then \(du = -\sin(x) \, dx\) and \(v = \frac{1}{2}x^2\text{,}\) from which we would write \(\int x\cos(x) \, dx = \frac{1}{2}x^2 \cos(x) - \int \frac{1}{2}x^2 (-\sin(x)) \, dx\text{.}\) Thus we have replaced the problem of integrating \(x \cos(x)\) with that of integrating \(\frac{1}{2}x^2 \sin(x)\text{;}\) the latter is clearly more complicated, which shows that this alternate choice is not as helpful as the first choice.

All that remains to do is evaluate the (simpler) integral \(\int \sin(x) \cdot 1 \, dx\text{.}\) Doing so, we find

\begin{equation*} \int x \cos(x) \, dx = x \sin(x) - (-\cos(x)) + C = x\sin(x) + \cos(x) + C\text{.} \end{equation*}

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

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. That is, we convert the problem of evaluating \(\int u \, dv\) to that of evaluating \(\int v \, du\text{.}\) This 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.

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

Hint
  1. Try \(u=t\text{.}\)

  2. Let \(dv=\sin(3x)dx\)

  3. Remember that \(\int \sec^2(z) \,dz = \tan(z)\text{.}\)

  4. Note that \(\ln(x) \, dx\) has a simple derivative to work with.

Answer
  1. \(\int t e^{-t} dt = -te^{-t} - e^{-t}\text{.}\)

  2. \(\int 4x \sin(3x) dx = -\dfrac{4}{3} x \cos(3x) + \frac{4}{9} \sin(3x) + c \text{.}\)

  3. \(\int z \sec^2(z) dz = z \tan(z) + \ln (\cos(z)) + c \text{.}\)

  4. \(\int x\ln(x) dx = \frac{1}{2}x^2 \ln(x) - \frac{1}{4}x^2 + c \text{.}\)

Solution
  1. Using \(u = t\) and \(dv = e^{-t} dt\text{,}\) we obtain \(du = dt\) and \(v = -e^{-t}\text{.}\) So

    \begin{align*} \int t e^{-t} dt \amp = -te^{-t} + \int e^{-t} dt\\ \amp = -te^{-t} - e^{-t} + c \end{align*}

    We check using differentiation as follows:

    \begin{align*} \frac{d}{dt} \left( -te^{-t} - e^{-t} + c \right) \amp = \left( t e^{-t} - e^{-t} \right) + e^{-t}\\ \amp = te^{-t} \end{align*}
  2. Using \(u = 4x\) and \(dv = \sin(3x) dx\text{,}\) we obtain \(du = 4 dx\) and \(v = -\dfrac{1}{3} \cos(3x)\text{.}\) So

    \begin{align*} \int 4x \sin(3x) dx \amp = -\dfrac{4}{3} x \cos(3x) + \dfrac{4}{3} \int \cos(3x) dx\\ \amp = -\dfrac{4}{3} x \cos(3x) + \frac{4}{9} \sin(3x) + c \end{align*}

    We check using differentiation as follows:

    \begin{align*} \frac{d}{dx} \left( -\dfrac{4}{3} x \cos(3x) + \frac{4}{9} \sin(3x) + c \right) \amp = \left( 4x \sin(3x) - \frac{4}{3} \cos(3x) \right) + \frac{4}{3} \cos(3x)\\ \amp = 4x \sin(3x) \end{align*}
  3. Using \(u = z\) and \(dv = \sec^2(z) dz\text{,}\) we obtain \(du = dz\) and \(v = \tan(z)\text{.}\) So

    \begin{align*} \int z \sec^2(z) dz \amp = z \tan(z) - \int \tan(z) dz\\ \amp = z \tan(z) + \ln (\cos(z)) + c \end{align*}

    We check using differentiation as follows:

    \begin{align*} \frac{d}{dz} \left( z \tan(z) + \ln (\cos(z)) + c \right) \amp = z\sec^2(z) + \tan(z) - \frac{\sin(z)}{\cos(z)}\\ \amp = z\sec^2(z) + \tan(z) - \tan(z)\\ \amp = z \sec^2(z) \end{align*}
  4. Using \(u = \ln(x)\) and \(dv = x dx\text{,}\) we obtain \(du = \dfrac{1}{x} dx\) and \(v = \dfrac{1}{2}x^2\text{.}\) So

    \begin{align*} \int x\ln(x) dx \amp = \frac{1}{2}x^2 \ln(x) - \frac{1}{2} \int x dx\\ \amp = \frac{1}{2}x^2 \ln(x) - \frac{1}{4}x^2 + c \end{align*}

    We check using differentiation as follows:

    \begin{align*} \frac{d}{dx} \left( \frac{1}{2}x^2 \ln(x) - \frac{1}{4}x^2 + c \right) \amp = \frac{1}{2}x + x \ln(x) - \frac{1}{2} x\\ \amp = x \ln(x) \end{align*}

Subsection 5.4.2 Some Subtleties with Integration by Parts

Sometimes integration by parts is not an obvious choice, but the technique is appropriate nonetheless. 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 evaluating

\begin{equation*} \int \arctan(x) \, dx\text{.} \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, consider \(\int t^3 \sin(t^2) \, dt\text{.}\) Observe that there is a composite function present in \(\sin(t^2)\text{,}\) but there is not an obvious function-derivative pair, as we have \(t^3\) (rather than simply \(t\)) multiplying \(\sin(t^2)\text{.}\) In this problem we use both \(u\)-substitution and integration by parts. First 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\text{.} \end{equation*}

We 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” first so that we may then apply 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\text{.} \end{equation*}

The resulting integral can be evaluated by parts. This, too, is explored further in Activity 5.4.3.

These problems show that we sometimes must think creatively in choosing the variables for substitution in integration by parts, and that we may need to use substitution for an additional change of variables.

Activity 5.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\text{.}\)

Answer
  1. \(\int{\arctan(x) dx} = x\arctan(x) - \frac{1}{2} \ln \left( 1 + x^2 \right) + c \text{.}\)

  2. \(\int \ln(z) dz = z \ln(z) - z + c \text{.}\)

  3. \(\int t^3 \sin(t^2) dt = \frac{1}{2} \left( -t^2 \cos\left(t^2 \right) + \sin\left(t^2\right) \right) \text{.}\)

  4. \(\int s^5 e^{s^3} ds = \frac{1}{3} \left( s^3 e^{s^3} - e^{s^3} \right) + c \text{.}\)

  5. \(\int e^{2t} \cos\left( e^t \right) dt = e^t \sin \left( e^t \right) + \cos \left( e^t \right) + c \text{.}\)

Solution
  1. We use integration by parts with \(u = \arctan(x)\) and \(dv = dx\text{.}\) So \(du = \dfrac{1}{1+x^2}dx\) and \(v = x\text{.}\)

    \begin{align*} \int{\arctan(x) dx} \amp = uv - \int{v du}\\ \amp = x\arctan(x) - \int\frac{x}{1+x^2} dx \end{align*}

    For the integral in the last equation, use the substitution \(z = 1+x^2\) and \(dz = 2x\, dx\text{.}\)

    \begin{align*} \int \arctan(x) dx \amp = x\arctan(x) -\int\frac{x}{1+x^2} dx\\ \amp = x\arctan(x) - \frac{1}{2} \int \frac{1}{z} dz\\ \amp = x\arctan(x) - \frac{1}{2} \ln(z) + c\\ \amp = x\arctan(x) - \frac{1}{2} \ln \left( 1 + x^2 \right) + c \end{align*}
  2. Using \(u = \ln(z)\) and \(dv = dz\text{,}\) we obtain \(du = \dfrac{1}{z} dz\) and \(v = z\text{.}\) So

    \begin{align*} \int \ln(z) dz \amp = z \ln(z) - \int dz\\ \amp = z \ln(z) - z + c \end{align*}
  3. Using \(z = t^2\text{,}\) we obtain \(dz = 2t dt\) and \(\dfrac{1}{2} dz = t dt\text{.}\) So

    \begin{align*} \int t^3 \sin(t^2) dt \amp = \int t^2 \sin(t^2) \cdot t dt\\ \amp = \int z \sin(z) \frac{1}{2} dz\\ \amp = \frac{1}{2} \int z \sin(z) dz \end{align*}

    Now using integration by parts with \(u = z\) and \(dv = \sin(z) dz\text{,}\) we obtain \(du = dz\) and \(v = -\cos(z)\text{.}\) So

    \begin{align*} \int t^3 \sin(t^2) dt \amp = \frac{1}{2} \int z \sin(z) dz\\ \amp = \frac{1}{2} \left( -z \cos(z) + \int \cos(z) dz \right)\\ \amp = \frac{1}{2} \left( -z \cos(z) + \sin(z) \right) \end{align*}

    Finally, we use \(z = t^2\) and obtain

    \begin{equation*} \int t^3 \sin(t^2) dt = \frac{1}{2} \left( -t^2 \cos\left(t^2 \right) + \sin\left(t^2\right) \right)\text{.} \end{equation*}
  4. Use a substitution with \(z = s^3\) and \(dz = 3s^2 ds\text{.}\)

    \begin{align*} \int s^5 e^{s^3} ds \amp = \int s^2 s^3 e^{s^3} ds\\ \amp = \frac{1}{3} \int z e^z dz \end{align*}

    Now use integration by parts with \(u = z\) and \(dv = e^z dz\text{.}\) So \(du = dz\) and \(v = e^z\text{.}\)

    \begin{align*} \int s^5 e^{s^3} ds \amp = \frac{1}{3} \int z e^z dz\\ \amp = \frac{1}{3} \left( z e^z - \int e^z dz \right)\\ \amp = \frac{1}{3} \left( z e^z - e^z \right) + c\\ \amp = \frac{1}{3} \left( s^3 e^{s^3} - e^{s^3} \right) + c \end{align*}
  5. Using \(z = e^t\text{,}\) we see that \(dz = e^t dt\) and so

    \begin{align*} \int e^{2t} \cos\left( e^t \right) dt \amp = \int e^t \cos\left( e^t \right) \cdot e^t dt\\ \amp = \int z \cos(z) dz \end{align*}

    In Example 5.4.1, we saw that

    \begin{equation*} \int z \cos(z) dz = z \sin(z) + \cos(z) + c\text{.} \end{equation*}

    Combining these two results, we obtain

    \begin{align*} \int e^{2t} \cos\left( e^t \right) dt \amp = \int z \cos(z) dz\\ \amp = z \sin(z) + \cos(z) + c\\ \amp = e^t \sin \left( e^t \right) + \cos \left( e^t \right) + c \end{align*}

Subsection 5.4.3 Using Integration by Parts Multiple Times

Integration by parts is well suited to integrating the product of basic functions, allowing us to trade a given integrand for a new one where one function in the product is replaced by its derivative, and the other is replaced by its antiderivative. The goal in this trade of \(\int u \, dv\) for \(\int v \, du\) is that the new integral be simpler to evaluate than the original one. Sometimes it is necessary to apply integration by parts more than once in order to evaluate a given integral.

Evaluate \(\int t^2 e^t \, dt\text{.}\)

Solution

Let \(u = t^2\) and \(dv = e^t \, dt\text{.}\) Then \(du = 2t \, dt\) and \(v = e^t\text{,}\) and thus

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

The integral on the right 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)\text{.} \end{equation*}

(Note the parentheses, which remind us to distribute the minus sign to the entire value of the integral \(\int 2t e^t \, dt\text{.}\)) The final integral on the right 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\text{.} \end{equation*}

Of course, even more than two applications of integration by parts may be necessary. In the preceding example, if the integrand had been \(t^3e^t\text{,}\) we would have had to use integration by parts three times.

Next, we consider the slightly different scenario.

Evaluate \(\int e^t \cos(t) \, dt\text{.}\)

Solution

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\text{,} \end{equation*}

or equivalently that

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

The new integral has the same algebraic structure as the original one. While the overall situation isn't necessarily better than what we started with, it hasn't gotten worse. Thus, we proceed to integrate 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)\text{.}\label{dlh}\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. 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)\text{,} \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\text{.} \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.

Activity 5.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}\text{.}\))

Hint
  1. Start with \(u=x^2\text{.}\)

  2. Begin with \(u=t^3\text{.}\)

  3. You'll have to integrate by parts twice.

  4. Start with \(u=s^2\text{.}\)

  5. Try \(u=\arctan(x)\text{.}\)

Answer
  1. \(\int x^2 \sin(x) dx = -x^2 \cos(x) + 2x \sin(x) + 2 \cos(x) + c \text{.}\)

  2. \(\int t^3 \ln(t) dt = \frac{1}{4} t^4 \ln(t) - \frac{1}{16} t^4 + c \text{.}\)

  3. \(\int e^z \sin(z) dz = -\frac{1}{2}e^z \cos(z) + \frac{1}{2}e^z \sin(z) + c \text{.}\)

  4. \(\int s^2 e^{3s} ds = \frac{1}{3}s^2 e^{3s} - \frac{2}{9}s e^{3s} + \frac{2}{27} e^{3s} + c \text{.}\)

  5. \(\int t \arctan(t) dt = \frac{1}{2}t^2 \arctan(t) - \frac{1}{2}t - \frac{1}{2} \arctan(t) + c \text{.}\)

Solution
  1. First, using \(u = x^2\) and \(dv = \sin(x) dx\text{,}\) we get \(du = 2x dx\) and \(v = -\cos(x)\text{.}\) So

    \begin{equation*} \int x^2 \sin(x) dx = -x^2 \cos(x) + 2 \int x \cos(x) dx\text{.} \end{equation*}

    Now, for \(\int x \cos(x) dx\text{,}\) we use \(u = x\) and \(dv = \cos(x)\) and get \(du = dx\) and \(v =\sin(x)\text{.}\) So

    \begin{align*} \int x^2 \sin(x) dx \amp = -x^2 \cos(x) + 2 \left( x \sin(x) - \int \sin(x) dx \right)\\ \amp = -x^2 \cos(x) + 2x \sin(x) + 2 \cos(x) + c \end{align*}
  2. Using \(u = \ln(t)\) and \(dv = t^3 dt\text{,}\) we get \(du = \dfrac{1}{t} dt\) and \(v = \dfrac{1}{4} t^4\text{.}\) So

    \begin{align*} \int t^3 \ln(t) dt \amp = \frac{1}{4} t^4 \ln(t) - \frac{1}{4} \int t^3 dt\\ \amp = \frac{1}{4} t^4 \ln(t) - \frac{1}{4} \cdot \frac{1}{4} t^4 + c\\ \amp = \frac{1}{4} t^4 \ln(t) - \frac{1}{16} t^4 + c \end{align*}
  3. We use \(u = e^z\) and \(dv = \sin(z) dz\text{.}\) This gives \(du = e^z dz\) and \(v = -\cos(z)\text{,}\) and

    \begin{equation*} \int e^z \sin(z) dz = -e^z \cos(z) + \int e^z \cos(z) dz\text{.} \end{equation*}

    For \(\int e^z \cos(z) dz\text{,}\) we use \(u = e^z\) and \(dv = \cos(z) dz\text{.}\) So \(du = e^z dz\) and \(v = \sin(z)\text{,}\) and

    \begin{align*} \int e^z \sin(z) dz \amp = -e^z \cos(z) + e^z \sin(z) dz - \int e^z \sin(z) dz\\ 2 \int e^z \sin(z) dz \amp = -e^z \cos(z) + e^z \sin(z) + c'\\ \int e^z \sin(z) dz \amp = -\frac{1}{2}e^z \cos(z) + \frac{1}{2}e^z \sin(z) + c' \end{align*}
  4. We use \(u = s^2\text{,}\) \(dv = e^{3s} ds\text{,}\) \(du = 2s ds\text{,}\) and \(v = \frac{1}{3} e^{3s}\text{.}\) This gives

    \begin{equation*} \int s^2 e^{3s} ds = \frac{1}{3}s^2 e^{3s} - \frac{2}{3} \int s e^{3s} ds\text{.} \end{equation*}

    We now use \(u = s\text{,}\) \(dv = e^{3s} ds\text{,}\) \(du = ds\text{,}\) and \(v = \dfrac{1}{3} e^{3s}\) for \(\int s e^{3s} ds\text{.}\)

    \begin{align*} \int s^2 e^{3s} ds \amp = \frac{1}{3}s^2 e^{3s} - \frac{2}{3} \left( \frac{1}{3}s e^{3s} - \frac{1}{3}\int e^{3s} ds \right)\\ \amp = \frac{1}{3}s^2 e^{3s} - \frac{2}{3} \left( \frac{1}{3}s e^{3s} - \frac{1}{9} e^{3s} \right) + c\\ \amp = \frac{1}{3}s^2 e^{3s} - \frac{2}{9}s e^{3s} + \frac{2}{27} e^{3s} + c \end{align*}
  5. Using \(u = \arctan(t)\text{,}\) \(dv = t dt\text{,}\) \(du = \dfrac{1}{1+t^2} dt\text{,}\) and \(v = \dfrac{1}{2} t^2\text{,}\) we get

    \begin{align*} \int t \arctan(t) dt \amp = \frac{1}{2}t^2 \arctan(t) - \frac{1}{2} \int \frac{t^2}{1 + t^2} dt\\ \amp = \frac{1}{2}t^2 \arctan(t) - \frac{1}{2} \int \left( 1 - \frac{1}{1 + t^2} \right) dt\\ \amp = \frac{1}{2}t^2 \arctan(t) - \frac{1}{2}t - \frac{1}{2} \arctan(t) + c \end{align*}

Subsection 5.4.4 Evaluating Definite Integrals Using Integration by Parts

We can use the technique of integration by parts to evaluate a definite integral.

Evaluate

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

One option is to find an antiderivative (using indefinite integral notation) and then apply 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\text{.} \end{align*}

Alternatively, we can apply integration by parts and work with definite integrals throughout. With this method, we must remember to evaluate the product \(uv\) over the given limits of integration. 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\text{.} \end{align*}

As with any substitution technique, it is important to use notation carefully and completely, and to ensure that the end result makes sense.

Subsection 5.4.5 When \(u\)-substitution and Integration by Parts Fail to Help

Both integration techniques we have discussed apply in relatively limited circumstances. 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, neither \(u\)-substitution nor integration by parts proves fruitful for the indefinite integrals

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

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{.}\) We do know from the Second Fundamental Theorem of Calculus that we can construct an integral antiderivative for each function; \(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. Antidifferentiation is much harder in general than differentiation.

Subsection 5.4.6 Summary

  • 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\text{.}\) Using a substitution enables us to 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 the algebraic structure of an integrand is 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*}

    to evaluate the original integral \(\int f(x) g'(x) \, dx\) by instead evaluating

    \begin{equation*} \int v \, du = \int f'(x) g(x) \, dx\text{.} \end{equation*}
  • When deciding to integrate by parts, we have to select both \(u\) and \(dv\text{.}\) That selection is guided by the overall principle that the new integral \(\int v \, du\) not be more difficult 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{.}\) In addition, \(dv\) must be a function that we can antidifferentiate.

Exercises 5.4.7 Exercises

1. Choose which method to use.
2. Product involving \(\cos(5 x)\).
3. Product involving \(e^{8 z}\).
4. Definite integral of \(t e^{-t}\).
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?

Answer
  1. \(F'(x) = xe^{-2x}\text{.}\)

  2. \(F(x) = -\frac{1}{2}xe^{-2x} - \frac{1}{4}e^{-2x} + \frac{1}{4}\)

  3. Increasing.

Solution
  1. By the Second Fundamental Theorem of Calculus, \(F'(x) = f(x) = xe^{-2x}\text{.}\)

  2. To use the First Fundamental Theorem of Calculus to evaluate the integral in \(F(x) = \int_0^x te^{-2t} \, dt\text{,}\) we use integration by parts. Letting

    \begin{align*} u &= t, \ du = dt\\ dv &= e^{-2t} \, dt, \ v = -\frac{1}{2}e^{-2t}\text{,} \end{align*}

    it follows that

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

    Thus,

    \begin{align*} F(x) &= \int_0^x te^{-2t} \, dt\\ &= \left. -\frac{1}{2}te^{-2t} - \frac{1}{4}e^{-2t} \right|_{0}^{x}\\ &= -\frac{1}{2}xe^{-2x} - \frac{1}{4}e^{-2x} - \left( 0 - \frac{1}{4}e^{0} \right)\\ &= -\frac{1}{2}xe^{-2x} - \frac{1}{4}e^{-2x} + \frac{1}{4} \end{align*}
  3. For \(x \gt 0\text{,}\) we observe that \(F'(x) = f(x) = xe^{-2x} \gt 0\) since \(e\) to any power is positive. Thus, because \(F'(x) \gt 0\text{,}\) it follows that \(F\) is increasing for all \(x \gt 0\text{.}\)

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

Answer
  1. \(\int e^{2x} \cos(e^x) \, dx = \int z \cos(z) \, dz\text{.}\)

  2. \(\int e^{2x} \cos(e^x) \, dx = e^x \sin(e^x) + \cos(e^x) + C\text{.}\)

  3. \(\int e^{2x} \cos(e^{2x}) \, dx = \frac{1}{2} \sin(e^{2x} + C\)

    • \(\int e^{2x} \sin(e^x) \, dx = sin(e^x) - z\cos(e^x) + C\text{.}\)

    • \(\int e^{3x} \sin(e^{3x}) \, dx = -\frac{1}{3} \cos(e^{3x}) + C\text{.}\)

    • \(\int xe^{x^2} \cos(e^{x^2}) \sin(e^{x^2}) \, dx = \frac{1}{4} \sin^2(e^{x^2}) + C\text{.}\)

Solution
  1. We first write

    \begin{equation*} \int e^{2x} \cos(e^x) \, dx = \int e^x \cdot e^x \cos(e^x) \, dx\text{.} \end{equation*}

    Letting \(z = e^x\text{,}\) we have \(dz = e^x \, dx\text{,}\) and thus

    \begin{equation*} \int e^{2x} \cos(e^x) \, dx = \int z \cos(z) \, dz\text{.} \end{equation*}
  2. We can evaluate the integral \(\int z \cos(z) \, dz\) using integration by parts in the standard way with \(u = z\) and \(dv = \cos(z) \, dz\text{.}\) Doing so,

    \begin{equation*} \int z \cos(z) \, dz = z \sin(z) - \int \sin(z) \, dz = z \sin(z) + \cos(z) + C\text{.} \end{equation*}

    Returning to the original integral in \(x\) and using the substitution we first used with \(z\text{,}\) we have shown that

    \begin{equation*} \int e^{2x} \cos(e^x) \, dx = e^x \sin(e^x) + \cos(e^x) + C\text{.} \end{equation*}
  3. For the integral \(\int e^{2x} \cos(e^{2x}) \, dx\text{,}\) we actually have a function-derivative pair (up to a constant multiple) already present: letting \(u = e^{2x}\text{,}\) \(du = 2e^{2x} \, dx\text{,}\) and thus we can evaluate the integral using this substitution. In particular,

    \begin{align*} \int e^{2x} \cos(e^{2x}) \, dx &= \int \cos(u) \cdot \frac{1}{2} \, du\\ &= \frac{1}{2} \sin(u) + C\\ &= \frac{1}{2} \sin(e^{2x} + C \end{align*}
    • For the first integral, \(\int e^{2x} \sin(e^x) \, dx\text{,}\) since \(e^x\) is the inside function in the composition, we let \(z = e^x\text{,}\) so \(dz = e^x \, dx\text{,}\) and write \(e^{2x} = e^x \cdot e^x\text{.}\) Hence,

      \begin{equation*} \int e^{2x} \sin(e^x) \, dx = \int e^x \cdot e^x \sin(e^x) \, dx = \int z \sin(z) \, dz\text{.} \end{equation*}

      Using the standard integration by parts with \(u = z\) and \(dv = \sin(z) \, dz\text{,}\) we find

      \begin{equation*} \int z \sin(z) \, dz = sin(z) - z\cos(z) + C\text{.} \end{equation*}

      Re-substituting from \(z\) back to \(x\text{,}\) we've found that

      \begin{equation*} \int e^{2x} \sin(e^x) \, dx = sin(e^x) - z\cos(e^x) + C\text{.} \end{equation*}
    • The integral \(\int e^{3x} \sin(e^{3x}) \, dx\) can be evaluated using a \(u\)-substitution since \(u = e^{3x}\) is present to form a function-derivative pair with \(du = 3e^{3x}\text{.}\) It follows that

      \begin{equation*} \int e^{3x} \sin(e^{3x}) \, dx = \int \sin(u) \cdot \frac{1}{3} \, du = -\frac{1}{3} \cos(u) + C = -\frac{1}{3} \cos(e^{3x}) + C\text{.} \end{equation*}
    • For the final integral, \(\int xe^{x^2} \cos(e^{x^2}) \sin(e^{x^2}) \, dx\text{,}\) we first observe by the chain rule that \(\frac{d}{dx}\left[e^{x^2}\right] = 2xe^{x^2}\text{,}\) which shows that we have a function-derivative pair present. Using the substitution \(z = e^{x^2}\text{,}\) it follows \(dz = 2xe^{x^2} \, dx\text{,}\) and therefore

      \begin{equation*} \int xe^{x^2} \cos(e^{x^2}) \sin(e^{x^2}) \, dx = \int \cos(z) \sin(z) \cdot \frac{1}{2} \, dz\text{.} \end{equation*}

      The new integral in \(z\) can be evaluated using several different approaches, including \(u\)-substitution with \(u = \sin(z)\text{,}\) \(du = \cos(z) \, dz\text{.}\) Doing so,

      \begin{equation*} \int \cos(z) \sin(z) \cdot \frac{1}{2} \, dz = \frac{1}{2} \int u \, du = \frac{1}{2} \cdot \frac{1}{2} u^2 + C = \frac{1}{4} \sin^2(z) + C\text{.} \end{equation*}

      Returning to the original integral in \(x\) and our earlier work, substituting backward we find that

      \begin{equation*} \int xe^{x^2} \cos(e^{x^2}) \sin(e^{x^2}) \, dx = \frac{1}{4} \sin^2(e^{x^2}) + C\text{.} \end{equation*}
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\)

Answer
  1. \(u\)-substitution; \(\int x^2 \cos(x^3) \ dx = \frac{1}{3} \sin(x^3) + C\text{.}\)

  2. Both are needed; \(\int x^5 \cos(x^3) \ dx = \frac{1}{3} \left(x^3\sin(x^3) + \cos(x^3) \right) + C\text{.}\)

  3. Integration by parts; \(\int x ln(x^2) \ dx = \frac{x^2}{2} \ln(x^2) - \frac{x^2}{2} + C\text{.}\)

  4. Neither.

  5. \(u\)-substitution; \(\int x^3 \sin(x^4) \ dx = -\frac{1}{4} \cos(x^4) + C\text{.}\)

  6. Both are needed; \(\int x^7 \sin(x^4) \ dx = -\frac{1}{4} x^4 \cos(x^4) + \frac{1}{4} \sin(x^4) + C\text{.}\)

Solution
  1. We will use a \(u\)-substitution with \(u = x^3\) because the integrand involves a composite function with \(x^3\) as the innermost function and because \(du = 3x^2 \, dx\) involves the factor \(x^2\) which is also present in the integrand. When we make this substitution we will have \(x^2 \ dx = \frac{1}{3} \ du\) and the integral can be evaluated as follows:

    \begin{align*} \int x^2 \cos(x^3) \ dx &= \frac{1}{3} \int \cos(u) \ du\\ &= \frac{1}{3} \sin(u) + C\\ &= \frac{1}{3} \sin(x^3) + C\text{.} \end{align*}
  2. We might try substituting \(z = x^3/\text{,}\) since there is a composite function in the integrand. In this case we have \(dz = 3x^2 \, dx\text{.}\) To make this substitution we need to rewrite the integrand as

    \begin{equation*} x^5 \cos(x^3) = x^3 \left[x^2 \cos(x^3) \right] \end{equation*}

    and notice that \(x^3 = z\text{.}\) Then

    \begin{equation*} \int x^5 \cos(x^3) \ dx = \frac{1}{3} \int z \cos(z) \ dz\text{.} \end{equation*}

    We can then try integration by parts on this last integral with

    \begin{align*} u &= z, \ du = dz\\ dv & = \cos(z) \, dz, \ v = \sin(z) \end{align*}

    We then have

    \begin{align*} \int x^5 \cos(x^3) \ dx &= \frac{1}{3} \int z \cos(z) \ dz\\ &= \frac{1}{3} \left(z\sin(z) - \int \sin(z) \ dz \right)\\ &= \frac{1}{3} \left(z\sin(z) + \cos(z) \right) + C\\ &= \frac{1}{3} \left(x^3\sin(x^3) + \cos(x^3) \right) + C\text{.} \end{align*}
  3. Since the logarithm function changes to a rational function when we differentiate it, using integration by parts with \(u = \ln(x^2) = 2\ln(x)\) will make the resulting integral easier to evaluate. So we let

    \begin{align*} u &= \ln(x^2), \ du = \frac{2}{x} \ dx\\ dv & = x \ dx , \ v = \frac{x^2}{2} \end{align*}

    and then integration by parts yields

    \begin{align*} \int x ln(x^2) \ dx &= \frac{x^2}{2} \ln(x^2) - \int \left(\frac{2}{x}\right) \left(\frac{x^2}{2}\right) \ dx\\ &= \frac{x^2}{2} \ln(x^2) - \int x \ dx\\ &= \frac{x^2}{2} \ln(x^2) - \frac{x^2}{2} + C\text{.} \end{align*}
  4. We might try a substitution with \(u = x^4\text{,}\) but then \(du = 4x^3 \ dx\) and there is no factor of \(x^3\) in the integrand to allow us to complete this substitution. If we attempt to integrate by parts, then only option is to let \(u = sin(x^4)\) which makes \(du = 4x^3 \cos(x^4)\) and we only make the integral more complicated. This is one integral we cannot evaluate with the tools we have.

  5. We will try a \(u\)-substitution with \(u = x^4\text{,}\) because the integrand involves a composite function with \(x^4\) as the innermost function and because \(du = 4x^3 \, dx\) involves the factor \(x^3\) which is also present in the integrand. When we make this substitution we have \(x^3 \ dx = \frac{1}{4} \ du\) and the integral can be evaluated as follows:

    \begin{align*} \int x^3 \sin(x^4) \ dx &= \frac{1}{4} \int \sin(u) \ du\\ &= -\frac{1}{4} \cos(u) + C\\ &= -\frac{1}{4} \cos(x^4) + C\text{.} \end{align*}
  6. We will use integration by parts. Notice that

    \begin{equation*} \int x^7 \sin(x^4) \ dx = \int x^4 \left[x^3 \sin(x^4)\right] \ dx \end{equation*}

    and we have a factor we can differentiate (\(x^3\)) and one we can integrate (\(x^3 \sin(x^4)\)) (as we did in part (e)). So we let

    \begin{align*} u &= x^3, \ du = 3x^2 \ dx\\ dv & = x^3 \sin(x^4) \ dx , \ v = -\frac{1}{4} \cos(x^4) \end{align*}

    Integration by parts formula now gives

    \begin{equation*} \int x^7 \sin(x^4) \ dx = -\frac{1}{4} x^4 \cos(x^4) + \int x^3 \cos(x^4) \ dx\text{.} \end{equation*}

    This last integral is essentially the same as obtaining \(v\) from \(dv\text{,}\) so we will make the substitution \(z = x^4\) with \(dz = 4x^3 \ dx\text{.}\) Changing variables in the last integral gives us

    \begin{align*} \int x^7 \sin(x^4) \ dx &= -\frac{1}{4} x^4 \cos(x^4) + \int x^3 \cos(x^4) \ dx\\ &= -\frac{1}{4} x^4 \cos(x^4) + \frac{1}{4} \int \cos(z) \ dz\\ &= -\frac{1}{4} x^4 \cos(x^4) + \frac{1}{4} \sin(z) + C\\ &= -\frac{1}{4} x^4 \cos(x^4) + \frac{1}{4} \sin(x^4) + C\text{.} \end{align*}