Chalk−1

Math · Calculus II · Worked example

Integrate by parts twice

Find the integral of x2ex.

∫x2exd⁢x

Try one — Chalk checks each line

First round

Take u=x2, which drops to 2⁢x when differentiated, and d⁢v=ex d⁢x, so d⁢u=2⁢x d⁢x and v=ex. The new integral still holds a power of x, but one degree lower.

∫x2exd⁢x=x2ex−∫2⁢xexd⁢x

Second round

Keep the same kind of choice, u=2⁢x and d⁢v=ex d⁢x, so d⁢u=2 d⁢x and v=ex. That gives 2⁢xex−∫2ex d⁢x, which is twice the first worked example’s answer.

∫2⁢xexd⁢x=2⁢xex−2ex+C

Combine

Subtract the second result from x2ex. The minus sign reaches both terms, x2ex−(2⁢xex−2ex) =x2ex−2⁢xex+2ex, and ex factors out.

∫x2exd⁢x=ex(x2−2⁢x+2)+C

Check by differentiating

The derivative of ex(x2−2⁢x+2) is ex(x2−2⁢x+2)+ex(2⁢x−2) =x2ex. The 2⁢x and the 2 cancel in pairs, which is why the constant in the bracket must be +2.

Result

∫x2ex d⁢x =ex(x2−2⁢x+2)+C. The bracket x2−2⁢x+2 =(x−1)2+1 is never zero, so with C=0 the antiderivative is positive everywhere, and it only rises, as a function with slope x2ex≥0 must.

Your turn

1. One like the example

Find ∫x2sinx d⁢x.

Show the answer and explanation

−x2cosx +2⁢xsinx +2cosx +C.

Round one, u=x2 and d⁢v=sinx d⁢x, gives −x2cosx+∫2⁢xcosx d⁢x. Round two, u=2⁢x and d⁢v=cosx d⁢x, gives ∫2⁢xcosx d⁢x =2⁢xsinx−∫2sinx d⁢x =2⁢xsinx+2cosx. Together the answer is −x2cosx +2⁢xsinx +2cosx +C.

∫x2sinxd⁢x−x2cosx+2⁢xsinx+2cosx+C

2. A variation

Find ∫exsinx d⁢x. Here no power drops, and the integral comes back.

Show the answer and explanation

ex(sinx−cosx)⁢/2+C.

Call the integral I. Parts with u=sinx gives I=exsinx−∫excosx d⁢x. Parts again with u=cosx gives ∫excosx d⁢x =excosx+I. Then I=exsinx−excosx−I, so 2⁢I=ex(sinx−cosx).

∫exsinxd⁢xex(sinx−cosx)2+C

3. Somewhere new

Find ∫x3ex d⁢x. Three rounds are needed, and the pattern of this example tells you the answer’s shape.

Show the answer and explanation

ex(x3−3x2+6⁢x−6)+C.

Each round with the power of x as u gives xnex−n∫xn−1ex d⁢x. Starting from x3, the rounds give x3ex−3x2ex+6⁢xex−6ex, with signs alternating. Differentiating ex(x3−3x2+6⁢x−6) gives ex(x3−3x2+6⁢x−6+3x2−6⁢x+6) =x3ex.

∫x3exd⁢xex(x3−3x2+6⁢x−6)+C

Keep exploring

Check it by differentiating in Math, then change F⁢(x) to ex(x2−2⁢x−2), with one sign slipped. The last row turns to ✗, because its derivative is ex(x2−4).

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Check it by differentiating in Math Check both rounds in Math Study the 5 key terms Open worked example on a board Product rule in Math Reference

Your existing work stays on this device. Examples open as editable copies.