Integration By Parts

Quiz next Friday
Today: 7.1: integration by parts
Next: 7.2: trigonometric integrals and supplement 2-functions with complex values
Exams: Average 19.68 (out of 34).
Tetrahedron problem:

$\displaystyle \int_{0}^h \frac{1}{2}
\left(-\frac{b}{h}x + b\right) \left(-\frac{a}{h} x + a\right) dx
= \dots = \frac{abh}{6}.

(The function that gives the base of the triangle cross section is a linear function that is $ b$ at $ x=0$ and 0 at $ x=h$, which allows you to easily determine it without thinking about geometry.)

Differentiation Integration
Chain Rule Substitution
Product Rule Integration by Parts

The product rule is that

$\displaystyle \frac{d}{dx}\left[ f(x) g(x)\right] = f(x) g'(x) + f'(x) g(x).

Integrating both sides leads to a new fundamental technique for integration:

$\displaystyle f(x)g(x) = \int f(x) g'(x)dx + \int g(x) f'(x) dx.$ (5.1)

Now rewrite (5.1.1) as

$\displaystyle \int f(x) g'(x) dx = f(x)g(x) - \int g(x) f'(x) dx.

Shorthand notation:

$\displaystyle u$ $\displaystyle = f(x)$ $\displaystyle du$ $\displaystyle = f'(x)dx$    
$\displaystyle v$ $\displaystyle = g(x)$ $\displaystyle dv$ $\displaystyle = g'(x)dx$    

Then have

$\displaystyle \int u dv = uv - \int v du.

So what! But what's the big deal? Integration by parts is a fundamental technique of integration. It is also a key step in the proof of many theorems in calculus.

Example 5.1.1   $ \int x \cos(x) dx$.

$\displaystyle u$ $\displaystyle = x$ $\displaystyle v$ $\displaystyle = \sin(x)$    
$\displaystyle du$ $\displaystyle = dx$ $\displaystyle dv$ $\displaystyle = \cos(x)dx$    

We get

$\displaystyle \int x \cos(x) dx
= x\sin(x) - \int \sin(x) dx
= x\sin(x) + \cos(x) + c.

``Did this do anything for us?'' Indeed, it did.

Wait a minute--how did we know to pick $ u=x$ and $ v=\sin(x)$? We could have picked them other way around and still written down true statements. Let's try that:

$\displaystyle u$ $\displaystyle = \cos(x)$ $\displaystyle v$ $\displaystyle = \frac{1}{2}x^2$    
$\displaystyle du$ $\displaystyle = -\sin(x) dx$ $\displaystyle dv$ $\displaystyle = xdx$    

$\displaystyle \int x \cos(x) dx
= \frac{1}{2} x \cos(x) + \int \frac{1}{2}x^2 \sin(x) dx.

Did this help!? NO. Integrating $ x^2\sin(x)$ is harder than integrating $ x\cos(x)$. This formula is completely correct, but is hampered by being useless in this case. So how do you pick them?
Choose the $ u$ so that when you differentiate it you get something simpler; when you pick $ dv$, try to choose something whose antiderivative is simpler.
Sometimes you have to try more than once. But with a good eraser nodoby will know that it took you two tries.

Question 5.1.2   If integration by parts once is good, then sometimes twice is even better? Yes, in some examples (see Example 5.1.5). But in the above example, you just undo what you did and basically end up where you started, or you get something even worse.

Example 5.1.3   Compute $ \displaystyle \int_0^{\frac{1}{2}} \sin^{-1}(x) dx.$ Two points:
  1. It's a definite integral.
  2. There is only one function; would you think to do integration by parts? But it is a product; it just doesn't look like it at first glance.

Your choice is made for you, since we'd be back where we started if we put $ dv = \sin^{-1}(x)dx$.

$\displaystyle u$ $\displaystyle = \sin^{-1}(x)$ $\displaystyle v$ $\displaystyle = x$    
$\displaystyle du$ $\displaystyle = \frac{1}{\sqrt{1-x^2}}$ $\displaystyle dv$ $\displaystyle = dx$    

We get

$\displaystyle \int_0^{\frac{1}{2}} \sin^{-1}(x) dx
= \left[x\sin^{-1}(x)\right]_0^{\frac{1}{2}}
- \int_0^{\frac{1}{2}} \frac{x}{\sqrt{1-x^2}} dx.

Now we use substitution with $ w=1-x^2$, $ dw = -2xdx$, hence $ xdx = -\frac{1}{2} dw$.

