Monday February 6, 2012
 

Integration by parts example (with u-substitution)

In some cases, integration by parts has to be used with another technique like u-substitution. For example lets do

int{}{}{x sin(2x) dx}

Its always a good idea to start out writing the integration by parts formula:

int{}{}{u dv}~=~uv~-~int{}{}{v du}

Since taking the derivative of x would just give 1, we’ll take that to be u. So

v ~=~int{}{}{ sin(2x) dx}

This integral must be done using u-substitution. Let’s go ahead and show the details for readers who aren’t sure how to proceed. Take

u~=~2x~doubleright~du = 2dx

Then we have, ignoring the constant of integration that we’ll tack on at the end of the problem

v ~=~{1/2}int{}{}{ sin(u) du}~=~-{1/2}cos(u)

Putting back the original variable

v ~=~-{1/2}cos(2x)

Now let’s put this result together with the integration by parts formula to solve the original problem. Now we have

int{}{}{x sin(2x) dx}~=~-{1/2}x cos(2x)~+~ {1/2}int{}{}{cos(2x) dx}

The last integral can be done using u-substitution again. We won’t go through the details this time. Adding the constant of integration it is

int{}{}{cos(2x) dx}~ =~{1/2}sin(2x)+C

So the answer is

int{}{}{x sin(2x) dx}~=~-{1/2}x cos(2x)~+~ {1/4}sin(2x)~+~C

Click this link to order calculus book with step-by-step solutions: calculus without limits

Integration by u-Substitution

Integration by u-substitution is a technique that helps us evaluate many integrals that can’t be done using elementary techniques. That is, we know that several “basic” integrals can be written down by inspection once you learn what the rules are. For example using the power rule you know that:

int{}{}{x^2 dx}  ~=~ {1/3}x^3 ~+~ C

But what if you had:

int{}{}{x (x^2+1)^50 dx}

This type of integral can’t be done using an elementary technique like the power rule. However, its easily done using u-substitution. The technique involves using a change of variable so that we can rewrite the integral in a form that can be done using elementary techniques. The new variable is called u. What you do is set u equal to whatever term in the integrand is keeping you from doing the calculation. In this case, we might make a guess that we could take

u~=~x^2 + 1

When we make a change of variable, we’ve got to find the new differential. So we take the derivative of this function:

du~=~d(x^2+1) = 2x dx

Notice that the integral already has an x in the integrand. Well let’s solve in terms of du

x dx ~=~{1/2} du

Now we can rewrite the integral in terms of the change of variables

int{}{}{x (x^2+1)^50 dx} ~=~{1/2}int{}{}{u^50 du}

Now we can do the calculation using the power rule

{1/2}int{}{}{u^50 du}~=~{1/2}{u^51/51}~+~C~={1/102}u^51~+~C

Finally, to get the answer, we just transform back to the original variable using

u~=~x^2 + 1

So

int{}{}{x (x^2+1)^50 dx}  ~=~{1/102}(x^2+1)^51~+~C

Want a book that solves calculus problems step-by-step? Visit calculus without limits

Integration by Parts with Trig Functions

Integration by parts can be used to integrate the product of a trig function with an exponential. For example, consider:

int{}{}{e^x sin(x) dx}

First let’s recall the integration by parts formula:

int{}{}{u dv}~=~uv~-~int{}{}{v du}

The trick is to pick u and v in such a way that

uv~-~int{}{}{v du}

is a simpler expression. In this case, try

u~=~e^x,~ dv~=~sin(x) dx

Then

v~=~int{}{}{sin(x) dx}~ =~ - cos(x)

(ignore constants of integration for now, we’ll add it at the end). And so

int{}{}{e^x sin(x) dx}  =  -e^x cos(x) +  int{}{}{e^x cos(x) dx}

It seems that we haven’t gotten anywhere. But we can apply integration by parts again on the second integral. We take

u = e^x,~ dv ~= cos(x) dx

Hence

int{}{}{e^x cos(x) dx}  = e^x sin(x) -  int{}{}{e^x sin(x) dx}

Putting everything together

int{}{}{e^x sin(x) dx}~ =~ -e^x cos(x)~ + ~ int{}{}{e^x cos(x) dx}

~~~=~  -e^x cos(x) ~+~ e^x sin(x) ~-~  int{}{}{e^x sin(x) dx}

Now add

int{}{}{e^x sin(x) dx}

To both sides. Then we find (making sure to add in the constant of integration)

int{}{}{e^x sin(x) dx} ~ =~ {1/2}e^x (sin(x) - cos(x)) ~+~C

Integration by Parts with the Natural Logarithm

Problems in calculus whether its the AP Calculus exam or second semester college calculus often involve integration by parts where one function is a natural logarithm. In this post I’m going to solve a problem out of my calculus book:

Let’s remind ourselves how to do integration by parts:

At first glance, we might be tempted to take:

But if we did that, we would be faced with the problem of finding:

So we’ve hit a wall. Instead, we will approach the problem by taking the natural logarithm to be u, and then we’ve got:

So the integral becomes:

Evaluating the integral we get the final result:

This example illustrates that the right choice of u and dv can save a bit of time and effort when solving integration by parts problems in calculus.

Want a book that solves calculus problems step-by-step? Visit calculus without limits

Computing calculus limits using L’Hopitals rule

The other day I was browsing my old calculus book and came across a limit often presented early in textbooks, sin(x) divided by x. Here is the limit:

Well its pretty easy to see this is a problematic expression. As x goes to 0 we have 0/0. If you’re just learning basic calculus, you’re probably at a loss as to what to do, because there isn’t really any algebraic manipulation that can be done to simplify the limit and get a quick answer.

So I’m reading in my calculus book about this and what do they do? Well they have 2 or 3 pages of convoluted discussion sure to give any math student a major headache. I read this stuff and think what on earth is the author thinking?

It turns out there are two approaches that make the computation of this limit easy. The first is to apply L’Hopitals rule. In this case we’ve got an improper form 0/0 so can take derivatives to get the answer in a flash:

Here’s another approach. Expand sin(x) in a Taylor series:

Now we can write:

From this, its clear that:

This example shows that having more information about mathematics than the teachers are willing to present to you, generally  makes things easier to compute. If it were up to me I would leave the example out of the textbook until you’ve got the tools to tackle it.

Need help solving calculus problems? Try Calculus without Limits

Calculus Limits Simplified

In first semester calculus, students often find limits confusing because when you substitute the value x is supposed to approach, you get nonsense like 0/0 or infinity. There is, however, an approach that can get calculus limits simplified into expressions where all you have to do is plug in the value of x given to get your answer. In beginning calculus this usually involves some sort of simple algebraic manipulation.

Let’s consider an example. Look at:

Notice that if we simply set x =1 we are in trouble, because that just gives us 0/0. So ask yourself, is there a way to rewrite the numerator and/or denominator so that this limit can be easily calculated? There is. First notice that:

We can also write:

This is great because now we can express the limit in the following way:

Now we’ve got something that’s easy to evaluate. Just set x = 1 and we have the answer:

As you get into more advanced calculus, you will see that a technique called L’Hopital’s rule allows you to handle limits like this in a more sophisticated way. But for now, isn’t it interesting that you have to use your algebraic skills to do calculus?

Integration by Parts

Students taking second semester calculus soon face a dreaded technique called “integration by parts”. The mere mention of the term might strike fear in your heart, but take a deep breath because the truth is its easier than you might think.

So what is it for? If you’re at this stage in calculus then you know that there are a set of functions that can be integrated by inspection. And you also know that there are other functions that can be easily transformed so that they can be integrated by inspection using a change of variables technique called u-substitution. Integration by parts tackles another problem: what if you have a product of two functions? Often, when you’re integrating the product of two functions this is not going to give you a situation where you can just write down the answer using the basic rules for integration or by a substitution technique. Integration by parts allows us to transform the problem into something we can solve more easily by looking at the integrand as the product of a function and the derivative of a second function. By transferring or moving the derivative from that function to the other one, we can write down an integral that can be done more easily. The formula is usually presented this way:

While this is accurate enough, once I was reading a physics book, Quantum Mechanics by a David Griffiths, and he wrote the formula for integration by parts this way:

This is a better way to write it down. Integration by parts is based on the product rule for derivatives, (fg)’=f’g+g’f, and you can see that clearly here. Also it makes it clear how to rewrite the integral on the left hand side, which is what you’re presented with in problems. This might all seem a bit mysterious at this point so lets do an example. Consider:

This integral can’t be done using any of the basic rules. In other words we can’t use the power rule. We can’t integrate the exponential because its multiplied by x, and we can’t use substitution because if we said u = 2 x, we would have du = 2dx, but that extra x in the integrand messes things up once again. Since the integrand can be viewed as the product of two functions, integration by parts is the way to tackle it.

The way to tackle it is to look and see which function to take as f, and see if its simplified by taking its derivative. Sometimes that isn’t immediately obvious, but in this case we can take:

Obviously we would get a simpler integral in this case by using this definition. So now we proceed by finding g:

This integral can be done by using substitution. We take:

And then:

Refreshing our memory, the integration by parts formula tells us that

Putting this together with our calculations we’ve done above, we get:

The second integral, on the right hand side, is easy to do:

Hence:

That’s all there is to it. In your calculus homework you’re going to start off with a few problems like this one. Do these over and over until it becomes automatic. After that, they will present you with some integrals that are a little more tricky, but the idea-applying the product rule of derivatives-is the same. In future posts we’ll show you how to do integration by parts on some more difficult integrals.

Need more help? Consider Calculus without Limits.

Computing Limits

September is around the corner and that means calculus students the world over are getting ready to tackle limits! For many students, computing limits is their first introduction to the more grown up world of calculus, as compared to the way they’ve been doing math so far. Limits seem mysterious and you may even think there is no way you’ll pass calculus.

But I’m here to tell you that limits are actually a very simple idea. Before you get bogged down into really understanding what they’re about and all those epsilon-delta proofs, chances are you just want to be able to calculate some. After all unless you’re a math major that is 95% of what you need to do in order to get through calculus. That’s the good news. Because in reality, doing limits just involves doing a little trick here and there to rewrite whatever problem they’ve given you and then plug and chug some numbers. Let’s take an example.

The first limits you face are probably going to involve some kind of quotient, like:

What happens if you just plug in x =2? Well you get 0/0, which at this point in your calculus career is a meaningless statement. So what is the trick to doing this limit? If you’ve passed algebra you’ll be pleasantly surprised: all we have to do is factor the numerator. Notice:

When you rewrite the numerator this way, the limit becomes:

Now we can cancel the term in the denominator, leaving a simple expression where we can plug in x = 2 to compute the limit:

That’s all there is to it. Nothing mysterious, and not a word about epsilon or delta or approaching this or approaching that. Next time, we’ll take a look at some more limits that look hard to compute at first glance but are really quite simple.

For more examples of calculus homework, check out my ebook Calculus without Limits.