AP Calculus BC

Integral of x e^x: Answer, Parts Setup, Mistakes

The integral of x e^x with respect to x is (x - 1)e^x + C. Integration by parts with u = x and dv = e^x dx gives x e^x minus the integral of e^x dx, so the answer is x e^x - e^x + C, which factors as (x - 1)e^x + C. Differentiating it back with the product rule returns x e^x.

xexdx=(x1)ex+C\int x e^{x}\,dx = (x - 1)e^{x} + C

How to integrate x e^x by parts

The integrand xexx e^{x} is a product of two different kinds of function, an algebraic factor and an exponential factor, and nothing inside it is the derivative of anything else in it. That rules out substitution and points at integration by parts, which comes from reversing the product rule.

udv=uvvdu\int u\,dv = uv - \int v\,du

Let uu be the factor that gets simpler when you differentiate it. Here xx differentiates to 11, while exe^{x} never simplifies, so take u=xu = x and let exdxe^{x}\,dx be dvdv.

u=x,du=dx,dv=exdx,v=exu = x, \quad du = dx, \quad dv = e^{x}\,dx, \quad v = e^{x}

Substitute those four pieces into the formula. The uvuv term is xexx e^{x}, and the new integral vdu\int v\,du is exdx\int e^{x}\,dx.

xexdx=xexexdx\int x e^{x}\,dx = x e^{x} - \int e^{x}\,dx

The remaining integral is one of the basic antiderivatives, so a single pass through parts finishes the problem. Factor exe^{x} out of both terms to get the compact form.

xexdx=xexex+C=(x1)ex+C\int x e^{x}\,dx = x e^{x} - e^{x} + C = (x - 1)e^{x} + C

Check it by differentiating

Differentiate (x1)ex(x - 1)e^{x} with the product rule: (1)ex+(x1)ex=ex+xexex=xex(1)e^{x} + (x - 1)e^{x} = e^{x} + x e^{x} - e^{x} = x e^{x}. The two exe^{x} terms cancel and you are back to the integrand, which is the fastest way to catch a sign slip on an exam.

Why u = x and not u = e^x

Integration by parts only helps if the new integral vdu\int v\,du is easier than the one you started with. Choosing u=exu = e^{x} and dv=xdxdv = x\,dx is legal, but it makes v=x22v = \frac{x^{2}}{2} and pushes the power up instead of down.

xexdx=x22exx22exdx\int x e^{x}\,dx = \frac{x^{2}}{2}e^{x} - \int \frac{x^{2}}{2}e^{x}\,dx

The new integrand x22ex\frac{x^{2}}{2}e^{x} is worse than xexx e^{x}, and repeating the choice makes it worse again. The LIATE ordering is a shortcut for picking uu so this does not happen: take the first type on the list that appears in the integrand.

  1. Logarithmic, such as lnx\ln x
  2. Inverse trigonometric, such as arctanx\arctan x
  3. Algebraic, such as xx or x2x^{2}
  4. Trigonometric, such as sinx\sin x
  5. Exponential, such as exe^{x}

In xexx e^{x} the algebraic factor xx outranks the exponential exe^{x}, so u=xu = x. The list is a heuristic, not a theorem, but the reason behind it is the real test: differentiating uu should shrink the problem, and antidifferentiating dvdv should not grow it.

Where the integral of x e^x shows up on the AP exam

Integration by parts is Topic 6.11 in Unit 6 (Integration and Accumulation of Change), and it is BC only, so xexdx\int x e^{x}\,dx will not be asked on AB. Unit 6 carries a weighting of 15 to 20 percent on both exams, and Topic 6.14 (Selecting Techniques for Antidifferentiation) is where you have to recognize that this integrand wants parts rather than substitution.

The definite version is the common exam form. With the antiderivative in factored form the arithmetic is short, because (x1)ex(x - 1)e^{x} is 00 at x=1x = 1.

01xexdx=[(x1)ex]01=0(1)=1\int_{0}^{1} x e^{x}\,dx = \left[(x - 1)e^{x}\right]_{0}^{1} = 0 - (-1) = 1

