Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 19: ∫x ex dx\int x\,e^x\,dx

ExamplesIntegration by parts · Section 7.6
The question

Find

∫x ex dx\int x\,e^x\,dx
Exam answer

Let I=∫x ex dxI = \displaystyle\int x\,e^x\,dx⁠.

Taking xx as the first function and exe^x as the second, by parts:

I=x ex−∫1⋅ex dxI = x\,e^x - \int 1\cdot e^x\,dx

∴ I=x ex−ex+C\therefore\ I = x\,e^x - e^x + C⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

A product of a power of xx and exe^x⁠. The function exe^x is its own integral, so integrating it costs nothing; the factor xx disappears when differentiated. So integration by parts with xx first and exe^x second leaves only ∫ex dx\int e^x\,dx⁠.

Given, to find, and the plan
Given
xexx e^x⁠, defined and continuous for every real xx⁠.
To find
∫xex dx\int x e^x\,dx⁠.
Plan
(1) Choose the first and second functions. (2) Apply integration by parts. (3) Differentiate back.

Basics you need

1Integration by parts

∫fg dx=f∫g dx−∫[f′∫g dx]dx\int f g\,dx = f\int g\,dx - \int\big[f'\int g\,dx\big]dx⁠, with ff the first function and gg the second (Section 7.6). Lesson: integration by parts

2The exponential is its own integral

Standard formula (xi): ∫ex dx=ex+C\int e^x\,dx = e^x + C⁠, because ddxex=ex\frac{d}{dx}e^x = e^x⁠. Basics: integration undoes differentiation

Solution

  1. Choose the first and second functions

    f(x)=x  (first),g(x)=ex  (second).f(x) = x \ \ (\text{first}), \qquad g(x) = e^x \ \ (\text{second}).

    Then f′(x)=1f'(x) = 1 and ∫g(x) dx=ex\int g(x)\,dx = e^x⁠.

    Differentiating xx gives 1, so the xx disappears; integrating exe^x gives exe^x again, no harder. The other way round, ∫x dx=x22\int x\,dx = \frac{x^2}{2} would raise the power and give x22ex−∫x22ex dx\frac{x^2}{2}e^x - \int\frac{x^2}{2}e^x\,dx⁠, a harder integral (Example 17 shows the same effect for ∫xcos⁡x dx\int x\cos x\,dx⁠).
    Remark (iii) after Example 17: a power of xx is usually the first function. Lesson: integration by parts
  2. Apply integration by parts

    ∫x ex dx=x ex−∫1⋅ex dx=x ex−ex+C.\begin{aligned} \int x\,e^x\,dx &= x\,e^x - \int 1\cdot e^x\,dx \\ &= x\,e^x - e^x + C. \end{aligned}
    First function times integral of second (x⋅exx\cdot e^x⁠), minus the integral of (derivative of first) times (integral of second), which is ∫1⋅ex dx=ex\int 1\cdot e^x\,dx = e^x⁠.
    ∫ex dx=ex+C\int e^x\,dx = e^x + C (formula (xi)). Basics: integration undoes differentiation
  3. Check: differentiate the answer

    ddx(xex−ex)=(1⋅ex+xex)−ex=xex.\begin{aligned} \frac{d}{dx}\big(x e^x - e^x\big) &= (1\cdot e^x + x e^x) - e^x \\ &= x e^x. \end{aligned}
    The product rule on xexx e^x gives ex+xexe^x + x e^x⁠, and the −ex-e^x removes the extra exe^x⁠. The derivative is exactly the integrand, for every real xx⁠.
    Product rule; ddxex=ex\frac{d}{dx}e^x = e^x⁠. Basics: integration undoes differentiation
Result ∫x ex dx=xex−ex+C=(x−1)ex+C,\int x\,e^x\,dx = x e^x - e^x + C = (x - 1)e^x + C,

valid for every real xx⁠. This is the book's answer.

Check it with numbers

At a point. At x=2x = 2⁠: the integrand is 2e2≈14.77811222e^2 \approx 14.7781122⁠; the derivative of our answer is (e2+2e2)−e2=2e2(e^2 + 2e^2) - e^2 = 2e^2⁠, the same.

Over an interval. On [0,1][0, 1]⁠:

F(1)−F(0)=(e−e)−(0−1)=1.F(1) - F(0) = (e - e) - (0 - 1) = 1.

Numerical integration of xexx e^x over [0,1][0, 1] gives 1.0000000000…1.0000000000\ldots⁠, the same.

Common mistakes
  1. Choosing exe^x as the first function. The power of xx goes up and the integral gets harder.
  2. Dropping the minus sign and writing xex+exx e^x + e^x⁠. Differentiating that gives xex+2exx e^x + 2e^x⁠, not xexx e^x⁠.
What to take away
  1. For xnexx^n e^x⁠, take xnx^n as the first function; each use of the formula lowers the power by one.
  2. ∫xex dx=(x−1)ex+C\int x e^x\,dx = (x - 1)e^x + C⁠.

Every fact used, and where it comes from

FactUsed inSource
Integration by partsStep 2Section 7.6 (Lesson: integration by parts)
Power of xx as the first functionStep 1Remark (iii) after Example 17, Section 7.6
∫ex dx=ex+C\int e^x\,dx = e^x + CStep 2Standard formula (xi), Section 7.2
Product rule; ddxex=ex\frac{d}{dx}e^x = e^xStep 3Chapter 5, Sections 5.3 and 5.4
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →