Integration by Parts

We want to show you another technique for finding antiderivatives of more exotic functions. Remember that finding an antiderivative means undoing the process of differentiation. Since one tool we have for computing derivatives is the product rule, it makes sense to ask how we can undo the process of differentiating using the product rule. Integration by parts, the method we will describe here, is one way to answer that question.


The General Method

Let's remember what the product rule says:

\[ 
\frac{d}{dx}[f(x)g(x)] = f^\prime(x)g(x) + f(x)g^\prime(x) 
 \]

In other words, $  f(x)g(x)  $ is a function whose derivative is $  f^\prime(x)g(x) + f(x)g^\prime(x) $ and so it is an antiderivative for this function. That means that


\begin{eqnarray*} 
f(x)g(x) + C & = & \int [f^\prime(x)g(x) + f(x)g^\prime(x)]~dx \\ 
& = & \int f^\prime(x)g(x)~dx + \int f(x)g^\prime(x)~dx 
\end{eqnarray*}

We can rewrite this as

\[ 
\int f(x)g^\prime(x)~dx = f(x)g(x) - \int f^\prime(x)g(x)~dx 
 \]

This relationship is what we call Integration by Parts. Let's look at it more carefully and then see some examples. First, it asks us to break the integrand up into two pieces and identify one of the pieces, $  g^\prime(x)  $ , as the derivative of another function. In other words, we antidifferentiate a "part" of the integrand. The other part, $  f(x)  $ , is differentiated. The hope is that when you apply this, the new integral $  \int 
f^\prime(x)g(x)~dx  $ is simpler to antidifferentiate.


Examples

  1. $  \int x\cos x~dx $ .

    When you look at the integrand, it is clear that this does not easily fit onto our table of antiderivatives. We need a new trick. Let's break up the integrand so that

    
\begin{tabular}{cc} 
$f(x) = x$ & $g^\prime(x) = \cos x$ \\ 
$f^\prime(x) = 1$ & $g(x) = \sin x$ 
\end{tabular}

    Now if we apply the relationship for integration by parts, we have

    
\begin{eqnarray*} 
\int x\cos x~dx & = & x\sin x - \int \sin x~dx \\ 
& = & x\sin x + \cos x + C 
\end{eqnarray*}

    Remember that you can always check your result by differentiating. What happened here is that we could integrate part of the integrand---namely, $  \cos x  $ . The other part, x , became simpler when differentiated so that we could evaluate the new antiderivative.

    Just for the sake of comparison, let's see what would have happened had we broken up the integrand in a different way. Let

    
\begin{tabular}{cc} 
$f(x) = \cos x$ & $g^\prime(x) = x$ \\ 
$f^\prime(x) = -\sin x$ & $g(x) = \frac{x^2}2$ 
\end{tabular}

    Now we have

    \[ 
\int x\cos x ~dx = \frac{x^2}{2} \cos x + \frac 12\int x^2\sin x~dx 
 \]

    It's important to think about what went wrong. The new antiderivative which we need to find is no simpler than the one we found so we haven't made any progress in solving the problem.

  2. $  \int x^2 e^x ~dx  $

    You might think that the same trick will work for this antiderivative. Let's call

    
\begin{tabular}{cc} 
$f(x) = x^2$ & $g^\prime(x) = e^x$ \\ 
$f^\prime(x) = 2x$ & $g(x) = e^x$ 
\end{tabular}

    Now we have that

    \[  \int x^2 e^x~dx = x^2e^x-2\int xe^x~dx  \]

    The new integrand is a bit more simple: we can evaluate it by applying integration by parts one more time.

    
\begin{tabular}{cc} 
$f(x) = x$ & $g^\prime(x) = e^x$ \\ 
$f^\prime(x) = 1$ & $g(x) = e^x$ 
\end{tabular}

    This leads to

    
\begin{eqnarray*} 
\int x^2e^x~dx & = & x^2e^x -2[xe^x - \int e^x~dx] \\ 
& = & x^2e^x - 2xe^x + 2e^x + C 
\end{eqnarray*}

  3. $  \int \ln x~dx  $

    This seems a bit more confusing since it only looks like there is one "part" to the integration. However, the one part we do see would certainly be easier to deal with if differentiated. Here is the trick to use:

    
\begin{tabular}{cc} 
$f(x) = \ln x$ & $g^\prime(x) = 1$ \\ 
$f^\prime(x) = \frac 1x$ & $g(x) = x$ 
\end{tabular}

    Then it follows that

    \[  
\int \ln x~dx = x\ln x - \int \frac xx~dx = x\ln x - x + C 
 \]

  4. $  \int_0^1 \tan^{-1}x~dx  $

    Of course, integration by parts produces antiderivatives so it is useful for evaluating definite integrals. We will use the same trick that we just saw:

    