Two variants come up often enough to be worth recognizing. An exponent of axax changes the bookkeeping but not the method, and a squared algebraic factor needs parts twice, dropping the power by one each pass.

xeaxdx=eax(xa1a2)+C,a0\int x e^{ax}\,dx = e^{ax}\left(\frac{x}{a} - \frac{1}{a^{2}}\right) + C, \quad a \neq 0
x2exdx=(x22x+2)ex+C\int x^{2} e^{x}\,dx = (x^{2} - 2x + 2)e^{x} + C

That second result is the same machinery: one pass turns x2exdx\int x^{2}e^{x}\,dx into x2ex2xexdxx^{2}e^{x} - 2\int x e^{x}\,dx, and the integral you are left with is the one on this page.

Common mistakes with the integral of x e^x

  • Multiplying the antiderivatives. There is no product rule for integrals, so x22ex\frac{x^{2}}{2}e^{x} is not the answer. Differentiate it and you get xex+x22exx e^{x} + \frac{x^{2}}{2}e^{x}, not xexx e^{x}.
  • Losing the minus sign in front of vdu\int v\,du and writing xex+ex+Cx e^{x} + e^{x} + C. This is the single most common parts error, and one differentiation catches it.
  • Reaching for substitution. Setting u=exu = e^{x} gives du=exdxdu = e^{x}\,dx, and there is no spare exe^{x} in xexdxx e^{x}\,dx to absorb; setting u=xu = x leaves the exe^{x} untouched.
  • Writing v=exxv = \frac{e^{x}}{x} or similar. Antidifferentiating dv=exdxdv = e^{x}\,dx gives v=exv = e^{x}, because exe^{x} is its own antiderivative.
  • Factoring carelessly. From xexexx e^{x} - e^{x} the factored form is (x1)ex(x - 1)e^{x}, not (1x)ex(1 - x)e^{x}.

You do not need a second constant

When you antidifferentiate dvdv to get vv, drop the constant. Carrying v=ex+kv = e^{x} + k through the formula adds kxkx and subtracts kxkx, so it cancels every time. Write a single +C+ C at the end of an indefinite integral, and none at all on a definite one.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

What is the integral of x e^x?

It is (x1)ex+C(x - 1)e^{x} + C, equivalently xexex+Cx e^{x} - e^{x} + C. Integration by parts with u=xu = x and dv=exdxdv = e^{x}\,dx gives xexexdxx e^{x} - \int e^{x}\,dx, and the leftover integral is just exe^{x}.

Can I use u-substitution instead of integration by parts?

No. Substitution needs an inner function whose derivative is already sitting in the integrand up to a constant. In xexdxx e^{x}\,dx, taking u=exu = e^{x} needs a spare exe^{x} that is not there, and taking u=xu = x changes nothing. The product of two unrelated factors is the signature of integration by parts.

Is the integral of x e^x on the AP Calculus AB exam?

No. Integration by parts is Topic 6.11, which the CED marks BC only, so this integral can appear on BC but not on AB. AB students still integrate exe^{x} and ekxe^{kx} by the basic rules and by substitution.

What is the definite integral of x e^x from 0 to 1?

It equals exactly 11. Evaluate (x1)ex(x - 1)e^{x} at the endpoints: at x=1x = 1 the factor (x1)(x - 1) is zero, and at x=0x = 0 the value is 1-1, so the difference is 0(1)=10 - (-1) = 1.

How do I integrate x^2 e^x or x e^(2x)?

Apply parts again for the first: x2exdx=x2ex2xexdx=(x22x+2)ex+C\int x^{2}e^{x}\,dx = x^{2}e^{x} - 2\int x e^{x}\,dx = (x^{2} - 2x + 2)e^{x} + C. For the second, u=xu = x and dv=e2xdxdv = e^{2x}\,dx gives v=e2x2v = \frac{e^{2x}}{2} and the answer e2x(x214)+Ce^{2x}\left(\frac{x}{2} - \frac{1}{4}\right) + C.