Calculus3Integration Techniques1 of 5
Integration Techniques · 1

Integration by Parts

1

Running the product rule backwards

Let's find ∫xex dx\int x e^x\,dx. It looks a lot like ∫xex2 dx\int x e^{x^2}\,dx, where uu-substitution works because xx is half the derivative of the inside, x2x^2. Here the inside is just xx, and trying t=ext = e^x only leaves ∫ln⁡t dt\int \ln t\,dt, which we don't know how to integrate yet either.

∫xex2 dx\displaystyle \int x e^{x^2}\,dx
t=x2t = x^2dt=2x dxdt = 2x\,dx
12∫et dt\displaystyle \frac12\int e^{t}\,dt =12ex2+C\displaystyle = {\frac12 e^{x^2} + C}
∫xex dx\displaystyle \int x e^{x}\,dx
t=ext = e^{x}dt=ex dxdt = e^{x}\,dxx=ln⁡tx = \ln t
∫ln⁡t dt\displaystyle \int \ln t\,dt =  ?\displaystyle = \;?

Substitution is the chain rule run backwards. Since xexx e^x is a product of two functions, let's try running the product rule backwards instead.

Find ∫xex dx\int x e^x\,dx
∫xex dx  \displaystyle \int x e^x\,dx \;=  ?\displaystyle =\; ?
Text solution
The product rule on x ex\fd{x}\,\gi{e^{x}}Its second term is the function we want to integrate, so we solve for it.
(x ex)′\displaystyle \left(\fd{x}\,\gi{e^{x}}\right)' =1⋅ex+x ex\displaystyle = \fd{1}\cdot \gi{e^{x}} + \fd{x}\,\gi{e^{x}}
Integrate both sidesIntegrating a derivative gives back the function, so ∫(xex)′ dx\int (\fd{x}\gi{e^x})'\,dx is just xex\fd{x}\gi{e^x}.
∫x ex dx\displaystyle \int \fd{x}\,\gi{e^{x}}\,dx =xex−∫ex dx\displaystyle = x e^{x} - \int \gi{e^{x}}\,dx
=xex−ex+C\displaystyle = x e^{x} - e^{x} + C
CheckDifferentiating with the product rule brings us back to xexx e^x.
(xex−ex)′\displaystyle \left(x e^{x} - e^{x}\right)' =ex+xex−ex\displaystyle = e^{x} + x e^{x} - e^{x} =xex\displaystyle = x e^{x}

Nothing here depended on x\fd{x} and ex\gi{e^x} in particular. For any two functions f\fd{f} and g\gi{g}, the same steps turn the product rule into a formula for ∫fg′ dx\int \fd{f} \gi{g'}\,dx. This is integration by parts.

(fg)′=f′g+fg′fg′=(fg)′−f′g∫f g′ dx=fg−∫f′g dx\displaystyle \begin{aligned}(\fd{f}\gi{g})' &= \fd{f'}\gi{g} + \fd{f}\gi{g'}\\[6pt] \fd{f}\gi{g'} &= (\fd{f}\gi{g})' - \fd{f'}\gi{g}\\[6pt] \int \fd{f}\,\gi{g'}\,dx &= \fd{f}\gi{g} - \int \fd{f'}\gi{g}\,dx\end{aligned}

So to find ∫fg′ dx\int \fd{f} \gi{g'}\,dx, we only have to find ∫f′g dx\int \fd{f'}\gi{g}\,dx. We differentiate f\fd{f}, integrate g′\gi{g'}, and choose them so that the new integral is simpler than the one we started with. With f=x\fd{f = x}, differentiating gave 1\fd{1}, and the new integral was just ∫ex dx\int \gi{e^x}\,dx.

(x)′=1(\fd{x})' = \fd{1}∫ex dx=ex\int \gi{e^{x}}\,dx = \gi{e^{x}}
∫x ex dx\displaystyle \int \fd{x}\,\gi{e^{x}}\,dx =x ex−∫1⋅ex dx\displaystyle = {\fd{x}\,\gi{e^{x}} - \int \fd{1}\cdot\gi{e^{x}}\,dx}

We usually write this formula with u\fd{u} and v\gi{v}. Let u=f\fd{u = f} be the factor we differentiate, and let dv=g′ dx\gi{dv = g'\,dx} be the factor we integrate, times dxdx. Then du=f′ dx\fd{du = f'\,dx} and v=g\gi{v = g}. This u\fd{u} is just a name, not a substitution. Nothing gets replaced, and everything stays in terms of xx.

∫u dv\displaystyle \int \fd{u}\,\gi{dv} =uv−∫v du\displaystyle = \fd{u}\gi{v} - \int \gi{v}\,\fd{du}
2

Which factor to differentiate

For ∫xex dx\int x e^x\,dx, we could integrate either factor. So what happens if we switch them and let f=ex\fd{f = e^x}?

(ex)′=ex(\fd{e^{x}})' = \fd{e^{x}}∫x dx=x22\int \gi{x}\,dx = \gi{\dfrac{x^2}{2}}
∫x ex dx\displaystyle \int \gi{x}\,\fd{e^{x}}\,dx =x22ex−∫x22ex dx\displaystyle = \gi{\frac{x^2}{2}}\fd{e^{x}} - \int \gi{\frac{x^2}{2}}\fd{e^{x}}\,dx

The equation is true, but the new integral has x2\gi{x^2} instead of xx, because integrating x\gi{x} raised its power. Choosing f=x\fd{f = x} worked because differentiating x\fd{x} gave 1\fd{1}, which got rid of the xx.

With ∫xln⁡x dx\int x\ln x\,dx, the choice is made for us.

Find ∫xln⁡x dx\int x\ln x\,dx
∫xln⁡x dx  \displaystyle \int x\ln x\,dx \;=  ?\displaystyle =\; ?
Text solution
Why not differentiate x\fd{x}?Then g′\gi{g'} would be ln⁡x\gi{\ln x}, and we don't know an antiderivative of ln⁡x\ln x yet.
(x)′=1(\fd{x})' = \fd{1}∫ln⁡x dx=  ?\int \gi{\ln x}\,dx = \;?
Differentiate ln⁡x\fd{\ln x}, integrate x\gi{x}In the new integral, 1x\fd{\frac1x} cancels an xx from x22\gi{\frac{x^2}{2}}, which leaves just x2\frac{x}{2}.
(ln⁡x)′=1x(\fd{\ln x})' = \fd{\dfrac1x}∫x dx=x22\int \gi{x}\,dx = \gi{\dfrac{x^2}{2}}
∫x ln⁡x dx\displaystyle \int \gi{x}\,\fd{\ln x}\,dx =x22ln⁡x−∫x22⋅1x dx\displaystyle = \gi{\frac{x^2}{2}}\fd{\ln x} - \int \gi{\frac{x^2}{2}}\cdot\fd{\frac1x}\,dx
=x22ln⁡x−∫x2 dx\displaystyle = \frac{x^2}{2}\ln x - \int \frac{x}{2}\,dx =x22ln⁡x−x24+C\displaystyle = \frac{x^2}{2}\ln x - \frac{x^2}{4} + 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 ln⁡x\ln x on its own

For ∫xln⁡x dx\int x\ln x\,dx, we differentiated ln⁡x\fd{\ln x} and integrated x\gi{x}. But with ln⁡x\ln x on its own, there's no other factor to be g′\gi{g'}.

Find ∫ln⁡x dx\int \ln x\,dx
∫ln⁡x dx  \displaystyle \int \ln x\,dx \;=  ?\displaystyle =\; ?
Text solution
Write ln⁡x\ln x as ln⁡x⋅1\fd{\ln x}\cdot\gi{1}Now there are two factors, so we differentiate ln⁡x\fd{\ln x} and integrate 1\gi{1}.
(ln⁡x)′=1x(\fd{\ln x})' = \fd{\dfrac1x}∫1 dx=x\int \gi{1}\,dx = \gi{x}
The new integral is ∫1 dx\int 1\,dxInside it, x⋅1x\gi{x}\cdot\fd{\frac1x} cancels to 11.
∫ln⁡x⋅1 dx\displaystyle \int \fd{\ln x}\cdot \gi{1}\,dx =x ln⁡x−∫x⋅1x dx\displaystyle = \gi{x}\,\fd{\ln x} - \int \gi{x}\cdot\fd{\frac1x}\,dx
=xln⁡x−∫1 dx\displaystyle = x\ln x - \int 1\,dx =xln⁡x−x+C\displaystyle = x\ln x - x + C
CheckThe product rule on xln⁡xx\ln x gives ln⁡x+1\ln x + 1, and the 11 cancels with the −1-1 from −x-x.
(xln⁡x−x)′\displaystyle \left(x\ln x - x\right)' =ln⁡x+1−1\displaystyle = \ln x + 1 - 1 =ln⁡x\displaystyle = \ln x

Now we can finish the integral we got stuck on at the start. Letting t=ext = e^x turned ∫xex dx\int x e^x\,dx into ∫ln⁡t dt\int \ln t\,dt, and with ln⁡ex=x\ln e^x = x, it gives the same answer as integration by parts.

t=ex∫ln⁡t dt=tln⁡t−t+C=exln⁡ex−ex+C=xex−ex+C\displaystyle \begin{aligned}t &= e^{x}\\[6pt] \int \ln t\,dt &= t\ln t - t + C\\[6pt] &= e^{x}\ln e^{x} - e^{x} + C\\[6pt] &= x e^{x} - e^{x} + C\end{aligned}

The same trick works for arctan⁡x\arctan x and arcsin⁡x\arcsin x. We don't know their antiderivatives, but their derivatives are simple, 11+x2\fd{\frac{1}{1+x^2}} and 11−x2\fd{\frac{1}{\sqrt{1-x^2}}}. Write each one times 1\gi{1}, differentiate it, and integrate 1\gi{1} to get x\gi{x}.

4

Repeated integration by parts and tabular integration

Now let's raise the power of xx. In ∫x2ex dx\int x^2 e^x\,dx, differentiating x2\fd{x^2} gives 2x\fd{2x}. That lowers the power by 11, but the new integral still has an xx, so one round of integration by parts won't finish it.

Find ∫x2ex dx\int x^2 e^x\,dx
∫x2ex dx  \displaystyle \int x^2 e^x\,dx \;=  ?\displaystyle =\; ?
Text solution
First roundDifferentiate x2\fd{x^2} and integrate ex\gi{e^x}.
∫x2 ex dx\displaystyle \int \fd{x^2}\,\gi{e^{x}}\,dx =x2 ex−∫2x ex dx\displaystyle = \fd{x^2}\,\gi{e^{x}} - \int \fd{2x}\,\gi{e^{x}}\,dx
Use ∫xex dx\int x e^x\,dxPull out the 22, and put in ∫xex dx=xex−ex\int x e^x\,dx = x e^x - e^x. Watch the signs, since −2-2 times −ex-e^x gives +2ex+2e^x.
∫x2ex dx\displaystyle \int x^2 e^{x}\,dx =x2ex−2(xex−ex)+C\displaystyle = x^2 e^{x} - 2\left(x e^{x} - e^{x}\right) + C
=ex(x2−2x+2)+C\displaystyle = e^{x}\left(x^2 - 2x + 2\right) + C

Each round lowered the power of xx by 11 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.

ddx\fd{\dfrac{d}{dx}}
∫\gi{\displaystyle\int}
++
x2\fd{x^2}
ex\gi{e^{x}}
−-
2x\fd{2x}
ex\gi{e^{x}}
++
2\fd{2}
ex\gi{e^{x}}
0\fd{0}
ex\gi{e^{x}}
∫x2ex dx\displaystyle \int x^2 e^{x}\,dx =x2ex−2xex+2ex+C\displaystyle = \fd{x^2}\gi{e^{x}} - \fd{2x}\gi{e^{x}} + \fd{2}\gi{e^{x}} + C

Differentiate x2\fd{x^2} down to 0\fd{0}, integrate ex\gi{e^x} 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\fd{0}, there's no integral left over.

5

When neither factor differentiates to zero

The table finished because x2x^2 differentiated down to 00. With exsin⁡xe^x\sin x, differentiating exe^x keeps giving exe^x, and differentiating sin⁡x\sin x cycles through cos⁡x\cos x and −sin⁡x-\sin x, so neither factor ever reaches 00. Let's name the integral I\I{I} and try integration by parts anyway.

Find ∫exsin⁡x dx\int e^x\sin x\,dx
∫exsin⁡x dx  \displaystyle \int e^x\sin x\,dx \;=  ?\displaystyle =\; ?
Text solution
Two rounds, the same choiceBoth times, differentiate the trig function and integrate ex\gi{e^x}. The second round brings back I\I{I}.
I\displaystyle \I{I} =exsin⁡x−∫excos⁡x dx\displaystyle = \gi{e^{x}}\fd{\sin x} - \int \gi{e^{x}}\fd{\cos x}\,dx
∫excos⁡x dx\displaystyle \int \gi{e^{x}}\fd{\cos x}\,dx =excos⁡x+I\displaystyle = e^{x}\cos x + \I{I}
Solve for I\I{I}Plugging the second round into the first gives I\I{I} on both sides. Add I\I{I} to both sides and divide by 22.
I\displaystyle \I{I} =exsin⁡x−excos⁡x−I\displaystyle = e^{x}\sin x - e^{x}\cos x - \I{I}
I\displaystyle \I{I} =12ex(sin⁡x−cos⁡x)+C\displaystyle = \frac12 e^{x}\left(\sin x - \cos x\right) + C
Why not switch in the second round?Integrating cos⁡x\gi{\cos x} just undoes the derivative from the first round, and we get I=I\I{I} = \I{I}. That's true, but it doesn't tell us what I\I{I} is.
I\displaystyle \I{I} =exsin⁡x−exsin⁡x+I\displaystyle = e^{x}\sin x - e^{x}\sin x + \I{I} =I\displaystyle = \I{I}
6

Definite integrals and unknown functions

When an integral has bounds from aa to bb, every part of the integration by parts formula gets those same bounds, the product fg\fd{f}\gi{g} included.

∫abf g′ dx\displaystyle \int_a^b \fd{f}\,\gi{g'}\,dx =[fg]ab−∫abf′g dx\displaystyle = \Big[\fd{f}\gi{g}\Big]_a^b - \int_a^b \fd{f'}\gi{g}\,dx

Let's use it on ∫01xex dx\int_0^1 x e^x\,dx, and then on a function we don't have a formula for, only a few of its values and its integral.

xx0022
h(x)h(x)3355
∫02h(x) dx\displaystyle \int_0^2 h(x)\,dx =7\displaystyle = 7
Find ∫02x h′(x) dx\int_0^2 x\,h'(x)\,dx using values of hh and ∫02h(x) dx\int_0^2 h(x)\,dx
∫02x h′(x) dx  \displaystyle \int_0^2 x\,h'(x)\,dx \;=  ?\displaystyle =\; ?
Text solution
On ∫01xex dx\int_0^1 x e^x\,dxDon't drop the product term. Without it we'd get −(e−1)-(e - 1), which is negative, but xexx e^x is never negative between 00 and 11.
∫01x ex dx\displaystyle \int_0^1 \fd{x}\,\gi{e^{x}}\,dx =[x ex]01−∫01ex dx\displaystyle = \Big[\fd{x}\,\gi{e^{x}}\Big]_0^1 - \int_0^1 \gi{e^{x}}\,dx
=(e−0)−(e−1)\displaystyle = (e - 0) - (e - 1) =1\displaystyle = 1
On ∫02x h′(x) dx\int_0^2 x\,h'(x)\,dx, differentiate x\fd{x}Differentiating h′(x)h'(x) would give h′′(x)h''(x), which we know nothing about. Integrating h′(x)\gi{h'(x)} gives h(x)\gi{h(x)}, and we have its values.
(x)′=1(\fd{x})' = \fd{1}∫h′(x) dx=h(x)\int \gi{h'(x)}\,dx = \gi{h(x)}
Use the given values
∫02x h′(x) dx\displaystyle \int_0^2 \fd{x}\,\gi{h'(x)}\,dx =[x h(x)]02−∫02h(x) dx\displaystyle = \Big[\fd{x}\,\gi{h(x)}\Big]_0^2 - \int_0^2 \gi{h(x)}\,dx
=(2⋅5−0⋅3)−7\displaystyle = \big(2\cdot 5 - 0\cdot 3\big) - 7 =3\displaystyle = 3
7

Substituting before integrating by parts

Sometimes integration by parts doesn't work on the integral as it's written. In ∫x3ex2 dx\int x^3 e^{x^2}\,dx, neither choice works. We can't integrate ex2\gi{e^{x^2}}, and differentiating ex2\fd{e^{x^2}} makes the new integral worse.

(x3)′=3x2(\fd{x^3})' = \fd{3x^2}∫ex2 dx=  ?\int \gi{e^{x^2}}\,dx = \;?
(ex2)′=2xex2(\fd{e^{x^2}})' = \fd{2x e^{x^2}}∫x3 dx=x44\int \gi{x^3}\,dx = \gi{\dfrac{x^4}{4}}
∫x3ex2 dx\displaystyle \int x^3 e^{x^2}\,dx =x44ex2−12∫x5ex2 dx\displaystyle = \gi{\frac{x^4}{4}}\fd{e^{x^2}} - \frac12\int x^5 e^{x^2}\,dx

Earlier we integrated xex2x e^{x^2} with the substitution t=x2t = x^2. Let's try substituting first here too.

Find ∫x3ex2 dx\int x^3 e^{x^2}\,dx
∫x3ex2 dx  \displaystyle \int x^3 e^{x^2}\,dx \;=  ?\displaystyle =\; ?
Text solution
Substitute t=x2t = x^2Split x3x^3 into x2⋅xx^2 \cdot x. Then x2x^2 becomes tt, and the leftover x dxx\,dx becomes 12 dt\frac12\,dt.
t=x2t = x^2dt=2x dxdt = 2x\,dxx dx=12 dtx\,dx = \dfrac12\,dt
∫x3ex2 dx\displaystyle \int x^3 e^{x^2}\,dx =∫x2ex2⋅x dx\displaystyle = \int x^2 e^{x^2}\cdot x\,dx =12∫t et dt\displaystyle = \frac12\int \fd{t}\,\gi{e^{t}}\,dt
Integrate by parts, then put xx backThis is ∫xex dx\int x e^x\,dx with tt in place of xx.
12∫t et dt\displaystyle \frac12\int \fd{t}\,\gi{e^{t}}\,dt =12(tet−et)+C\displaystyle = \frac12\left(t e^{t} - e^{t}\right) + C
=12ex2(x2−1)+C\displaystyle = \frac12 e^{x^2}\left(x^2 - 1\right) + C

Sometimes there isn't even a product until we substitute.

∫ex dx\displaystyle \int e^{\sqrt{x}}\,dx =  ?\displaystyle = \;?

The inside of exe^{\sqrt{x}} is x\sqrt{x}, so let's try w=xw = \sqrt{x}. Its derivative, 12x\frac{1}{2\sqrt{x}}, isn't in the integral, so there's no factor in the integral that becomes dwdw, the way x dxx\,dx became 12 dt\frac12\,dt. But we don't need one. Instead, we solve for xx, which gives x=w2x = w^2 and dx=2w dwdx = 2w\,dw, so the whole integral is in terms of ww.

w=xw = \sqrt{x}x=w2x = w^2dx=2w dwdx = 2w\,dw
∫ex dx\displaystyle \int e^{\sqrt{x}}\,dx =∫ew⋅2w dw\displaystyle = {\int e^{w}\cdot 2w\,dw} =2∫w ew dw\displaystyle = 2\int w\,e^{w}\,dw

The 2w2w from dxdx gives us a product. Now ∫wew dw\int \fd{w} \gi{e^w}\,dw is just ∫xex dx\int \fd{x} \gi{e^x}\,dx with ww instead of xx. Differentiating w\fd{w} and integrating ew\gi{e^w} gives wew−eww e^w - e^w, and then we replace ww with x\sqrt{x}.

2∫w ew dw\displaystyle 2\int \fd{w}\,\gi{e^{w}}\,dw =2(wew−ew)+C\displaystyle = 2\left(w e^{w} - e^{w}\right) + C =2ex(x−1)+C\displaystyle = 2e^{\sqrt{x}}\left(\sqrt{x} - 1\right) + C
2∫w ew dw=2(wew−ew)+C=2ex(x−1)+C\displaystyle \begin{aligned}2\int \fd{w}\,\gi{e^{w}}\,dw &= 2\left(w e^{w} - e^{w}\right) + C\\ &= 2e^{\sqrt{x}}\left(\sqrt{x} - 1\right) + C\end{aligned}

Summary

The integration by parts formula
Product rule form
∫f g′ dx\displaystyle \int \fd{f}\,\gi{g'}\,dx =fg−∫f′g dx\displaystyle = \fd{f}\gi{g} - \int \fd{f'}\gi{g}\,dx
Differential form
∫u dv\displaystyle \int \fd{u}\,\gi{dv} =uv−∫v du\displaystyle = \fd{u}\gi{v} - \int \gi{v}\,\fd{du}

Integration by parts comes from running the product rule backwards. If we integrate both sides of (fg)′=f′g+fg′(\fd{f}\gi{g})' = \fd{f'}\gi{g} + \fd{f}\gi{g'}, the derivative and integral cancel on the left to give fg\fd{f}\gi{g}. Subtracting ∫f′g dx\int \fd{f'}\gi{g}\,dx leaves the formula, where we differentiate f\fd{f} to get f′\fd{f'} and integrate g′\gi{g'} to get g\gi{g}. In the differential form, u\fd{u} is the name for the factor we differentiate and dv\gi{dv} is the factor we integrate, times dxdx. This u\fd{u} isn't a substitution, and everything stays in terms of xx.

Checking for substitution first
Substitution alone
∫xex2 dx:t=x2, dt=2x dx\displaystyle {\int x e^{x^2}\,dx:\quad t = x^2,\ dt = 2x\,dx}
∫xex2 dx:t=x2, dt=2x dx\displaystyle \begin{aligned}&\int x e^{x^2}\,dx:\\[4pt] &t = x^2,\ dt = 2x\,dx\end{aligned}
Substitution, then integration by parts
∫x3ex2 dx:t=x2  →  12∫t et dt\displaystyle {\int x^3 e^{x^2}\,dx:\quad t = x^2 \;\to\; \frac12\int t\,e^{t}\,dt}
∫x3ex2 dx:t=x2→  12∫t et dt\displaystyle \begin{aligned}&\int x^3 e^{x^2}\,dx:\\[4pt] &t = x^2\\[4pt] &\to\; \frac12\int t\,e^{t}\,dt\end{aligned}
Solving for xx
∫ex dx:w=x, x=w2, dx=2w dw  →  2∫w ew dw\displaystyle {\int e^{\sqrt{x}}\,dx:\quad w = \sqrt{x},\ x = w^2,\ dx = 2w\,dw \;\to\; 2\int w\,e^{w}\,dw}
∫ex dx:w=x, x=w2dx=2w dw→  2∫w ew dw\displaystyle \begin{aligned}&\int e^{\sqrt{x}}\,dx:\\[4pt] &w = \sqrt{x},\ x = w^2\\[4pt] &dx = 2w\,dw\\[4pt] &\to\; 2\int w\,e^{w}\,dw\end{aligned}

If an extra factor is a constant multiple of the inside function's derivative, use uu-substitution instead of integration by parts. In ∫xex2 dx\int x e^{x^2}\,dx, the xx is half the derivative of x2x^2, so we can evaluate the integral with the substitution t=x2t = x^2. For ∫x3ex2 dx\int x^3 e^{x^2}\,dx, split x3x^3 as x2⋅xx^2 \cdot x first. Then t=x2t = x^2 turns x2⋅x dxx^2 \cdot x\,dx into 12t dt\frac12 t\,dt, leaving 12∫tet dt\frac12 \int t e^t\,dt to finish with integration by parts. When the derivative of the inside isn't in the integral, as with x\sqrt{x} in exe^{\sqrt{x}}, solve for xx to write dxdx in the new variable. The two methods often work together. For ∫ex dx\int e^{\sqrt{x}}\,dx, substitution gives an integral we can evaluate by integration by parts. For ∫arctan⁡x dx\int \arctan x\,dx, integration by parts gives a new integral, ∫x1+x2 dx\int \frac{x}{1+x^2}\,dx, and we evaluate it with the substitution t=1+x2t = 1 + x^2.

Choosing which factor to differentiate
Differentiating x
∫x ex dx\displaystyle \int \fd{x}\,\gi{e^{x}}\,dx
(x)′=1(\fd{x})' = \fd{1}∫ex dx=ex\int \gi{e^{x}}\,dx = \gi{e^{x}}
Differentiating ln x
∫x ln⁡x dx\displaystyle \int \gi{x}\,\fd{\ln x}\,dx
(ln⁡x)′=1x(\fd{\ln x})' = \fd{\dfrac1x}∫x dx=x22\int \gi{x}\,dx = \gi{\dfrac{x^2}{2}}

Choose g′\gi{g'} as a factor you can integrate, and choose f\fd{f} so that the new integral, ∫f′g dx\int \fd{f'}\gi{g}\,dx, is simpler than the one you started with. For ∫xex dx\int x e^x\,dx, differentiating x\fd{x} leaves ∫ex dx\int \gi{e^x}\,dx, while differentiating ex\fd{e^x} would leave ∫x22ex dx\int \gi{\frac{x^2}{2}}\fd{e^x}\,dx. When one factor is ln⁡x\ln x, arctan⁡x\arctan x or arcsin⁡x\arcsin x, integrating it is the hard part, but its derivative is just 1x\fd{\frac1x}, 11+x2\fd{\frac{1}{1+x^2}} or 11−x2\fd{\frac{1}{\sqrt{1-x^2}}}. So differentiate that factor, and integrate the other one.

Integrating a single function by parts
∫ln⁡x dx\displaystyle \int \ln x\,dx =∫ln⁡x⋅1 dx\displaystyle = {\int \fd{\ln x}\cdot \gi{1}\,dx} =xln⁡x−x+C\displaystyle = {x\ln x - x + C}

When a single function like ln⁡x\ln x, arctan⁡x\arctan x, or arcsin⁡x\arcsin x appears by itself, write it as that function times 1\gi{1}, and choose g′=1\gi{g' = 1}. Integrating 1\gi{1} gives x\gi{x}, and in the new integral that x\gi{x} multiplies f′\fd{f'}. For ln⁡x\ln x, it cancels the 1x\fd{\frac1x} completely.

Tabular integration
ddx\fd{\dfrac{d}{dx}}
∫\gi{\displaystyle\int}
++
x2\fd{x^2}
ex\gi{e^{x}}
−-
2x\fd{2x}
ex\gi{e^{x}}
++
2\fd{2}
ex\gi{e^{x}}
0\fd{0}
ex\gi{e^{x}}
∫x2ex dx\displaystyle \int x^2 e^{x}\,dx =x2ex−2xex+2ex+C\displaystyle = \fd{x^2}\gi{e^{x}} - \fd{2x}\gi{e^{x}} + \fd{2}\gi{e^{x}} + C

For an integral of xnx^n times exe^x, sin⁡x\sin x, or cos⁡x\cos x, differentiate xn\fd{x^n} repeatedly down to 0\fd{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
I=exsin⁡x−excos⁡x−I2I=ex(sin⁡x−cos⁡x)\displaystyle \begin{aligned}\I{I} &= e^{x}\sin x - e^{x}\cos x - \I{I}\\[6pt] \I{2I} &= e^{x}\left(\sin x - \cos x\right)\end{aligned}

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\I{I} with a minus sign. Then collect the I\I{I} terms on one side and divide by their coefficient. For exsin⁡xe^x\sin x, the coefficient of II is 22, so we divide by 22. Other integrals can give different coefficients. Switching the choice in the second round gives I=I\I{I} = \I{I}, which doesn't tell us what I\I{I} is.

Definite integrals and unknown functions
With bounds
∫abf g′ dx\displaystyle \int_a^b \fd{f}\,\gi{g'}\,dx =[fg]ab−∫abf′g dx\displaystyle = \Big[\fd{f}\gi{g}\Big]_a^b - \int_a^b \fd{f'}\gi{g}\,dx
Unknown function
∫abx h′(x) dx\displaystyle \int_a^b \fd{x}\,\gi{h'(x)}\,dx =[x h(x)]ab−∫abh(x) dx\displaystyle = \Big[\fd{x}\,\gi{h(x)}\Big]_a^b - \int_a^b \gi{h(x)}\,dx

With limits of integration, evaluate both the product term [fg]ab[\fd{f}\gi{g}]_a^b and the new integral with the same bounds. When fg′\fd{f} \gi{g'} is never negative on [a,b][a, b], the answer can't be negative. If you get a negative answer, check whether you forgot the product term [fg]ab[\fd{f}\gi{g}]_a^b. When hh is given only by its values or its graph, evaluate ∫abxh′(x) dx\int_a^b \fd{x} \gi{h'(x)}\,dx by picking g′=h′(x)\gi{g' = h'(x)} so g=h(x)\gi{g = h(x)}, and f=x\fd{f = x} so f′=1\fd{f' = 1}. The formula then gives [xh(x)]ab−∫abh(x) dx[\fd{x} \gi{h(x)}]_a^b - \int_a^b \gi{h(x)}\,dx.

8

Practice

Enter exact values and include +C+ C for indefinite integrals.

1
Evaluate ∫xcos⁡2x dx\displaystyle\int x\cos 2x\,dx.

Differentiating xx gives 11, while differentiating cos⁡2x\cos 2x gives −2sin⁡2x-2\sin 2x. Which choice makes the new integral simpler?

The derivative of sin⁡2x\sin 2x is 2cos⁡2x2\cos 2x, so what is ∫cos⁡2x dx\int \cos 2x\,dx?

If you got xsin⁡2x+12cos⁡2x+Cx\sin 2x + \frac12\cos 2x + C Check the integral of cos⁡2x\cos 2x. Since the derivative of sin⁡2x\sin 2x is 2cos⁡2x2\cos 2x, you need a factor of 12\frac12.

Choose the factorsThe derivative of x\fd{x} is 1\fd{1}, and cos⁡2x\gi{\cos 2x} is easy to integrate, so let f=x\fd{f = x} and g′=cos⁡2x\gi{g' = \cos 2x}.
(x)′=1(\fd{x})' = \fd{1}∫cos⁡2x dx=12sin⁡2x\int \gi{\cos 2x}\,dx = \gi{\dfrac12\sin 2x}
Integrate by partsDifferentiating x\fd{x} got rid of the xx, and that leaves an integral we can evaluate directly.
∫x cos⁡2x dx=x2sin⁡2x−∫12sin⁡2x dx=x2sin⁡2x+14cos⁡2x+C\displaystyle \begin{aligned}&\int \fd{x}\,\gi{\cos 2x}\,dx\\ &= \frac{x}{2}\sin 2x - \int \gi{\frac12\sin 2x}\,dx\\ &= \frac{x}{2}\sin 2x + \frac14\cos 2x + C\end{aligned}
2
Evaluate ∫ln⁡xx2 dx\displaystyle\int \frac{\ln x}{x^2}\,dx.

Write ln⁡xx2\frac{\ln x}{x^2} as ln⁡x⋅x−2\ln x \cdot x^{-2}. Which factor should be ff, so that the new integral has no ln⁡x\ln x in it?

To integrate x−2x^{-2}, add 11 to the power and divide by the new power. What do you get?

If you got ln⁡xx−1x+C\dfrac{\ln x}{x} - \dfrac1x + C Check the sign of the first term. Integrating x−2x^{-2} gives −1x-\frac1x, so fg=ln⁡x⋅(−1x)=−ln⁡xxfg = \ln x \cdot \left(-\frac1x\right) = -\frac{\ln x}{x}.

Choose the factorsThe derivative of ln⁡x\fd{\ln x} is 1x\fd{\frac1x}, which gets rid of the logarithm, and x−2\gi{x^{-2}} is easy to integrate with the power rule. So let f=ln⁡x\fd{f = \ln x} and g′=x−2\gi{g' = x^{-2}}.
ln⁡xx2\displaystyle \frac{\ln x}{x^2} =ln⁡x⋅x−2\displaystyle = \fd{\ln x}\cdot \gi{x^{-2}}
(ln⁡x)′=1x(\fd{\ln x})' = \fd{\dfrac1x}∫x−2 dx=−1x\int \gi{x^{-2}}\,dx = \gi{-\dfrac1x}
Integrate by partsThe two minus signs make a plus, and combining the powers of xx leaves x−2x^{-2} to integrate.
∫ln⁡xx2 dx=−ln⁡xx−∫1x⋅(−1x) dx=−ln⁡xx+∫x−2 dx=−ln⁡xx−1x+C\displaystyle \begin{aligned}\int \frac{\ln x}{x^2}\,dx &= -\frac{\ln x}{x} - \int \fd{\frac1x}\cdot\gi{\Big(-\frac1x\Big)}\,dx\\ &= -\frac{\ln x}{x} + \int x^{-2}\,dx\\ &= -\frac{\ln x}{x} - \frac1x + C\end{aligned}
3
Evaluate ∫arctan⁡x dx\displaystyle\int \arctan x\,dx.

We know the derivative of arctan⁡x\arctan x but not its antiderivative. How can you write the integral as a product so that arctan⁡x\arctan x is the factor you differentiate?

For the new integral ∫x1+x2 dx\int \frac{x}{1+x^2}\,dx, what is the derivative of the denominator 1+x21 + x^2?

If you got xarctan⁡x−ln⁡(1+x2)+Cx\arctan x - \ln(1+x^2) + C Check the substitution in the new integral. If t=1+x2t = 1 + x^2, then dt=2x dxdt = 2x\,dx, so x dxx\,dx is 12 dt\frac12\,dt.

Write as a productWe don't know the antiderivative of arctan⁡x\arctan x, but we know its derivative, so we write arctan⁡x\arctan x as arctan⁡x⋅1\fd{\arctan x} \cdot \gi{1}, with f=arctan⁡x\fd{f = \arctan x} and g′=1\gi{g' = 1}.
arctan⁡x\displaystyle \arctan x =arctan⁡x⋅1\displaystyle = \fd{\arctan x}\cdot \gi{1}
(arctan⁡x)′=11+x2(\fd{\arctan x})' = \fd{\dfrac{1}{1+x^2}}∫1 dx=x\int \gi{1}\,dx = \gi{x}
Integrate by partsPut the pieces into the formula to get the new integral.
∫arctan⁡x dx\displaystyle \int \arctan x\,dx =x arctan⁡x−∫x1+x2 dx\displaystyle = \gi{x}\,\fd{\arctan x} - \int \frac{x}{1+x^2}\,dx
Evaluate the new integralThe derivative of 1+x21 + x^2 is 2x2x, and we have xx in the numerator, so substitute t=1+x2t = 1 + x^2.
t=1+x2t = 1 + x^2dt=2x dxdt = 2x\,dx
∫x1+x2 dx\displaystyle \int \frac{x}{1+x^2}\,dx =12∫dtt\displaystyle = \frac12\int \frac{dt}{t} =12ln⁡(1+x2)\displaystyle = \frac12\ln(1+x^2)
Subtract the new integral from xarctan⁡x\gi{x}\fd{\arctan x} to finish the antiderivative.
∫arctan⁡x dx\displaystyle \int \arctan x\,dx =xarctan⁡x−12ln⁡(1+x2)+C\displaystyle = x\arctan x - \frac12\ln(1+x^2) + C
4
Evaluate ∫ln⁡xx dx\displaystyle\int \frac{\ln x}{x}\,dx.

What is the derivative of ln⁡x\ln x? Is it already in the integral?

The derivative of ln⁡x\ln x is 1x\frac1x, which is already in the integral, so we use a substitution instead of integration by parts.
t=ln⁡xt = \ln xdt=1x dxdt = \dfrac1x\,dx
∫ln⁡xx dx\displaystyle \int \frac{\ln x}{x}\,dx =∫t dt\displaystyle = \int t\,dt =12t2+C\displaystyle = \frac12t^2 + C =12(ln⁡x)2+C\displaystyle = \frac12(\ln x)^2 + C
5
Evaluate ∫x2sin⁡x dx\displaystyle\int x^2\sin x\,dx.

Differentiating x2x^2 repeatedly eventually reaches 00. How many rounds of integration by parts do we need?

In the ∫\int column, what do you get when you integrate sin⁡x\sin x, then integrate the result, then integrate once more? Keep track of every minus sign.

If you got −x2cos⁡x−2xsin⁡x+2cos⁡x+C-x^2\cos x - 2x\sin x + 2\cos x + C Check the sign on the second diagonal. It has a minus sign from the table and a negative entry, −sin⁡x-\sin x, from the ∫\int column, so the two negatives make a plus.

Set up the tableDifferentiating x2\fd{x^2} repeatedly reaches 0\fd{0} after three steps, so we can use a table.
ddx\fd{\dfrac{d}{dx}}
∫\gi{\displaystyle\int}
++
x2\fd{x^2}
sin⁡x\gi{\sin x}
−-
2x\fd{2x}
−cos⁡x\gi{-\cos x}
++
2\fd{2}
−sin⁡x\gi{-\sin x}
0\fd{0}
cos⁡x\gi{\cos x}
Multiply the diagonalsMultiply along each diagonal with its sign, being careful with the double negative on the middle term.
∫x2sin⁡x dx=x2(−cos⁡x)−2x(−sin⁡x)+2cos⁡x+C=−x2cos⁡x+2xsin⁡x+2cos⁡x+C\displaystyle \begin{aligned}&\int x^2\sin x\,dx\\ &= \fd{x^2}\gi{(-\cos x)} - \fd{2x}\gi{(-\sin x)} + \fd{2}\gi{\cos x} + C\\ &= -x^2\cos x + 2x\sin x + 2\cos x + C\end{aligned}
6
A function hh has h(1)=4h(1) = 4, h(3)=9h(3) = 9, h′(1)=2h'(1) = 2 and h′(3)=5h'(3) = 5. Evaluate ∫13x h′′(x) dx\displaystyle\int_1^3 x\,h''(x)\,dx.

In the product x h′′(x)x\,h''(x), what do you get when you integrate h′′(x)h''(x)?

What is ∫13h′(x) dx\int_1^3 h'(x)\,dx in terms of values of hh?

Choose the factorsWe don't have a formula for hh, but integrating h′′(x)\gi{h''(x)} gives h′(x)\gi{h'(x)}, and differentiating x\fd{x} gives 1\fd{1}. So let f=x\fd{f = x} and g′=h′′(x)\gi{g' = h''(x)}.
(x)′=1(\fd{x})' = \fd{1}∫h′′(x) dx=h′(x)\int \gi{h''(x)}\,dx = \gi{h'(x)}
Integrate by partsUse the formula with bounds.
∫13x h′′(x) dx\displaystyle \int_1^3 \fd{x}\,\gi{h''(x)}\,dx =[x h′(x)]13−∫13h′(x) dx\displaystyle = \Big[\fd{x}\,\gi{h'(x)}\Big]_1^3 - \int_1^3 \gi{h'(x)}\,dx
Plug in the given valuesThe product term uses values of h′\gi{h'}, while the integral of h′\gi{h'} gives h(3)−h(1)h(3) - h(1), which uses values of hh.
=(3⋅5−1⋅2)−(h(3)−h(1))=13−(9−4)=8\displaystyle \begin{aligned}&= (3\cdot 5 - 1\cdot 2) - \big(h(3) - h(1)\big)\\ &= 13 - (9 - 4) = 8\end{aligned}
7
Evaluate ∫e2xcos⁡x dx\displaystyle\int e^{2x}\cos x\,dx.

Neither factor ever differentiates to 00. Call the integral II. What happens if you integrate by parts twice, differentiating the trig factor both times?

You should reach I=12e2xcos⁡x+14e2xsin⁡x−14II = \frac12e^{2x}\cos x + \frac14e^{2x}\sin x - \frac14 I. What do you get when you add 14I\frac14 I to both sides?

If you got e2x(2cos⁡x+sin⁡x)8+C\dfrac{e^{2x}(2\cos x + \sin x)}{8} + C Check the coefficient when solving for II. Adding 14I\frac14 I to II gives 54I\frac54 I, not 2I2I.

First round of integration by partsCall the integral I\I{I}, and differentiate the trig factor, cos⁡x\fd{\cos x}, while integrating e2x\gi{e^{2x}}.
I\displaystyle \I{I} =∫e2xcos⁡x dx\displaystyle = \int \gi{e^{2x}}\fd{\cos x}\,dx
(cos⁡x)′=−sin⁡x(\fd{\cos x})' = \fd{-\sin x}∫e2x dx=12e2x\int \gi{e^{2x}}\,dx = \gi{\dfrac12e^{2x}}
I\displaystyle \I{I} =12e2xcos⁡x+12∫e2xsin⁡x dx\displaystyle = \gi{\frac12e^{2x}}\fd{\cos x} + \frac12\int e^{2x}\sin x\,dx
Second round of integration by partsDifferentiate the trig factor again, so the second round doesn't undo the first.
(sin⁡x)′=cos⁡x(\fd{\sin x})' = \fd{\cos x}∫e2x dx=12e2x\int \gi{e^{2x}}\,dx = \gi{\dfrac12e^{2x}}
∫e2xsin⁡x dx\displaystyle \int \gi{e^{2x}}\fd{\sin x}\,dx =12e2xsin⁡x−12I\displaystyle = \gi{\frac12e^{2x}}\fd{\sin x} - \frac12 \I{I}
Substitute back into I\I{I}Plug the second round into the equation for I\I{I} and distribute the 12\frac12.
I\displaystyle \I{I} =12e2xcos⁡x+14e2xsin⁡x−14I\displaystyle = \frac12e^{2x}\cos x + \frac14e^{2x}\sin x - \frac14 \I{I}
Solve for I\I{I}Add 14I\frac14 \I{I} to both sides to get 54I\frac54 \I{I}, then multiply by 45\frac45.
54I=14e2x(2cos⁡x+sin⁡x)I=e2x(2cos⁡x+sin⁡x)5+C\displaystyle \begin{aligned}\frac54 \I{I} &= \frac14e^{2x}(2\cos x + \sin x)\\ \I{I} &= \frac{e^{2x}(2\cos x + \sin x)}{5} + C\end{aligned}
8
Evaluate ∫sin⁡x dx\displaystyle\int \sin\sqrt{x}\,dx.

In ∫sin⁡xx dx\int \frac{\sin\sqrt{x}}{\sqrt{x}}\,dx, the 1x\frac{1}{\sqrt{x}} would let you substitute w=xw = \sqrt{x} directly. Here it's missing. What is dxdx if you solve w=xw = \sqrt{x} for xx?

Once the integral is in terms of ww, which factor should you differentiate?

If you got sin⁡x−xcos⁡x+C\sin\sqrt{x} - \sqrt{x}\cos\sqrt{x} + C Check dxdx. Differentiating x=w2x = w^2 gives dx=2w dwdx = 2w\,dw, so don't drop the factor of 22.

Substitute to clear the rootThe inside of the sine is x\sqrt{x}, so let w=xw = \sqrt{x}. Its derivative isn't in the integral, so solve for xx. From x=w2x = w^2, we get dx=2w dwdx = 2w\,dw, and the 2w2w gives us a product.
w=xw = \sqrt{x}x=w2x = w^2dx=2w dwdx = 2w\,dw
∫sin⁡x dx\displaystyle \int \sin\sqrt{x}\,dx =∫sin⁡w⋅2w dw\displaystyle = \int \sin w\cdot 2w\,dw =2∫wsin⁡w dw\displaystyle = 2\int w\sin w\,dw
Integrate by parts and put xx backDifferentiating w\fd{w} gives 1\fd{1}, so let f=w\fd{f = w} and g′=sin⁡w\gi{g' = \sin w}. Then substitute x\sqrt{x} back in for ww.
(w)′=1(\fd{w})' = \fd{1}∫sin⁡w dw=−cos⁡w\int \gi{\sin w}\,dw = \gi{-\cos w}
2∫w sin⁡w dw=2(−wcos⁡w+∫cos⁡w dw)=2(sin⁡w−wcos⁡w)+C=2sin⁡x−2xcos⁡x+C\displaystyle \begin{aligned}2\int \fd{w}\,\gi{\sin w}\,dw &= 2\Big(-w\cos w + \int \cos w\,dw\Big)\\ &= 2\left(\sin w - w\cos w\right) + C\\ &= 2\sin\sqrt{x} - 2\sqrt{x}\cos\sqrt{x} + C\end{aligned}
9
The region under y=cos⁡xy = \cos x from x=0x = 0 to x=π2x = \frac{\pi}{2} is rotated about the yy-axis. Find the volume of the solid. (Challenge)

For cylindrical shells around the yy-axis, what are the radius and height of a shell at xx?

In ∫0π2xcos⁡x dx\int_0^{\frac{\pi}{2}} x\cos x\,dx, which choice of ff makes the new integral simpler?

Set up the volume with shellsRotating a thin vertical rectangle at xx around the yy-axis gives a cylindrical shell with radius xx and height cos⁡x\cos x.
radius x,height cos⁡x\displaystyle \text{radius } x,\qquad \text{height } \cos x
V\displaystyle V =2π∫0π2xcos⁡x dx\displaystyle = 2\pi\int_0^{\frac{\pi}{2}} x\cos x\,dx
Integrate by partsLet f=x\fd{f = x} and g′=cos⁡x\gi{g' = \cos x}, then evaluate the new integral of sin⁡x\gi{\sin x}.
(x)′=1(\fd{x})' = \fd{1}∫cos⁡x dx=sin⁡x\int \gi{\cos x}\,dx = \gi{\sin x}
∫0π2x cos⁡x dx\displaystyle \int_0^{\frac{\pi}{2}} \fd{x}\,\gi{\cos x}\,dx =[x sin⁡x]0π2−∫0π2sin⁡x dx\displaystyle = \Big[\fd{x}\,\gi{\sin x}\Big]_0^{\frac{\pi}{2}} - \int_0^{\frac{\pi}{2}}\gi{\sin x}\,dx =[xsin⁡x+cos⁡x]0π2\displaystyle = \Big[x\sin x + \cos x\Big]_0^{\frac{\pi}{2}}
Evaluate at the boundsPlug in the bounds, remembering that cos⁡0=1\cos 0 = 1, and multiply by 2π2\pi.
[xsin⁡x+cos⁡x]0π2=(π2+0)−(0+1)=π2−1\displaystyle \begin{aligned}\Big[x\sin x + \cos x\Big]_0^{\frac{\pi}{2}} &= \Big(\frac{\pi}{2} + 0\Big) - (0 + 1)\\ &= \frac{\pi}{2} - 1\end{aligned}
V\displaystyle V =2π(π2−1)\displaystyle = 2\pi\Big(\frac{\pi}{2} - 1\Big) =π2−2π\displaystyle = \pi^2 - 2\pi