# Tricky integration by parts question

1. Apr 7, 2010

### thomas49th

1. The problem statement, all variables and given/known data
Find $$\int^{1}_{0} (x^{2} - 3x + 1)e^{x} dx$$

2. Relevant equations

Let $$f =(x^{2} - 3x + 1)$$
[tex g = e^{x}[/tex]
$$f' = 2x - 3$$
$$\int (g) dx = e^{x}$$

3. The attempt at a solution

We are going to have to use intergation by parts twice as the degree of the first function (f) is 2.

Important The question asks me to integrate between the limits 0 and 1. However is this asking me to find the area under the curve? I ask this because if I graph the functions' product, I am integrating above and below the x axis. Now if I was finding the area (which cannot be negative) it means I will have to integrate between the limits twice: 0 to 0.3458 and 0.3458 and 1, taking the modulus of the latter and adding them together. A glance at the question's answer shows the answer to be negative, telling me they weren't bothered about the finding the actual area, merely the summation of the area between the limits 0 and 1. Is there a SET RULE for knowing when to integrate in chunks depending on the x axis to find the real world area and when to integrate without the worry of integrating between roots

Anyway back to my question. I am going to not bother to worry about the the graph crossing below the x axis, and integrate as a whole

First part of the integral:

$$(x^{2} - 3x + 1)e^{x} - \int^{1}_{0}(2x -3)e^{x}dx$$

again,

$$(x^{2} - 3x + 1)e^{x} - (2x -3)e^{x} -2\int^{1}_{0}e^{x}dx$$

gives

$$[(x^{2} - 3x + 1)e^{x} - (2x -3)e^{x} -2e^{x}]^{1}_{0}$$

Putting the limits in yields

-2 -2e

when the answer is apparently -0.5634

Can anybody spot where I've gone wrong?

Thanks
Thomas

2. Apr 7, 2010

### Bohrok

When you did integration by parts the second time, you forgot to distribute the negative to the integral -2∫ex dx. Make that positive and you'll get the right answer.

3. Apr 8, 2010

### thomas49th

silly silly me :) I get the answer now

Thanks
Thomas

4. Apr 8, 2010

### Staff: Mentor

The given definite integral is just an integral, so just find the antiderivative and evaluate at the two endpoints. If the problem asks you to find the area between the curve and the x-axis, then you'll need to be concerned about where the function being integrated crosses the horizontal axis. For example, $\int_0^{2\pi} sin(x) dx = 0$, but if you want the area between the curve and the x-axis, you need to set up two integrals, one between 0 and pi, and the other between pi and 2pi. The two integrals will look like this:
$$\int_0^{\pi} (sin(x) - 0)dx + \int_{\pi}^{2\pi} (0 - sin(x))dx$$

In each integral above I have included more than I need to, but only to make a point; namely, that the typical area element's height must be measured so as to give a positive length.

5. Apr 8, 2010

### Staff: Mentor

Oh, I also meant to add that it's probably easier to split your original integral into three separate integrals. One of them will require integration by parts twice, another one application of integration by parts, and the last is simple. It's a lot easier to do integration by parts on x^2e^x than it is (x^2 -3x +1)e^x.

6. Apr 8, 2010

### thomas49th

@ Mark44 I guess I'll need to make sure I read the question properly.

Good idea, though I'm lazy when it comes to summing lots of define integral bits because you have to put those stupid limits in everyone and add them up, BUT it pays to break it down into easier, yet slower chunks

Thanks
Thomas