\begin{tabular}{cc} 
$f(x) = \tan^{-1}x$ & $g^\prime(x) = 1$ \\ 
$f^\prime(x) = \frac 1{1+x^2}$ & $g(x) = x$ 
\end{tabular}

    Now if we apply integration by parts

    
\begin{eqnarray*} 
\int_0^1 \tan^{-1} x ~dx & = & x\tan^{-1} x |_0^1 - \int_0^1 \frac x{1+x^2}~dx \\ 
& = & \tan^{-1}(1) - \frac 12 \int_1^2 \frac 1u~du \\ 
& = & \frac{\pi}{4} - \frac 12 \ln 2 
\end{eqnarray*}

    In evaluating this second integral, we used the substitution $ 
u = 1+x^2 $ .

  5. $  \int e^{ax}\cos(bx)~dx  $ where $  a,b  $ are constants.

    This is an important integrand: remember that sines and cosines represent periodic behaviour and that exponentials represent growth and decay. This integrand represents an oscillation where the amplitude is either growing or decaying and so this function is likely to appear sometime in your future.

    Let's apply integration by parts

    
\begin{tabular}{cc} 
$f(x) = e^{ax}$ & $g^\prime(x) = \cos(bx)$ \\ 
$f^\prime(x) = ae^{ax}$ & $g(x) = \frac 1b \sin(bx)$ 
\end{tabular}

    This leaves us with

    \[ 
\int e^{ax}\cos(bx)~dx = \frac 1b e^{ax}\sin(bx) - \frac ab\int e^{ax}\sin(bx)~dx 
 \]

    This might cause us to become discouraged since the new integrand looks so much like the old one but let's forge ahead in the same way.

    
\begin{tabular}{cc} 
$f(x) = e^{ax}$ & $g^\prime(x) = \sin(bx)$ \\ 
$f^\prime(x) = ae^{ax}$ & $g(x) = -\frac 1b \cos(bx)$ 
\end{tabular}

    Let's apply integration by parts again. Notice that we call the original integral I .

    
\begin{eqnarray*} 
I = \int e^{ax}\cos(bx)~dx & = & \frac 1b e^{ax}\sin(bx) - \frac ab\int e^{ax}\sin(bx)~dx \\ 
I = & = & \frac 1b e^{ax}\sin(bx) - \frac ab[-\frac 1b e^{ax}\cos(bx) 
+ \frac ab \int e^{ax}\cos(bx)~dx] \\ 
I = & = & \frac 1b e^{ax}\sin(bx) + \frac a{b^2} e^{ax}\cos(bx) + \frac {a^2}{b^2} I \\ 
(1 + \frac{a^2}{b^2}) I & = & \frac 1b e^{ax}\sin(bx) + \frac a{b^2} e^{ax}\cos(bx) \\ 
\frac{a^2+b^2}{b^2} I & = & \frac 1b e^{ax}\sin(bx) + \frac a{b^2} e^{ax}\cos(bx) \\ 
I & = & \frac a{a^2+b^2} e^{ax}\cos(bx) + \frac{b}{a^2+b^2} e^{ax}\sin(bx) +C 
\end{eqnarray*}

  6. Finally, we will show one more example which demonstrates a geometrical interpretation of the method of integration by parts.

    Suppose $  y=f(x)  $ is a function whose inverse is $  x = g(y) $ . We will apply integration by parts to the integral

    \[ 
\int_a^b f(x)~dx  \]

    by setting $  g^\prime(x) = 1  $ so that $  g(x) = x  $ . Now applying integration by parts gives

    \[ 
\int_a^b f(x) ~dx = xf(x)|_a^b - \int_a^b xf^\prime(x)~dx 
 \]

    Now if $  y = f(x)  $ , it follows from the Change of Variables formula that $  dy = f^\prime(x)~dx  $ . Remember also that $  x=g(y) 
 $ .

    
\begin{eqnarray*} 
&\int_a^b f(x) ~dx  =  xf(x)|_a^b - \int_a^b xf^\prime(x)~dx \\ 
& \int_a^b f(x)~dx = bf(b) - af(a) - \int_{f(a)}^{f(b)} g(y)~dy 
\end{eqnarray*}

    To understand this geometrically, we can study the diagram below. The integral $  \int_a^b f(x)~dx  $ represents the area under the curve as shown. The first term on the right hand side of the expression above is the area of the rectangle of width b and height f(b) . The area of a smaller rectangle of width a and height f(a) is subtracted away. Finally, the integral $ 
\int_{f(a)}^{f(b)} g(y)~dy 
 $ represents the area to the left of the curve. It is now clear why the relationship above holds.