If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Integration by parts: ∫x²⋅𝑒ˣdx

AP.CALC:
FUN‑6 (EU)
,
FUN‑6.E (LO)
,
FUN‑6.E.1 (EK)
Worked example of finding an indefinite integral where integration by parts is applied twice. Created by Sal Khan.

## Want to join the conversation?

• At the last step , could we also express this as e^x(x^2-2x+2)+c ?
ty
• Yes, and I think it would be even better !
• At he takes the anti-derivative of e^x. Wouldn't the anti-derivative be e^x + c?

If that is the case, does that mean you would multiply the constant by 2 if you substitute it back in?
• This is a point that many students get hung up on. Does multiplying the arbitrary constant change that constant? Sal has mentioned many times in other videos that this is not the case.
Multiplying an arbitrary constant by some number just yields another arbitrary constant. If you had kept with the convention of 2*c, you would solve for c (if you had an initial condition) and plugged it in. If I had replaced 2*c with another constant, c_0, my value for c_0 would just end up being twice your value. Personally, I do away with the c_0 because an arbitrary constant is just an arbitrary constant.
Another point, performing any operation on an arbitrary constant just yields another arbitrary constant. Addition, subtraction, exponentiation...
• So what happens if someone does the wrong assignment to f(x) and g'(x) from the beginning ?? I tried it from myself and I got a pretty wacky result : e^x(x^5/60 - x^4/12 + x^3/3). Is it true that if you do the wrong assignment you'll get the wrong result?
• yep, most of the time you end up wasting your time getting nowhere.
Use LIPET to choose the u part of the substitution. (the other factor is the dv)
Logarithms
Inverse Trigs
Polynomials
Exponentials
Trig
TRUST in LIPET it will save many a headache from happening.
It's right up there with PEMDAS and SOHCAHTOA
• what would you do if e^x had a number and a power with it e.g. 5e^3x?
• Then you would use the chain rule and take the derivative of 3x and then multiply that by e^3x and then just multiply that all by 5 since it's just a constant.
• Stupid question: Why can't I just make it like this:
Antiderivative of x^2 = x^3/3
Antiderivative of e^x = e^x
Therefore the antiderivative of x^2*e^x is x^3/3*e^x
• You cannot do that because the integral of a product is not equal to the product of the individual integrals.
• Hi, how do i solve for the integral of e^(x^2)dx? I've been stuck for some time now.
• That is an advanced-level integral: it cannot be solved by ordinary integration methods taught in an introductory integral calculus course. The answer involves non-elementary functions, specifically it involves the imaginary error function.

I have only a passing knowledge of this, so I will leave it to a professional mathematician to show you how to reach the answer. But, I thought it good to let you know this problem cannot be solved by ordinary integration methods.
• Integration by parts of (x^2)*(e^-x^2/2) where by the upper limit of the integral is infinity and lower limit is 0
• This was a struggle but I think I might have got it.

I used integration by parts and separated the integral to
x * (x * e^-x^2/2)

Then I got stuck when that creates the integral of e^-x^2/2
but apparently this is almost equal to "erf" (something I never heard of before!)
erf(x) = 2/sprt(pi) integral(e^-t^2)

By making that substitution I got the result of the integral:
-xe^-x^2/2 + sqrt(2)/2*pi*erf(sqrt(2)/2 * x)

Evaluating the bounds the first part -xe^-x^2/2
evaluates to 0 for both 0 and infiniti so ignore it.

Then I learned that
erf(0) = 0
erf(infiniti) = 1

sqrt(2)/2 * pi
(1 vote)
• Why is the anti-derivative of x^2 2x? I thought that it would be (x^3)/3 because of the form (x^n+1)/n+1.
• It was just a small confusion at . He meant the derivative of x^2.
• when he takes the two out front of the integral at , do you have to do that to get the correct answer or does hat just make things easier?
• It makes things easier since you would not have to factor it out in the end after taking the integration.
• Just a random thought. The symbol of integration has a shape of squeezed in width, and stretched in height S since it stands for sum, doesn't it? And the "dx" at the end indicates that we're multiplying the infinite amount of rectangles which approximate the height of the curve at the respective points by the infinitely small change in our independent variable, which represents the base of these rectangles, right? What is the point of evaluating a sum of the rectangles multiplied by their base in no specific interval? And why calling that sum as an anti-derivative? It doesn't make any sense to me ... . The anti-derivative is a function, which has nothing to do with the sum. I understand it might be a convention, but ... isn't it quite a misleading one?
• You are not "evaluating a sum of the rectangles multiplied by their base" the base is dx. The section on Riemann sums and taking their limit as Δx→0 covers all this. When Δx is infinitesimal, it is called dx.

