practicecalculus
Products and integration by parts

Integral of x eˣ: Formula, Steps and Examples

The integral of x eˣ is (x − 1)eˣ + C. See the integration by parts steps, why u = x is the right choice, a graph and examples like x e^(2x).

Products and integration by parts Updated 3 min read

At a glance

\int x e^x\,dx = (x - 1)e^x + C
Antiderivative
(x-1)e^x + C
Method
Integration by parts with u = x, dv = e^x\,dx
From 0 to 1
1
With e^(kx)
\int xe^{kx}\,dx = \left(\frac{x}{k} - \frac{1}{k^2}\right)e^{kx} + C
On this page
  1. Graph of x eˣ and its antiderivative
  2. How to integrate x eˣ step by step
  3. Check by differentiating
  4. Definite integrals
  5. Worked examples
  6. Common mistakes

The integral of xe^x is (x - 1)e^x + C. It is the standard first example of integration by parts: a power of x times an exponential.

\int x e^x\,dx = xe^x - e^x + C = (x-1)e^x + C

Graph of x eˣ and its antiderivative

y = x eˣ and its antiderivative (x − 1)eˣ
The shaded area from 0 to 1 is exactly 1. The dashed antiderivative has its minimum at x = 0, where xe^x crosses from negative to positive.

How to integrate x eˣ step by step

The formula for integration by parts is \int u\,dv = uv - \int v\,du.

  1. Choose the parts. Let u = x and dv = e^x\,dx.
  2. Find du and v. du = dx and v = e^x.
  3. Apply the formula. \int xe^x\,dx = xe^x - \int e^x\,dx
  4. Finish the easy integral. \int e^x\,dx = e^x, so \int xe^x\,dx = xe^x - e^x + C = (x-1)e^x + C

Why u = x? The goal is a simpler leftover integral. Differentiating x gives 1, so the x is gone after one step. The LIATE rule (Logs, Inverse trig, Algebraic, Trig, Exponential) says the same thing: algebraic comes before exponential, so x is u.

What if you choose the other way? With u = e^x and dv = x\,dx, you get \frac{x^2}{2}e^x - \int\frac{x^2}{2}e^x\,dx. The power of x went up, so the problem got worse.

Check by differentiating

\frac{d}{dx}\Big((x-1)e^x\Big) = 1\cdot e^x + (x-1)e^x = xe^x

The product rule gives back exactly the integrand. The derivative of x eˣ page shows the forward direction.

Definite integrals

From 0 to 1:

\int_0^1 xe^x\,dx = \Big[(x-1)e^x\Big]_0^1 = 0\cdot e - (-1)\cdot 1 = 1

From −∞ to 0: as x \to -\infty, (x-1)e^x \to 0 because the exponential wins. So

\int_{-\infty}^{0} xe^x\,dx = (0 - 1)e^0 - 0 = -1

The answer is negative since xe^x < 0 for x < 0.

Worked examples

Example 1: a faster exponential. \int xe^{2x}\,dx. Let u = x, dv = e^{2x}\,dx, so v = \frac{1}{2}e^{2x}:

\int xe^{2x}\,dx = \frac{x}{2}e^{2x} - \frac{1}{2}\int e^{2x}\,dx = \frac{x}{2}e^{2x} - \frac{1}{4}e^{2x} + C

In general, \int xe^{kx}\,dx = \left(\frac{x}{k} - \frac{1}{k^2}\right)e^{kx} + C.

Example 2: decay. With k = -1, the general formula gives \int xe^{-x}\,dx = (-x - 1)e^{-x} + C = -(x+1)e^{-x} + C. From 0 to \infty this is 0 - (-1) = 1. This is the average waiting time in the exponential distribution with rate 1.

Example 3: a linear factor. \int(3x + 2)e^x\,dx. With u = 3x + 2, du = 3\,dx:

(3x+2)e^x - 3e^x + C = (3x - 1)e^x + C

Example 4: a higher power. For x^2e^x, use parts twice. The result is (x^2 - 2x + 2)e^x + C, shown on the integral of x² eˣ page.

Common mistakes

  1. Integrating factor by factor. \int xe^x\,dx \ne \frac{x^2}{2}e^x. The integral of a product is not the product of the integrals.
  2. Choosing u = e^x. The leftover integral then contains x^2, which is harder.
  3. A sign slip in the last step. It is xe^x - \int e^x\,dx, so the e^x term is subtracted. Check by differentiating.
  4. Forgetting \frac{1}{k} for e^{kx}. With e^{2x}, v = \frac{1}{2}e^{2x}, not e^{2x}.

For more practice, see the integration by parts guide and the integration by parts practice problems.

Practice it now

Integration by parts

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the integral of x eˣ?

It is (x - 1)e^x + C, or xe^x - e^x + C.

What is the integral of x e^(2x)?

It is \frac{x}{2}e^{2x} - \frac{1}{4}e^{2x} + C. Use parts with u = x and dv = e^{2x}\,dx, so v = \frac{1}{2}e^{2x}.

What is the integral of x e^(−x)?

It is -(x+1)e^{-x} + C. From 0 to \infty the integral equals 1.

Can I use u-substitution for x eˣ?

No. A substitution needs the derivative of the inside to appear as a factor, and there is no inside function here. This is a product of two unrelated functions, which is what integration by parts is for.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.