Integration by Parts

The product rule, integrated, says ∫u dv = uv − ∫v du: one integral exchanged for another. Pick a product and a choice of u, and the page runs the exchange round by round beside the other choice, so you can see one ladder close and the other get worse. Then step through one example and try your own.

Integration by parts ∫u dv=uv−∫v du\int u\,dv=uv-\int v\,du
Definite ∫abu v′ dx=[uv]ab−∫abu′ v dx\int_{a}^{b}u\,v'\,dx=\Bigl[uv\Bigr]_{a}^{b}-\int_{a}^{b}u'\,v\,dx
Loading interactive simulation...

Lesson

The theory — Integration by Parts

Integration by parts is the product rule integrated. From (uv)′ = u′v + uv′ it follows that ∫u dv = uv − ∫v du, where du = u′(x) dx and dv = v′(x) dx. It exchanges one integral for another, and helps when ∫v du is easier: u should become simpler when differentiated, and dv must be something you can integrate.

What each symbol means

u
the factor that is differentiated
dv
the rest of the integrand with dx, which is integrated to give v

Where the formula comes from

  1. Where the formula comes from. Integrate both sides of (uv)′ = u′v + uv′ to get uv = ∫v du + ∫u dv, and move ∫v du to the other side.
    (uv)′=u′v+uv′ ⇒ uv=∫v du+∫u dv ⇒ ∫u dv=uv−∫v du(uv)'=u'v+uv'\ \Rightarrow\ uv=\int v\,du+\int u\,dv\ \Rightarrow\ \int u\,dv=uv-\int v\,du
  2. Several rounds. Each round adds a boundary term, with alternating signs: ∫f dx = B1 − B2 + B3 − … ± ∫gK dx, where gK is the integral left after K rounds. That is the running equation the ladder prints. When gK is a multiple λ of f, the equation contains ∫f dx on both sides and can be solved unless the two cancel.
    ∫f dx=B1−B2+⋯±∫gK dx,gK=λf ⇒ (1∓λ)∫f dx=B1−B2+⋯\int f\,dx=B_1-B_2+\cdots\pm\int g_K\,dx,\qquad g_K=\lambda f\ \Rightarrow\ (1\mp\lambda)\int f\,dx=B_1-B_2+\cdots

Problems solved in full

  1. One round 3 steps

    Find ∫x e2x dx.

    Open this problem in the tool

    1. The x gets simpler when differentiated, so it is u; e2x integrates easily, so it is dv:

      u=x,du=dx;dv=e2x dx,v=12e2xu=x,\quad du=dx;\qquad dv=e^{2x}\,dx,\quad v=\tfrac12e^{2x}
    2. One round of uv − ∫v du:

      ∫x e2x dx=12x e2x−∫12e2x dx\int x\,e^{2x}\,dx=\tfrac12x\,e^{2x}-\int\tfrac12e^{2x}\,dx
    3. The integral left is in the table:

      =12x e2x−14e2x+C=\tfrac12x\,e^{2x}-\tfrac14e^{2x}+C

    Answer

    e2x(x/2 − 1/4) + C. Forgetting the second ½, the one that comes from integrating e2x again, gives −1/2 where −1/4 belongs.

    ∫x e2x dx=e2x(x2−14)+C\int x\,e^{2x}\,dx=e^{2x}\left(\frac{x}{2}-\frac14\right)+C
  2. A power times a sine 3 steps

    Find ∫x sin 2x dx.

    Open this problem in the tool

    Show solution
    1. u = x again; dv = sin 2x dx integrates to −½ cos 2x:

      u=x,du=dx;dv=sin⁡2x dx,v=−12cos⁡2xu=x,\quad du=dx;\qquad dv=\sin2x\,dx,\quad v=-\tfrac12\cos2x
    2. One round, with the sign of v carried through:

      ∫xsin⁡2x dx=−12xcos⁡2x+∫12cos⁡2x dx\int x\sin2x\,dx=-\tfrac12x\cos2x+\int\tfrac12\cos2x\,dx
    3. The integral left is in the table:

      =−12xcos⁡2x+14sin⁡2x+C=-\tfrac12x\cos2x+\tfrac14\sin2x+C

    Answer

    −(x/2) cos 2x + (1/4) sin 2x + C. The minus in v = −½ cos 2x is where the sign goes wrong; the tool calls the answer with every sign flipped exactly that, a wrong sign.

    ∫xsin⁡2x dx=−x2cos⁡2x+14sin⁡2x+C\int x\sin2x\,dx=-\frac{x}{2}\cos2x+\frac14\sin2x+C
  3. Two rounds 3 steps

    Find ∫x² cos x dx.

    Open this problem in the tool

    Show solution
    1. Round one, u = x²: the power drops to 1.

      u=x2, dv=cos⁡x dx:∫x2cos⁡x dx=x2sin⁡x−2∫xsin⁡x dxu=x^{2},\ dv=\cos x\,dx:\quad \int x^{2}\cos x\,dx=x^{2}\sin x-2\int x\sin x\,dx
    2. Round two, on ∫x sin x, u = x: the power drops to 0.

      u=x, dv=sin⁡x dx:∫xsin⁡x dx=−xcos⁡x+sin⁡xu=x,\ dv=\sin x\,dx:\quad \int x\sin x\,dx=-x\cos x+\sin x
    3. Put the two rounds together:

      x2sin⁡x−2(−xcos⁡x+sin⁡x)=x2sin⁡x+2xcos⁡x−2sin⁡xx^{2}\sin x-2\left(-x\cos x+\sin x\right)=x^{2}\sin x+2x\cos x-2\sin x

    Answer

    x² sin x + 2x cos x − 2 sin x + C. Each round lowers the power of x by one, so x² needs two rounds and xⁿ needs n. Keep the brackets until the end: the sign of the last term is where the slips happen.

    ∫x2cos⁡x dx=x2sin⁡x+2xcos⁡x−2sin⁡x+C\int x^{2}\cos x\,dx=x^{2}\sin x+2x\cos x-2\sin x+C
  4. ln x is u, whatever it is multiplied by 3 steps

    Find ∫x² ln x dx for x > 0.

    Open this problem in the tool

    Show solution
    1. ln x has no simple antiderivative to use as v, so it must be u; dv = x² dx:

      u=ln⁡x,du=dxx;dv=x2 dx,v=x33u=\ln x,\quad du=\frac{dx}{x};\qquad dv=x^{2}\,dx,\quad v=\frac{x^{3}}{3}
    2. One round. The x³ and the 1/x combine into a power:

      ∫x2ln⁡x dx=x33ln⁡x−∫x33⋅1x dx\int x^{2}\ln x\,dx=\frac{x^{3}}{3}\ln x-\int\frac{x^{3}}{3}\cdot\frac{1}{x}\,dx
    3. The integral left is a power:

      =x33ln⁡x−∫x23 dx=x33ln⁡x−x39+C=\frac{x^{3}}{3}\ln x-\int\frac{x^{2}}{3}\,dx=\frac{x^{3}}{3}\ln x-\frac{x^{3}}{9}+C

    Answer

    (x³/3) ln x − x³/9 + C. LIATE puts the logarithm before the algebraic factor for the reason in the first step: differentiating ln x turns it into the power 1/x, which the x³ from v then absorbs.

    ∫x2ln⁡x dx=x33ln⁡x−x39+C\int x^{2}\ln x\,dx=\frac{x^{3}}{3}\ln x-\frac{x^{3}}{9}+C
  5. ∫arctan x, which ends in a substitution 3 steps

    Find ∫arctan x dx.

    Open this problem in the tool

    Show solution
    1. As with ln x, write it as 1·arctan x, with u = arctan x and dv = 1·dx:

      u=arctan⁡x,du=dx1+x2;dv=dx,v=xu=\arctan x,\quad du=\frac{dx}{1+x^{2}};\qquad dv=dx,\quad v=x
    2. One round:

      ∫arctan⁡x dx=xarctan⁡x−∫x1+x2 dx\int\arctan x\,dx=x\arctan x-\int\frac{x}{1+x^{2}}\,dx
    3. The integral left is a substitution, w = 1 + x², dw = 2x dx:

      ∫x1+x2 dx=12∫dww=12ln⁡(1+x2)\int\frac{x}{1+x^{2}}\,dx=\tfrac12\int\frac{dw}{w}=\tfrac12\ln\left(1+x^{2}\right)

    Answer

    x arctan x − ½ ln(1 + x²) + C. No bars on the logarithm, because 1 + x² is never negative.

    ∫arctan⁡x dx=xarctan⁡x−12ln⁡(1+x2)+C\int\arctan x\,dx=x\arctan x-\tfrac12\ln\left(1+x^{2}\right)+C
  6. A cyclic integral with two different rates 3 steps

    Find ∫e2x sin x dx.

    Open this problem in the tool

    Show solution
    1. Call it I. Round one with u = sin x, dv = e2x dx:

      I=∫e2xsin⁡x dx=12e2xsin⁡x−12∫e2xcos⁡x dxI=\int e^{2x}\sin x\,dx=\tfrac12e^{2x}\sin x-\tfrac12\int e^{2x}\cos x\,dx
    2. Round two on ∫e2x cos x dx, again with the trigonometric factor as u:

      ∫e2xcos⁡x dx=12e2xcos⁡x+12 I\int e^{2x}\cos x\,dx=\tfrac12e^{2x}\cos x+\tfrac12\,I
    3. The integral is back, a quarter of it. Solve for I:

      I=12e2xsin⁡x−14e2xcos⁡x−14I ⇒ 54I=14e2x(2sin⁡x−cos⁡x)I=\tfrac12e^{2x}\sin x-\tfrac14e^{2x}\cos x-\tfrac14I\ \Rightarrow\ \tfrac54I=\tfrac14e^{2x}(2\sin x-\cos x)

    Answer

    e2x(2 sin x − cos x)/5 + C. The 5 is 2² + 1², which is how the two rates enter: for eax sin bx the divisor is a² + b². Keep u trigonometric in both rounds; switching to u = e2x in the second undoes the first, as the Undo preset shows for eˣ sin x.

    ∫e2xsin⁡x dx=e2x(2sin⁡x−cos⁡x)5+C\int e^{2x}\sin x\,dx=\frac{e^{2x}(2\sin x-\cos x)}{5}+C
  7. A definite integral, boundary term evaluated 2 steps

    Evaluate ∫0π x sin x dx.

    Show solution
    1. u = x, dv = sin x dx, v = −cos x. The boundary term is evaluated between the limits too:

      ∫0πxsin⁡x dx=[−xcos⁡x]0π+∫0πcos⁡x dx\int_{0}^{\pi}x\sin x\,dx=\Bigl[-x\cos x\Bigr]_{0}^{\pi}+\int_{0}^{\pi}\cos x\,dx
    2. Both parts at the limits:

      =(−πcos⁡π+0)+[sin⁡x]0π=π+0=\left(-\pi\cos\pi+0\right)+\Bigl[\sin x\Bigr]_{0}^{\pi}=\pi+0

    Answer

    π. The boundary term gives all of it, π, and the integral left gives 0, because sin π = sin 0 = 0.

    ∫0πxsin⁡x dx=π\int_{0}^{\pi}x\sin x\,dx=\pi
  8. A recurrence that is exact, and arithmetic that is not 4 steps

    One round of parts on In = ∫01 xⁿeˣ dx, with u = xⁿ, gives In = e − n·In−1. Use it to find I4. Then run it ten times from I0 = e − 1 rounded to 1.7183, and see what I10 comes out as. Press The power falls: the page finds I2 = 0.7183 in two rounds.

    Open this problem in the tool

    Show solution
    1. One round with u = xⁿ and dv = eˣ dx, between 0 and 1:

      In=[xnex]01−n∫01xn−1ex dx=e−n In−1I_n=\Big[x^{n}e^{x}\Big]_0^1-n\int_0^1 x^{n-1}e^{x}\,dx=e-n\,I_{n-1}
    2. Two more rounds from the page's I2:

      I3=e−3 (e−2)=6−2e=0.5634,I4=e−4 (6−2e)=9e−24=0.4645I_3=e-3\,(e-2)=6-2e=0{.}5634,\qquad I_4=e-4\,(6-2e)=9e-24=0{.}4645
    3. Now forward from the rounded start. Nine rounds in, the integral of a positive function has come out negative:

      I0=1.7183 ⇒ … I9=−6.3451,I10=66.1689I_0=1{.}7183\ \Rightarrow\ \dots\ I_9=-6{.}3451,\qquad I_{10}=66{.}1689
    4. The start was off by 1.8172×10⁻⁵, and every round multiplies the error by n, ten rounds by 10!:

      1.8172×10−5×10!=1.8172×10−5×3,628,800=65.94,0.2280+65.94=66.171{.}8172\times10^{-5}\times10!=1{.}8172\times10^{-5}\times3{,}628{,}800=65{.}94,\qquad 0{.}2280+65{.}94=66{.}17

    Answer

    I4 = 9e − 24 ≈ 0.4645, and I10 is really 0.2280. The recurrence is exact; run forwards, it multiplies a rounding error by n!. Run it backwards, In−1 = (e − In)/n, and the error is divided by n each step instead: starting from the crude guess I20 = 0 gives I10 = 0.2280 to four decimals. The page stops after three rounds.

    I4=9e−24≈0.4645,I10≈0.2280I_4=9e-24\approx0{.}4645,\qquad I_{10}\approx0{.}2280

Supplementary problems, answers only

  1. Find ∫ ln x dx.

    Show answer

    x ln x − x + C, with u = ln x and dv = dx.

    xln⁡x−x+Cx\ln x-x+C
  2. Find ∫ x²eˣ dx.

    Show answer

    eˣ(x² − 2x + 2) + C, after two rounds.

    ex(x2−2x+2)+Ce^{x}\left(x^{2}-2x+2\right)+C
  3. Find ∫ x sec²x dx.

    Show answer

    x tan x + ln|cos x| + C. The integral left after one round is ∫ tan x dx, a substitution.

    xtan⁡x+ln⁡∣cos⁡x∣+Cx\tan x+\ln|\cos x|+C
  4. Evaluate ∫1e x ln x dx.

    Show answer

    (e² + 1)/4 ≈ 2.0973.

    ∫1exln⁡x dx=e2+14≈2.0973\int_{1}^{e}x\ln x\,dx=\frac{e^{2}+1}{4}\approx2{.}0973
  5. Find ∫ (ln x)² dx.

    Show answer

    x(ln x)² − 2x ln x + 2x + C. The first round leaves ∫ 2 ln x dx, which is the first problem in this list, doubled.

    x(ln⁡x)2−2xln⁡x+2x+Cx(\ln x)^{2}-2x\ln x+2x+C

Choose u badly and the power of x climbs

Press The power falls. The integral is x²eˣ, and u = x² is the choice that differentiates the power away: the first round leaves 2x·eˣ, the second leaves 2eˣ, which is in the table, and the answer (x² − 2x + 2)eˣ arrives in two rounds. From 0 to 1 it gives 0.7183, and so does Simpson's rule. The faded ladder makes the other choice, u = eˣ. Differentiating eˣ changes nothing, so nothing gets simpler, and the power is integrated upwards instead: x³eˣ/3, x⁴eˣ/12, x⁵eˣ/60, while the chart's dashed line climbs and the solid one falls to zero. LIATE (logarithmic, inverse trigonometric, algebraic, trigonometric, exponential) is that test written as a list: first comes whatever becomes simpler when differentiated. The table under the results runs it on fifteen products, and the LIATE choice lowers the power of x, or removes the ln or arctan, in all fifteen. Count symbols instead and it wins 13, ties x³eˣ and loses x³ sin x, 9 symbols against 8, so the length of the integral left is the wrong thing to measure.

∫eˣ sin x comes back as itself, and is solved as an equation

Press Comes back. Neither eˣ nor sin x gets simpler when differentiated, so take u = sin x and see what happens. One round leaves ∫eˣ cos x. A second round, with u = cos x, leaves −∫eˣ sin x: the integral you started with, carrying a minus sign. The ladder never reaches the table and does not have to. Call the integral I; the running equation now says I = eˣ sin x − eˣ cos x − I, so 2I = eˣ(sin x − cos x) and I = eˣ(sin x − cos x)/2. From 0 to 1 that gives 0.9093, which Simpson's rule confirms. Now press Undo: the same first round, then u = eˣ in the second. That round integrates back the cos x the first one produced, its boundary term eˣ sin x cancels the first one's, and the equation left is I = I, which is true and tells you nothing.

∫ln x needs a factor of 1 nobody wrote

Press ln x with dv = 1·dx. ln x looks like a single function, and parts seems to need two. Write it as 1·ln x, with u = ln x, which becomes 1/x when differentiated, and dv = 1·dx, which integrates to x. Then ∫ln x dx = x ln x − ∫x·(1/x) dx = x ln x − x, in one round, and from 1 to 2 the area is 2 ln 2 − 1 = 0.3863 both ways. The other assignment, u = 1 with dv = ln x dx, needs v = ∫ln x dx, the very integral being asked for, which is why the faded ladder stops before it starts. In the trainer, x ln x has been typed: its derivative is ln x + 1, one more than the integrand everywhere, the −∫1 dx that was forgotten. The same trick does ∫arctan x, and x arctan x shows where parts hands over: with u = arctan x one round leaves x²/(2(1 + x²)), a rational function, the next rung's job.

Learning path

Techniques of integration

References (2)