Lecture 3: Integration by Parts (Stewart 7.1) Rahul Krishna

1

Review of Last Time

Recall what we did yesterday: we ran the Chain Rule backwards. By integrating the Chain Rule, we arrived at an identity Z f 0 (g (x)) g 0 (x) dx = f (g (x)) + C

Which we interpreted as a method–Integration by Substitution. The gist of the method was something like this: when confronted with an integral where the integrand can be written as the product of two functions, one of which is (can be made to look like) a derivative, then if conditions are right, (this means if the other function is actually a function of the anti-derivative of the …rst one–man that’s a confusing sentence.) we should try to interpret the integral as a reverse chain rule. The best way to see how the method works is to see it in action, which we did plenty of last time, and will do plenty of today. You should keep in mind that this sort of method, while it looks like an algorithm of some sort, really isn’t. In order to use this technique properly, you often need some clever insight. [The interpretation of the Chain Rule as a reparameterization. One example, done in many ways: look 2 2 at the function f (x) = x2 ; f (2x) = (2x) ; and f x3 = x3 . Explain what the derivative is doing in the integral formulation of integration by parts. Rewrite formula above as Z f 0 (g) dg = f (g) + C

dg dx is the new scaled area element. Problem yesterday–the example I did was too hard to where dg = dx visualize. OOPS.]

2

Running the Product Rule Backwards

Yesterday we ran the Chain Rule backwards. Today, we do the same for the Product Rule. Recall what it says: d (u (x) v (x)) = u0 (x) v (x) + u (x) v 0 (x) dx We can move this around to get u (x) v 0 (x) =

d (u (x) v (x)) dx

and integrating both sides, we get Z u (x) v 0 (x) dx = u (x) v (x)

v (x) u0 (x)

Z

v (x) u0 (x) dx

If we adopt the notation used above of scaled area elements, i.e. writing f 0 (x) dx = df; then this can written succinctly as Z Z udv = uv

vdu

There is also a form for de…nite integrals, which is exactly what you think it is Z b Z b b udv = (uv)a vdu a

a

1

This is because the above formula gives a way to write down anti-derivatives, and the limits follow from Version II of the Fundamental Theorem. Intitially, it might seem like Integration by Parts and Integration by Substitution are techniques that apply to the same situation: when we are given an integrand which is a product of two functions f (x) g 0 (x), one of which is obviously a derivative some other function (g 0 (x) is the derivative of g (x), duh!). But Integration by Substitution only applies when you can write f (x) as a function of g (x) : However, when it does work, you are done–you can actually evaluate the original integral. Integration by Parts will always R apply in this situation. The only problem is what’s on the right hand side of the equation, namely uv vdu has an integral in it! So sometimes the integral you get as a result of applying Integration by Parts is too hard to evaluate, or itself requires an integration by parts (hopefully in the correct direction–I’ll explain that comment in an example), in which case we would be stuck. Still, it’s an incredibly powerful technique, and actually underlies a whole sea of very interesting math. Example 1 Evaluate

Z

x sin xdx

We take u = x; dv = sin xdx Thus v can be taken to be v = cos x and du = dx: We apply Parts to get Z Z x sin xdx = udv Z = uv vdu Z = x ( cos x) ( cos x) dx Z = x cos x + cos xdx = x cos x + sin x + C Let’s check it

d ( x cos x + sin x) = dx

cos x + x sin x + cos x = x sin x

It worked! Example 2 (Related) Let’s try a worse looking polynomial next to a trigonometric function. We will try to integrate Z x2 + 2x 1 cos xdx Take u = x2 + 2x

1; dv = cos xdx; v = sin x; du = 2x + 2: So we get Z Z 2 2 x + 2x 1 cos xdx = x + 2x 1 sin x (2x + 2) sin xdx

Crap! How do we deal with this integral on the right? Well, we integrate by parts again: taking, for the integral below, u = 2x + 2; dv = sin xdx; we have v = cos x and du = 2dx; so Z Z (2x + 2) sin xdx = (2x + 2) ( cos x) 2 ( cos x) dx Z = (2x + 2) cos x + 2 cos xdx = (2x + 2) cos x + 2 sin x + C So we have, in total x2 + 2x

1 cos xdx = x2 + 2x 2

= x + 2x

1 sin x

[ (2x + 2) cos x + 2 sin x] + C

1 sin x + (2x + 2) cos x 2

2 sin x + C

Let’s check it d x2 + 2x 1 sin x + (2x + 2) cos x 2 sin x dx = (2x + 2) sin x + x2 + 2x 1 cos x + 2 cos x (2x + 2) sin x 2

= x + 2x

2 cos x

1 cos x

It worked! Note that in the calculation above, we were careful not to go backwards. What do I mean? Well, let’s do the Integration by Parts again, but let’s do it incorrectly. R 2 Example 3 (Don’t do this!!!!) We were calculating x + 2x 1 cos xdx; and had used Integratation by Parts once to get Z Z x2 + 2x 1 cos xdx = x2 + 2x 1 sin x (2x + 2) sin xdx

R So we need to use Parts on (2x + 2) sin xdx to try and evaluate this. What if we took u = sin x and dv = (2x + 2) dx; so v = x2 + 2x and du = cos xdx: Then we get Z Z (2x + 2) sin xdx = x2 + 2x sin x x2 + 2x cos xdx

Wow, this doesn’t help at all! Not only do we still have an awful integral to evaluate, but it’s e¤ ectively the same as the integral we started with. In fact, in total we have Z Z x2 + 2x sin x x2 + 2x cos xdx x2 + 2x 1 cos xdx = x2 + 2x 1 sin x Z = sin x + x2 + 2x cos xdx while R 2 this equality is true, it doesn’t help, does it? It’s essentially the equality x + 2x 1 cos xdx:

R

x2 + 2x

1 cos xdx =

How can we keep track of which direction is forwards? Well, in the example above, we have a polynomial times a trig function. A trick to remember: always di¤erentiate a polynomial away if you can. Time for some more fun examples.

3 3.1

Examples Polynomials Times Sines and Cosines

This class of examples we’ve already essentially dealt with. We were integrating functions of the form p (x) sin x; p (x) cos x where p (x) is a polynomial in x: Why were these tractable integrals? Well, integrating sin x gives cos x and integrating cos x gives sin x: Therefore, if we use integration by parts on something looking like p (x) sin ax or p (x) cos ax; we will get Z Z 1 1 cos ax p0 (x) ( cos ax) dx p (x) sin axdx = p (x) a a Z Z 1 1 p (x) cos ax = p (x) sin ax p0 (x) sin xdx a a

Now, the integrals on the right hand side are polynomials times sin ax or cos ax; but have degree one less. So if you continue until we’re only left with constants times sin ax or cos ax; then we are done! That means if you come across and integral like this, even if p (x) has some huge degree, at least you know you could integrate it (better yet, you could program a compute to integrate it) even though it might take an absurd number of integrations by parts to get the answer. 3

3.2

Polynomials Times Exponentials

This is almost the same as the previous class of examples. Let me do one: you guys will get the general technique from following Example 4

Z

x3 ex dx

We take u = x3 ; dv = ex dx; v = ex ; du = 3x2 dx to get Z Z x3 ex dx = x3 ex 3x2 ex dx Z = x3 ex 3x2 ex 6xex dx Z 3 x 2 x x =x e 3x e + 6xe 6ex dx = x3

3x2 + 6x

6 ex + C

The problem set will have you derive a formula for a (slightly) more general version of this.

3.3

Sines and Cosines Times Exponentials

Let’s do an example. Example 5

Z

ex sin xdx

This looks hopeless! We don’t have a polynomials, and we know integrating or di¤ erentiating ex and sin x does practically nothing. Still, we soldier on, and compute, for u = ex ; dv = sin xdx; v = cos x; du = ex dx; that Z Z ex sin xdx = ex cos x + ex cos xdx Now, for

R

ex cos xdx; we take u = ex ; dv = cos xdx; v = sin x; du = ex dx: Then Z Z ex cos xdx = ex sin x ex sin xdx

In total, we have the equation Z

x

e sin xdx =

so 2

Z

x

x

e cos x + e sin x

ex sin xdx = ex (sin x

and thus, adding the constant of integration Z 1 ex sin xdx = ex (sin x 2

Z

ex sin xdx

cos x)

cos x) + C

What just happened? We used integration by parts to get a recursion relation. This class of examples can be pretty tricky, but on Monday I’ll give you a way to solve these integrals that (I think) is easier. 4

3.4

Polynomials in Trigonometric Functions

Example 6

Z

sin2 xdx

We’re going to do this two ways. First, by parts, taking u = sin x; dv = sin xdx; v = to get Z Z sin2 xdx = sin x cos x + cos2 xdx Now, using that sin2 x + cos2 x = 1; we have Z sin2 xdx = so

Z

Z

sin x cos x +

sin2 xdx =

cos x; du = cos xdx;

sin2 xdx

1

1 ( sin x cos x + x) + C 2

Second, we can use some trig identities. We know cos 2x = cos2 x sin2 x = 1 This gives Z Z 1 (1 cos 2x) dx sin2 xdx = 2 1 1 x sin 2x + C = 2 2

2 sin2 x; so sin2 x =

1 cos 2x : 2

since sin 2x = 2 sin x cos x; this is the same answer. The general method proceeds in two possible ways. First, use reduction formulas (see the book p. 467 for the formula, applicable when n 2; Z Z 1 n 1 n n 1 sin xdx = cos x sin x+ sinn 2 xdx n n which is nothing more than integration by parts) to get your exponents down to something manageable. Second, you can use trig identities to reduce exponenets. On Monday I will give you a fast and easy way to do this method. For now, though, just try to use standard trig identities and methods to do problems.

3.5

The Invisible dv

There’s another trick. As always, let me illustrate it with an example. Example 7

Take u = ln x; dv = dx; v = x; du =

dx x :

Z

ln xdx

Then Z ln xdx = x ln x = x ln x

Z

dx x x+C x

Wow, that works! d (x ln x dx

x) = ln x + x

5

1 x

1 = ln x

It’s pretty clear why we call it the invisible dv; since the trick consists of taking dv to simply be dx: Let’s do another example: Example 8

Take u = tan

1

x; dv = dx; v = x; du = Z

tan

1

1 1+x2 :

Z

1

tan

xdx

Then

xdx = x tan

1

x

= x tan

1

x

OK, that’s enough integrating for now.

6

Z

x 1 + x2

1 ln 1 + x2 dx 2