$\displaystyle \int_0^{\frac{1}{2}} \frac{x}{\sqrt{1-x^2}} dx
= -\frac{1}{2} \int w^{-\frac{1}{2}} dw
= -w^{\frac{1}{2}} + c = -\sqrt{1-x^2} + c.


$\displaystyle \int_0^{\frac{1}{2}} \sin^{-1}(x) dx
= \left[x\sin^{-1}(x)\right]...
... \sqrt{1-x^2}\right]^{\frac{1}{2}}_0
= \frac{\pi}{12} + \frac{\sqrt{3}}{2} - 1

But shouldn't we change the limits because we did a substitution? (No, since we computed the indefinite integral and put it back; this time we did the other option.)

Is there another way to do this? I don't know. But for any integral, there might be several different techniques. If you can think of any other way to guess an antiderivative, do it; you can always differentiate as a check.

Note: Integration by parts is tailored toward doing indefinite integrals.

Example 5.1.4   This example illustrates how to use integration by parts twice. We compute

$\displaystyle \int x^2 e^{-2x} dx

$\displaystyle u$ $\displaystyle = x^2$ $\displaystyle v$ $\displaystyle = -\frac{1}{2} e^{-2x}$    
$\displaystyle du$ $\displaystyle = 2x dx$ $\displaystyle dv$ $\displaystyle = e^{-2x}dx$    

We have

$\displaystyle \int x^2 e^{-2x} dx
= -\frac{1}{2}x^2 e^{-2x} + \int x e^{-2x} dx.

Did this help? It helped, but it did not finish the integral off. However, we can deal with the remaining integral, again using integration by parts. If you do it twice, you what to keep going in the same direction. Do not switch your choice, or you'll undo what you just did.

$\displaystyle u$ $\displaystyle = x$ $\displaystyle v$ $\displaystyle = -\frac{1}{2} e^{-2x}$    
$\displaystyle du$ $\displaystyle = dx$ $\displaystyle dv$ $\displaystyle = e^{-2x}dx$    

$\displaystyle \int x e^{-2x} dx =
- \frac{1}{2} x e^{-2x}
+ \frac{1}{2} \int e^{-2x}dx
- \frac{1}{2} x e^{-2x}
- \frac{1}{4} e^{-2x} + c.

Now putting this above, we have

$\displaystyle \int x^2 e^{-2x} dx
= -\frac{1}{2}x^2 e^{-2x}
- \frac{1}{2} x e^{-2x}
- \frac{1}{4} e^{-2x} + c
= -\frac{1}{4} e^{-2x}(2x^2 + 2x + 1) + c.

Do you think you might have to do integration by parts three times? What if it were $ \int x^3 e^{-2x} dx$? Grrr - you'd have to do it three times.

Example 5.1.5   Compute $ \displaystyle \int e^x \cos(x) dx$. Which should be $ u$ and which should be $ v$? Taking the derivatives of each type of function does not change the type. As a practical matter, it doesn't matter. Which would you prefer to find the antiderivative of? (Both choices work, as long as you keep going in the same direction when you do the second step.)

$\displaystyle u$ $\displaystyle = \cos(x)$ $\displaystyle v$ $\displaystyle = e^x$    
$\displaystyle du$ $\displaystyle = -\sin(x) dx$ $\displaystyle dv$ $\displaystyle = e^xdx$    

We get

$\displaystyle \int e^x \cos(x) dx
= e^x \cos(x) + \int e^x \sin(x) dx.

We have to do it again. This time we choose (going in the same direction):

$\displaystyle u$ $\displaystyle = \sin(x)$ $\displaystyle v$ $\displaystyle = e^x$    
$\displaystyle du$ $\displaystyle = \cos(x)dx$ $\displaystyle dv$ $\displaystyle = e^xdx$    

We get

$\displaystyle \int e^x \cos(x) dx
= e^x \cos(x) + e^x \sin(x) - \int e^x \cos(x) dx.

Did we get anywhere? Yes! No! First impression: all this work, and we're back where we started from! Yuck. Clearly we don't want to integrate by parts yet again. BUT. Notice the minus sign in front of $ \int e^x \cos(x) dx$; You can add the integral to both sides and get

$\displaystyle 2 \int e^x \cos(dx) = e^x \cos(x) + e^x \sin(x) + c.


$\displaystyle \int e^x \cos(dx) = \frac{1}{2} e^x (\cos(x) + \sin(x)) + c.

William Stein 2006-03-15