The fundamental theorem of calculus shows you why it is called the anti-derivative. The anti-derivative is the inverse of the derivative. Say you integrate a function f, and call that result F. If you then take the derivative of F you get back f. The FToC says it more formally this way:

Given a continuous function, f, on an open interval I with α being any point in I,
IF you define F as:
F = ∫f(t)dt from α to x
THEN
F'(x) = f(x)

It doesn't get much clearer or obvious than that as to the relationship between the derivative and anti-derivative (that is, that the derivative of the anti-derivative of f gets you back your original f).

## Video transcript

Let's see if we can take the antiderivative of x squared times e to the x dx. Now, the key is to recognize when you can at least attempt to use integration by parts. And it might be a little bit obvious, because this video is about integration by parts. But the clue that integration by parts may be applicable is to say, look, I've got a function that's the product of two other functions-- in this case, x squared and e to the x. And integration by parts can be useful is if I can take the derivative of one of them and it becomes simpler. And if I take the antiderivative of the other one, it becomes no more complicated. So in this case, if I were to take the antiderivative of x squared, it does become simpler. It becomes 2x. And if I take the antiderivative of e to the x, it doesn't become any more complicated. So let's assign f of x to be equal to x squared. And we want that one to be the one where if I take the derivative it becomes simpler. Because I'm going to have to take the derivative of f of x right over here in the integration by parts formula. And let's assign g prime of x to be equal to e to the x. Because later, I'm going to have to take its antiderivative, and the antiderivative of e to the x is still just e to the x. So let me write this down. So we are saying that f of x-- I'll do it right over here-- f of x is equal to x squared, in which case f prime of x is going to be equal to 2x. And I'm not worrying about the constants right now. We'll just add a constant at the end to make sure that our antiderivative is in the most general form. And then g prime of x is equal to e to the x, which means its antiderivative, g of x, is still equal to e to the x. And now we're ready to apply the right-hand side right over here. So all this thing right over here is going to be equal to f of x, which is x squared-- and let me put it right underneath-- x squared times g of x, which is e to the x, minus. Let me do that in that yellow color. I want to make the colors match up-- minus the antiderivative of f prime of x. Well, f prime of x is 2x, times g of x. g of x is e to the x dx. So you might say, hey, Sal, we're left with another antiderivative, another indefinite integral right over here. How do we solve this one? And as you might guess, the key might be integration by parts again. And we're making progress. This right over here is a simpler expression than this. Notice we were able to reduce the degree of this x squared. It now is just a 2x. And what we can do to simplify this a little bit. Since 2 is just a scalar-- it's a constant, it's multiplying the function-- we can take that out of the integral sign. So let's take it this way. So let me rewrite it this way. We can only do that with a constant that's multiplying the function. So let me put the 2 right out here. And so now what we're concerned about is finding the integral-- let me write it right over here-- the integral of xe to the x dx. And this is another integration by parts problem. And so let's again apply the same principles of integration by parts. What, when I take its derivative, is going to get simpler? Well, x is going to get simpler when I take its derivative. So now, for the purposes of integration by parts, let's redefine f of x to be equal to just x. And then we can still have g prime of x equaling e to the x. And so in this case, let me write it all down. f of x is equal to x. f prime of x is equal to 1. g prime of x is equal to e to the x. g of x, just the antiderivative of this, is equal to e to the x. So let's apply integration by parts again. So this is going to be equal to f of x times g of x. Now f of x is x. g of x is e to the x, minus the antiderivative of f prime of x-- well, that's just 1-- times g of x-- e to the x. It's just 1 times e to the x dx. And remember, all I'm doing right now-- you might have lost track of things-- I'm just focused on this antiderivative. That antiderivative is that antiderivative there. If we can figure out what it is, we can then substitute back into our original expression. Now, you might appreciate integration by parts. What does this right over here simplify to? What is the antiderivative of 1 times e to the x dx? Or what is the antiderivative of 1 times e to the x? Well, it's just the antiderivative of e to the x, which is just e to the x. So this simplifies to x times e to the x minus the antiderivative of e to the x, which is just e to the x, so minus e to the x. And then we can take this and substitute it back. This is the antiderivative of this. So we can substitute it back up here to figure out the antiderivative of our original expression. So the antiderivative of our original expression-- we're getting really close-- is going to be equal to-- I'm going to use different colors so we can keep track of things. It's going to be equal to x squared times e to the x minus 2 times all of this business. So minus 2 times-- well, this antiderivative we just figured out is this. Minus 2 times xe to the x minus e to the x. And if we want, now is a good time to put our plus C. And of course, we can simplify this. This is equal to x squared. I like to keep the same colors. This is equal to x squared e to the x. You distribute the negative 2. You get minus 2xe to the x plus 2e to the x, and then finally, plus C. And we're done. We figured out the antiderivative of what looked like a kind of hairy-looking expression using integration by parts twice.