Let's find ∫xexdx. It looks a lot like ∫xex2dx, where u-substitution works because x is half the derivative of the inside, x2. Here the inside is just x, and trying t=ex only leaves ∫lntdt, which we don't know how to integrate yet either.
∫xex2dx
t=x2dt=2xdx
21∫etdt=21ex2+C
∫xexdx
t=exdt=exdxx=lnt
∫lntdt=?
Substitution is the chain rule run backwards. Since xex is a product of two functions, let's try running the product rule backwards instead.
Find ∫xexdx
∫xexdx=?
Text solution
The product rule on xexIts second term is the function we want to integrate, so we solve for it.
(xex)′=1⋅ex+xex
Integrate both sidesIntegrating a derivative gives back the function, so ∫(xex)′dx is just xex.
∫xexdx=xex−∫exdx
=xex−ex+C
CheckDifferentiating with the product rule brings us back to xex.
(xex−ex)′=ex+xex−ex=xex
Nothing here depended on x and ex in particular. For any two functions f and g, the same steps turn the product rule into a formula for ∫fg′dx. This is integration by parts.
(fg)′fg′∫fg′dx=f′g+fg′=(fg)′−f′g=fg−∫f′gdx
So to find ∫fg′dx, we only have to find ∫f′gdx. We differentiate f, integrate g′, and choose them so that the new integral is simpler than the one we started with. With f=x, differentiating gave 1, and the new integral was just ∫exdx.
(x)′=1∫exdx=ex
∫xexdx=xex−∫1⋅exdx
We usually write this formula with u and v. Let u=f be the factor we differentiate, and let dv=g′dx be the factor we integrate, times dx. Then du=f′dx and v=g. This u is just a name, not a substitution. Nothing gets replaced, and everything stays in terms of x.
∫udv=uv−∫vdu
2
Which factor to differentiate
For ∫xexdx, we could integrate either factor. So what happens if we switch them and let f=ex?
(ex)′=ex∫xdx=2x2
∫xexdx=2x2ex−∫2x2exdx
The equation is true, but the new integral has x2 instead of x, because integrating x raised its power. Choosing f=x worked because differentiating x gave 1, which got rid of the x.
With ∫xlnxdx, the choice is made for us.
Find ∫xlnxdx
∫xlnxdx=?
Text solution
Why not differentiate x?Then g′ would be lnx, and we don't know an antiderivative of lnx yet.
(x)′=1∫lnxdx=?
Differentiate lnx, integrate xIn the new integral, x1 cancels an x from 2x2, which leaves just 2x.
(lnx)′=x1∫xdx=2x2
∫xlnxdx=2x2lnx−∫2x2⋅x1dx
=2x2lnx−∫2xdx=2x2lnx−4x2+C
For each integral, tap each factor to differentiate it, and see which one makes the new integral simpler.
Which factor to differentiate
3
Integrating lnx on its own
For ∫xlnxdx, we differentiated lnx and integrated x. But with lnx on its own, there's no other factor to be g′.
Find ∫lnxdx
∫lnxdx=?
Text solution
Write lnx as lnx⋅1Now there are two factors, so we differentiate lnx and integrate 1.
(lnx)′=x1∫1dx=x
The new integral is ∫1dxInside it, x⋅x1 cancels to 1.
∫lnx⋅1dx=xlnx−∫x⋅x1dx
=xlnx−∫1dx=xlnx−x+C
CheckThe product rule on xlnx gives lnx+1, and the 1 cancels with the −1 from −x.
(xlnx−x)′=lnx+1−1=lnx
Now we can finish the integral we got stuck on at the start. Letting t=ex turned ∫xexdx into ∫lntdt, and with lnex=x, it gives the same answer as integration by parts.
t∫lntdt=ex=tlnt−t+C=exlnex−ex+C=xex−ex+C
The same trick works for arctanx and arcsinx. We don't know their antiderivatives, but their derivatives are simple, 1+x21 and 1−x21. Write each one times 1, differentiate it, and integrate 1 to get x.
4
Repeated integration by parts and tabular integration
Now let's raise the power of x. In ∫x2exdx, differentiating x2 gives 2x. That lowers the power by 1, but the new integral still has an x, so one round of integration by parts won't finish it.
Find ∫x2exdx
∫x2exdx=?
Text solution
First roundDifferentiate x2 and integrate ex.
∫x2exdx=x2ex−∫2xexdx
Use ∫xexdxPull out the 2, and put in ∫xexdx=xex−ex. Watch the signs, since −2 times −ex gives +2ex.
∫x2exdx=x2ex−2(xex−ex)+C
=ex(x2−2x+2)+C
Each round lowered the power of x by 1 and put a minus sign in front of the new integral. A table keeps track of those rounds, so we don't have to juggle nested parentheses and signs.
dxd
∫
+
x2
ex
−
2x
ex
+
2
ex
0
ex
∫x2exdx=x2ex−2xex+2ex+C
Differentiate x2 down to 0, integrate ex beside it, and alternate the signs starting with +. Each arrow multiplies a derivative by the entry one row down in the integral column, with the sign in the derivative's row. Because the derivative column reaches 0, there's no integral left over.
5
When neither factor differentiates to zero
The table finished because x2 differentiated down to 0. With exsinx, differentiating ex keeps giving ex, and differentiating sinx cycles through cosx and −sinx, so neither factor ever reaches 0. Let's name the integral I and try integration by parts anyway.
Find ∫exsinxdx
∫exsinxdx=?
Text solution
Two rounds, the same choiceBoth times, differentiate the trig function and integrate ex. The second round brings back I.
I=exsinx−∫excosxdx
∫excosxdx=excosx+I
Solve for IPlugging the second round into the first gives I on both sides. Add I to both sides and divide by 2.
I=exsinx−excosx−I
I=21ex(sinx−cosx)+C
Why not switch in the second round?Integrating cosx just undoes the derivative from the first round, and we get I=I. That's true, but it doesn't tell us what I is.
I=exsinx−exsinx+I=I
6
Definite integrals and unknown functions
When an integral has bounds from a to b, every part of the integration by parts formula gets those same bounds, the product fg included.
∫abfg′dx=[fg]ab−∫abf′gdx
Let's use it on ∫01xexdx, and then on a function we don't have a formula for, only a few of its values and its integral.
x
0
2
h(x)
3
5
∫02h(x)dx=7
Find ∫02xh′(x)dx using values of h and ∫02h(x)dx
∫02xh′(x)dx=?
Text solution
On ∫01xexdxDon't drop the product term. Without it we'd get −(e−1), which is negative, but xex is never negative between 0 and 1.
∫01xexdx=[xex]01−∫01exdx
=(e−0)−(e−1)=1
On ∫02xh′(x)dx, differentiate xDifferentiating h′(x) would give h′′(x), which we know nothing about. Integrating h′(x) gives h(x), and we have its values.
(x)′=1∫h′(x)dx=h(x)
Use the given values
∫02xh′(x)dx=[xh(x)]02−∫02h(x)dx
=(2⋅5−0⋅3)−7=3
7
Substituting before integrating by parts
Sometimes integration by parts doesn't work on the integral as it's written. In ∫x3ex2dx, neither choice works. We can't integrate ex2, and differentiating ex2 makes the new integral worse.
(x3)′=3x2∫ex2dx=?
(ex2)′=2xex2∫x3dx=4x4
∫x3ex2dx=4x4ex2−21∫x5ex2dx
Earlier we integrated xex2 with the substitution t=x2. Let's try substituting first here too.
Find ∫x3ex2dx
∫x3ex2dx=?
Text solution
Substitute t=x2Split x3 into x2⋅x. Then x2 becomes t, and the leftover xdx becomes 21dt.
t=x2dt=2xdxxdx=21dt
∫x3ex2dx=∫x2ex2⋅xdx=21∫tetdt
Integrate by parts, then put x backThis is ∫xexdx with t in place of x.
21∫tetdt=21(tet−et)+C
=21ex2(x2−1)+C
Sometimes there isn't even a product until we substitute.
∫exdx=?
The inside of ex is x, so let's try w=x. Its derivative, 2x1, isn't in the integral, so there's no factor in the integral that becomes dw, the way xdx became 21dt. But we don't need one. Instead, we solve for x, which gives x=w2 and dx=2wdw, so the whole integral is in terms of w.
w=xx=w2dx=2wdw
∫exdx=∫ew⋅2wdw=2∫wewdw
The 2w from dx gives us a product. Now ∫wewdw is just ∫xexdx with w instead of x. Differentiating w and integrating ew gives wew−ew, and then we replace w with x.
2∫wewdw=2(wew−ew)+C=2ex(x−1)+C
2∫wewdw=2(wew−ew)+C=2ex(x−1)+C
Summary
The integration by parts formula
Product rule form
∫fg′dx=fg−∫f′gdx
Differential form
∫udv=uv−∫vdu
Integration by parts comes from running the product rule backwards. If we integrate both sides of (fg)′=f′g+fg′, the derivative and integral cancel on the left to give fg. Subtracting ∫f′gdx leaves the formula, where we differentiate f to get f′ and integrate g′ to get g. In the differential form, u is the name for the factor we differentiate and dv is the factor we integrate, times dx. This u isn't a substitution, and everything stays in terms of x.
Checking for substitution first
Substitution alone
∫xex2dx:t=x2,dt=2xdx
∫xex2dx:t=x2,dt=2xdx
Substitution, then integration by parts
∫x3ex2dx:t=x2→21∫tetdt
∫x3ex2dx:t=x2→21∫tetdt
Solving for x
∫exdx:w=x,x=w2,dx=2wdw→2∫wewdw
∫exdx:w=x,x=w2dx=2wdw→2∫wewdw
If an extra factor is a constant multiple of the inside function's derivative, use u-substitution instead of integration by parts. In ∫xex2dx, the x is half the derivative of x2, so we can evaluate the integral with the substitution t=x2. For ∫x3ex2dx, split x3 as x2⋅x first. Then t=x2 turns x2⋅xdx into 21tdt, leaving 21∫tetdt to finish with integration by parts. When the derivative of the inside isn't in the integral, as with x in ex, solve for x to write dx in the new variable. The two methods often work together. For ∫exdx, substitution gives an integral we can evaluate by integration by parts. For ∫arctanxdx, integration by parts gives a new integral, ∫1+x2xdx, and we evaluate it with the substitution t=1+x2.
Choosing which factor to differentiate
Differentiating x
∫xexdx
(x)′=1∫exdx=ex
Differentiating ln x
∫xlnxdx
(lnx)′=x1∫xdx=2x2
Choose g′ as a factor you can integrate, and choose f so that the new integral, ∫f′gdx, is simpler than the one you started with. For ∫xexdx, differentiating x leaves ∫exdx, while differentiating ex would leave ∫2x2exdx. When one factor is lnx,arctanx or arcsinx, integrating it is the hard part, but its derivative is just x1,1+x21 or 1−x21. So differentiate that factor, and integrate the other one.
Integrating a single function by parts
∫lnxdx=∫lnx⋅1dx=xlnx−x+C
When a single function like lnx,arctanx, or arcsinx appears by itself, write it as that function times 1, and choose g′=1. Integrating 1 gives x, and in the new integral that x multiplies f′. For lnx, it cancels the x1 completely.
Tabular integration
dxd
∫
+
x2
ex
−
2x
ex
+
2
ex
0
ex
∫x2exdx=x2ex−2xex+2ex+C
For an integral of xn times ex,sinx, or cosx, differentiate xn repeatedly down to 0 and integrate the other factor repeatedly. Alternate signs starting with +, because each round puts a minus sign in front of the new integral, and add the diagonal products.
When the original integral returns
I2I=exsinx−excosx−I=ex(sinx−cosx)
For an exponential times a sine or cosine, use integration by parts twice, differentiating the trig function in both rounds. This brings back the original integral I with a minus sign. Then collect the I terms on one side and divide by their coefficient. For exsinx, the coefficient of I is 2, so we divide by 2. Other integrals can give different coefficients. Switching the choice in the second round gives I=I, which doesn't tell us what I is.
Definite integrals and unknown functions
With bounds
∫abfg′dx=[fg]ab−∫abf′gdx
Unknown function
∫abxh′(x)dx=[xh(x)]ab−∫abh(x)dx
With limits of integration, evaluate both the product term [fg]ab and the new integral with the same bounds. When fg′ is never negative on [a,b], the answer can't be negative. If you get a negative answer, check whether you forgot the product term [fg]ab. When h is given only by its values or its graph, evaluate ∫abxh′(x)dx by picking g′=h′(x) so g=h(x), and f=x so f′=1. The formula then gives [xh(x)]ab−∫abh(x)dx.
8
Practice
Enter exact values and include +C for indefinite integrals.
1
Evaluate ∫xcos2xdx.
Differentiating x gives 1, while differentiating cos2x gives −2sin2x. Which choice makes the new integral simpler?
The derivative of sin2x is 2cos2x, so what is ∫cos2xdx?
If you got xsin2x+21cos2x+C Check the integral of cos2x. Since the derivative of sin2x is 2cos2x, you need a factor of 21.
Choose the factorsThe derivative of x is 1, and cos2x is easy to integrate, so let f=x and g′=cos2x.
(x)′=1∫cos2xdx=21sin2x
Integrate by partsDifferentiating x got rid of the x, and that leaves an integral we can evaluate directly.
Write x2lnx as lnx⋅x−2. Which factor should be f, so that the new integral has no lnx in it?
To integrate x−2, add 1 to the power and divide by the new power. What do you get?
If you got xlnx−x1+C Check the sign of the first term. Integrating x−2 gives −x1, so fg=lnx⋅(−x1)=−xlnx.
Choose the factorsThe derivative of lnx is x1, which gets rid of the logarithm, and x−2 is easy to integrate with the power rule. So let f=lnx and g′=x−2.
x2lnx=lnx⋅x−2
(lnx)′=x1∫x−2dx=−x1
Integrate by partsThe two minus signs make a plus, and combining the powers of x leaves x−2 to integrate.
We know the derivative of arctanx but not its antiderivative. How can you write the integral as a product so that arctanx is the factor you differentiate?
For the new integral ∫1+x2xdx, what is the derivative of the denominator 1+x2?
If you got xarctanx−ln(1+x2)+C Check the substitution in the new integral. If t=1+x2, then dt=2xdx, so xdx is 21dt.
Write as a productWe don't know the antiderivative of arctanx, but we know its derivative, so we write arctanx as arctanx⋅1, with f=arctanx and g′=1.
arctanx=arctanx⋅1
(arctanx)′=1+x21∫1dx=x
Integrate by partsPut the pieces into the formula to get the new integral.
∫arctanxdx=xarctanx−∫1+x2xdx
Evaluate the new integralThe derivative of 1+x2 is 2x, and we have x in the numerator, so substitute t=1+x2.
t=1+x2dt=2xdx
∫1+x2xdx=21∫tdt=21ln(1+x2)
Subtract the new integral from xarctanx to finish the antiderivative.
∫arctanxdx=xarctanx−21ln(1+x2)+C
4
Evaluate ∫xlnxdx.
What is the derivative of lnx? Is it already in the integral?
The derivative of lnx is x1, which is already in the integral, so we use a substitution instead of integration by parts.
t=lnxdt=x1dx
∫xlnxdx=∫tdt=21t2+C=21(lnx)2+C
5
Evaluate ∫x2sinxdx.
Differentiating x2 repeatedly eventually reaches 0. How many rounds of integration by parts do we need?
In the ∫ column, what do you get when you integrate sinx, then integrate the result, then integrate once more? Keep track of every minus sign.
If you got −x2cosx−2xsinx+2cosx+C Check the sign on the second diagonal. It has a minus sign from the table and a negative entry, −sinx, from the ∫ column, so the two negatives make a plus.
Set up the tableDifferentiating x2 repeatedly reaches 0 after three steps, so we can use a table.
dxd
∫
+
x2
sinx
−
2x
−cosx
+
2
−sinx
0
cosx
Multiply the diagonalsMultiply along each diagonal with its sign, being careful with the double negative on the middle term.
A function h has h(1)=4,h(3)=9,h′(1)=2 and h′(3)=5. Evaluate ∫13xh′′(x)dx.
In the product xh′′(x), what do you get when you integrate h′′(x)?
What is ∫13h′(x)dx in terms of values of h?
If you got 13 You evaluated [xh′(x)]13, but the formula also subtracts the integral ∫13h′(x)dx.If you got 10 The antiderivative of h′(x) is h(x), so ∫13h′(x)dx=h(3)−h(1), not h′(3)−h′(1).
Choose the factorsWe don't have a formula for h, but integrating h′′(x) gives h′(x), and differentiating x gives 1. So let f=x and g′=h′′(x).
(x)′=1∫h′′(x)dx=h′(x)
Integrate by partsUse the formula with bounds.
∫13xh′′(x)dx=[xh′(x)]13−∫13h′(x)dx
Plug in the given valuesThe product term uses values of h′, while the integral of h′ gives h(3)−h(1), which uses values of h.
=(3⋅5−1⋅2)−(h(3)−h(1))=13−(9−4)=8
7
Evaluate ∫e2xcosxdx.
Neither factor ever differentiates to 0. Call the integral I. What happens if you integrate by parts twice, differentiating the trig factor both times?
You should reach I=21e2xcosx+41e2xsinx−41I. What do you get when you add 41I to both sides?
If you got 8e2x(2cosx+sinx)+C Check the coefficient when solving for I. Adding 41I to I gives 45I, not 2I.
First round of integration by partsCall the integral I, and differentiate the trig factor, cosx, while integrating e2x.
I=∫e2xcosxdx
(cosx)′=−sinx∫e2xdx=21e2x
I=21e2xcosx+21∫e2xsinxdx
Second round of integration by partsDifferentiate the trig factor again, so the second round doesn't undo the first.
(sinx)′=cosx∫e2xdx=21e2x
∫e2xsinxdx=21e2xsinx−21I
Substitute back into IPlug the second round into the equation for I and distribute the 21.
I=21e2xcosx+41e2xsinx−41I
Solve for IAdd 41I to both sides to get 45I, then multiply by 54.
45II=41e2x(2cosx+sinx)=5e2x(2cosx+sinx)+C
8
Evaluate ∫sinxdx.
In ∫xsinxdx, the x1 would let you substitute w=x directly. Here it's missing. What is dx if you solve w=x for x?
Once the integral is in terms of w, which factor should you differentiate?
If you got sinx−xcosx+C Check dx. Differentiating x=w2 gives dx=2wdw, so don't drop the factor of 2.
Substitute to clear the rootThe inside of the sine is x, so let w=x. Its derivative isn't in the integral, so solve for x. From x=w2, we get dx=2wdw, and the 2w gives us a product.
w=xx=w2dx=2wdw
∫sinxdx=∫sinw⋅2wdw=2∫wsinwdw
Integrate by parts and put x backDifferentiating w gives 1, so let f=w and g′=sinw. Then substitute x back in for w.