MAT1051 · Week 13 · Integration by Parts, Integration by Partial Fractions

Integration by parts and partial fractions

Integration by parts for products (LIATE, the tabular method, cyclic integrals) and partial fractions for integrating rational functions. The long integral questions of the final.

integration by partsLIATEtabular integrationreductionrational functionpartial fractionsproper fractionlong divisionrepeated linear factorirreducible quadratic factorcompleting the square

In week 12, substitution was the reverse of the chain rule. This week there are two new techniques. Integration by parts is the reverse of the product rule; it solves integrals like x exx\,e^x, xsin⁡xx\sin x, ln⁡x\ln x. Partial fractions breaks a rational function into pieces that are easy to integrate. The final has long but mechanical questions on both; whoever chooses the right start gets the result:

  1. ∫u dv=uv−∫v du\int u\,dv=uv-\int v\,du. Choose uu in LIATE order.
  2. The integral left after parts should be easier. If it got harder, you chose uu the wrong way round.
  3. For a rational function, first look at the degrees: if the numerator is larger or equal, divide first.
  4. The type of the denominator’s factors determines the shape of the fractions.

Integration by parts

Product rule: (uv)′=u′v+uv′(uv)'=u'v+uv'. Integrate both sides and rearrange:

∫u dv=uv−∫v du\int u\,dv=uv-\int v\,du

For a definite integral:

∫abu dv=[uv]ab−∫abv du\int_a^bu\,dv=\Big[uv\Big]_a^b-\int_a^bv\,du

The idea: split the integrand into two parts. Let uu be the part that simplifies when differentiated, and dvdv the part that can be integrated.

Choosing uu: LIATE

The one that comes first in the list becomes uu:

LetterTypeExample
LLogarithmicln⁡x\ln x
IInverse trigonometricarctan⁡x\arctan x, arcsin⁡x\arcsin x
AAlgebraicxx, x2x^2, x\sqrt x
TTrigonometricsin⁡x\sin x, cos⁡x\cos x
EExponentialexe^x, 2x2^x

Example 1. ∫xsin⁡x dx\displaystyle\int x\sin x\,dx. A comes before T: u=xu=x, dv=sin⁡x dxdv=\sin x\,dx.

u = x          dv = sin x dx
du = dx        v = -cos x
∫ x sin x dx = -x cos x - ∫ (-cos x) dx = -x cos x + sin x + C

If you had chosen the other way round (u=sin⁡xu=\sin x, dv=x dxdv=x\,dx), the remaining integral would be ∫x22cos⁡x dx\int\tfrac{x^2}{2}\cos x\,dx, which is harder.

Example 2. ∫x2ln⁡x dx\displaystyle\int x^2\ln x\,dx. L comes before A: u=ln⁡xu=\ln x, dv=x2dxdv=x^2dx, v=x33v=\tfrac{x^3}{3}.

∫x2ln⁡x dx=x33ln⁡x−∫x33⋅1x dx=x3ln⁡x3−x39+C\int x^2\ln x\,dx=\frac{x^3}{3}\ln x-\int\frac{x^3}{3}\cdot\frac1x\,dx=\frac{x^3\ln x}{3}-\frac{x^3}{9}+C

ln⁡x\ln x is hard to integrate and easy to differentiate. That is why the logarithm is always uu.

The tabular method

For xnx^n times eaxe^{ax}, sin⁡ax\sin ax or cos⁡ax\cos ax, you would have to do integration by parts nn times. The table speeds this up: in the left column differentiate uu until it reaches zero, in the right column integrate dvdv repeatedly, multiply diagonally, and alternate the signs +,−,+,−+,-,+,-.

Example 3. ∫x3ex dx\displaystyle\int x^3e^x\,dx.

derivative   integral     sign
x^3          e^x
3x^2         e^x            +   ->  x^3 e^x
6x           e^x            -   ->  3x^2 e^x
6            e^x            +   ->  6x e^x
0            e^x            -   ->  6 e^x
result: e^x (x^3 - 3x^2 + 6x - 6) + C

Cyclic integrals

For eaxsin⁡bxe^{ax}\sin bx or eaxcos⁡bxe^{ax}\cos bx, after two integrations by parts the integral you started with comes back. Then call the integral II and solve the equation.

Example 4. I=∫e2xcos⁡x dxI=\displaystyle\int e^{2x}\cos x\,dx.

First step: u=e2xu=e^{2x}, dv=cos⁡x dxdv=\cos x\,dx. I=e2xsin⁡x−2∫e2xsin⁡x dxI=e^{2x}\sin x-2\int e^{2x}\sin x\,dx.

Second step (same choice logic, u=e2xu=e^{2x}): ∫e2xsin⁡x dx=−e2xcos⁡x+2I\int e^{2x}\sin x\,dx=-e^{2x}\cos x+2I.

Combine: I=e2xsin⁡x−2(−e2xcos⁡x+2I)=e2xsin⁡x+2e2xcos⁡x−4II=e^{2x}\sin x-2(-e^{2x}\cos x+2I)=e^{2x}\sin x+2e^{2x}\cos x-4I. So 5I=e2x(sin⁡x+2cos⁡x)5I=e^{2x}(\sin x+2\cos x):

I=e2x(2cos⁡x+sin⁡x)5+CI=\frac{e^{2x}(2\cos x+\sin x)}{5}+C

PITFALL · changing uu in the second step. In a cyclic integral, if you chose u=e2xu=e^{2x} in the first step, make the exponential part uu in the second step too. If you switch, you undo the first step and get I=II=I.

Example 5 (definite). ∫01xex dx=[xex]01−∫01ex dx=e−(e−1)=1\displaystyle\int_0^1xe^x\,dx=\Big[xe^x\Big]_0^1-\int_0^1e^x\,dx=e-(e-1)=1.

Partial fractions

Of the form P(x)Q(x)\dfrac{P(x)}{Q(x)}, with PP and QQ polynomials. Strategy: write the fraction as a sum of simple fractions whose denominators are the factors of QQ. The integral of each piece gives ln⁡\ln or arctan⁡\arctan.

Step 0: check the degrees

If the numerator’s degree is larger than or equal to the denominator’s, first do polynomial division: PQ=(quotient)+remainderQ\dfrac PQ=(\text{quotient})+\dfrac{\text{remainder}}{Q}. The decomposition is applied only to the remainder fraction.

Factor types

In the denominatorWritten in the fractions
(x−a)(x-a)Ax−a\dfrac{A}{x-a}
(x−a)2(x-a)^2Ax−a+B(x−a)2\dfrac{A}{x-a}+\dfrac{B}{(x-a)^2}
x2+bx+cx^2+bx+c (irreducible)Bx+Cx2+bx+c\dfrac{Bx+C}{x^2+bx+c}

To find the coefficients, multiply both sides by the denominator. Then plug in the roots of the denominator (each root gives one coefficient directly), and for the remaining coefficients equate coefficients such as the x2x^2 and constant terms.

Example 6 (distinct linear factors). ∫3x−1x2−x−2 dx\displaystyle\int\frac{3x-1}{x^2-x-2}\,dx.

x^2 - x - 2 = (x - 2)(x + 1)
(3x - 1) = A(x + 1) + B(x - 2)
x = 2:   5 = 3A   ->  A = 5/3
x = -1: -4 = -3B  ->  B = 4/3
∫ = (5/3) ln|x - 2| + (4/3) ln|x + 1| + C

Example 7 (repeated factor). ∫2x+3(x+1)2 dx\displaystyle\int\frac{2x+3}{(x+1)^2}\,dx.

2x+3=A(x+1)+B2x+3=A(x+1)+B. x=−1x=-1: B=1B=1. Coefficient of xx: A=2A=2. So 2x+1+1(x+1)2\dfrac{2}{x+1}+\dfrac{1}{(x+1)^2}, and the integral is 2ln⁡∣x+1∣−1x+1+C2\ln|x+1|-\dfrac{1}{x+1}+C.

Example 8 (irreducible quadratic). ∫x2+2x+3x(x2+1) dx\displaystyle\int\frac{x^2+2x+3}{x(x^2+1)}\,dx.

x2+2x+3=A(x2+1)+(Bx+C)xx^2+2x+3=A(x^2+1)+(Bx+C)x. x=0x=0: A=3A=3. x2x^2: 1=A+B⇒B=−21=A+B \Rightarrow B=-2. xx: 2=C2=C. The fractions are 3x+−2x+2x2+1\dfrac3x+\dfrac{-2x+2}{x^2+1}:

∫=3ln⁡∣x∣−ln⁡(x2+1)+2arctan⁡x+C\int=3\ln|x|-\ln(x^2+1)+2\arctan x+C

The part −2xx2+1\dfrac{-2x}{x^2+1} gave −ln⁡(x2+1)-\ln(x^2+1) by substitution (u=x2+1u=x^2+1), and the part 2x2+1\dfrac{2}{x^2+1} gave 2arctan⁡x2\arctan x.

PITFALL · writing only a constant in the numerator of an irreducible factor. If you write Cx2+1\dfrac{C}{x^2+1}, the equation won’t match. The numerator of a quadratic factor is always Bx+CBx+C.

TIP · complete the square in the denominator. For an irreducible x2+bx+cx^2+bx+c write (x+b2)2+k2\left(x+\tfrac b2\right)^2+k^2. ∫dxu2+k2=1karctan⁡uk+C\displaystyle\int\frac{dx}{u^2+k^2}=\frac1k\arctan\frac uk+C.

Common mistakes

Wrong thinkingCorrect
∫xex=x22ex\int x e^x=\tfrac{x^2}{2}e^xThe integral of a product is not the product of integrals; by parts: ex(x−1)+Ce^x(x-1)+C
∫ln⁡x dx=1x\int\ln x\,dx=\dfrac1xThat is the derivative; the integral is xln⁡x−x+Cx\ln x-x+C
Choosing u=exu=e^x, dv=x dxdv=x\,dxThe remaining integral gets harder; LIATE: u=xu=x
Forgetting the sign in uv−∫v duuv-\int v\,duThere is a minus in front of the remaining integral
Not alternating the signs in the tabular method+,−,+,−+,-,+,-
Decomposing directly when the numerator’s degree is largerFirst polynomial division
Only B(x−1)2\dfrac{B}{(x-1)^2} for (x−1)2(x-1)^2Ax−1+B(x−1)2\dfrac{A}{x-1}+\dfrac{B}{(x-1)^2}
∫dxx2+4=ln⁡(x2+4)\int\dfrac{dx}{x^2+4}=\ln(x^2+4)12arctan⁡x2+C\tfrac12\arctan\tfrac x2+C
No absolute value in the ln⁡\ln answerln⁡∣x−a∣\ln\lvert x-a\rvert

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Find ∫xe2x dx\displaystyle\int xe^{2x}\,dx.

Show answer
e2x(x2−14)+Ce^{2x}\left(\dfrac x2-\dfrac14\right)+C

LIATE: u=xu=x (algebraic), dv=e2xdxdv=e^{2x}dx. du=dxdu=dx, v=12e2xv=\tfrac12e^{2x}. ∫=x2e2x−∫12e2xdx=x2e2x−14e2x+C\int=\tfrac x2e^{2x}-\int\tfrac12e^{2x}dx=\tfrac x2e^{2x}-\tfrac14e^{2x}+C.

Question 2easy

Find ∫xcos⁡3x dx\displaystyle\int x\cos3x\,dx.

Show answer
xsin⁡3x3+cos⁡3x9+C\dfrac{x\sin3x}{3}+\dfrac{\cos3x}{9}+C

u=xu=x, dv=cos⁡3x dxdv=\cos3x\,dx, v=13sin⁡3xv=\tfrac13\sin3x. ∫=x3sin⁡3x−∫13sin⁡3x dx=x3sin⁡3x−13⋅(−13cos⁡3x)=x3sin⁡3x+19cos⁡3x+C\int=\tfrac x3\sin3x-\int\tfrac13\sin3x\,dx=\tfrac x3\sin3x-\tfrac13\cdot\left(-\tfrac13\cos3x\right)=\tfrac x3\sin3x+\tfrac19\cos3x+C.

Question 3medium

Find ∫ln⁡x dx\displaystyle\int\ln x\,dx and use it to evaluate ∫1eln⁡x dx\displaystyle\int_1^e\ln x\,dx.

Show answer
x ln x - x + C; the definite integral equals 1

There is only one function, so choose dv=dxdv=dx: u=ln⁡xu=\ln x, du=dxxdu=\tfrac{dx}{x}, v=xv=x. ∫=xln⁡x−∫x⋅1x dx=xln⁡x−x+C\int=x\ln x-\int x\cdot\tfrac1x\,dx=x\ln x-x+C. Definite: [xln⁡x−x]1e=(e−e)−(0−1)=1[x\ln x-x]_1^e=(e-e)-(0-1)=1.

Question 4medium

Find ∫x2ex dx\displaystyle\int x^2e^x\,dx.

Show answer
ex(x2−2x+2)+Ce^x(x^2-2x+2)+C

Integration by parts twice, or the tabular method. Derivative column: x2, 2x, 2, 0x^2,\ 2x,\ 2,\ 0. Integral column: ex, ex, exe^x,\ e^x,\ e^x. Signs +,−,++,-,+: x2ex−2xex+2ex+Cx^2e^x-2xe^x+2e^x+C.

Question 5medium

Find ∫exsin⁡x dx\displaystyle\int e^x\sin x\,dx.

Show answer
ex(sin⁡x−cos⁡x)2+C\dfrac{e^x(\sin x-\cos x)}{2}+C

I=∫exsin⁡x dxI=\int e^x\sin x\,dx. u=sin⁡xu=\sin x, dv=exdxdv=e^xdx: I=exsin⁡x−∫excos⁡x dxI=e^x\sin x-\int e^x\cos x\,dx. For the second one again u=cos⁡xu=\cos x: ∫excos⁡x=excos⁡x+∫exsin⁡x=excos⁡x+I\int e^x\cos x=e^x\cos x+\int e^x\sin x=e^x\cos x+I. Substitute: I=exsin⁡x−excos⁡x−I⇒2I=ex(sin⁡x−cos⁡x)I=e^x\sin x-e^x\cos x-I \Rightarrow 2I=e^x(\sin x-\cos x).

Question 6medium

Evaluate ∫01arctan⁡x dx\displaystyle\int_0^1\arctan x\,dx.

Show answer
π4−12ln⁡2≈0.4388\dfrac\pi4-\dfrac12\ln2\approx0.4388

u=arctan⁡xu=\arctan x, dv=dxdv=dx: du=dx1+x2du=\dfrac{dx}{1+x^2}, v=xv=x. ∫=xarctan⁡x−∫x1+x2dx=xarctan⁡x−12ln⁡(1+x2)\int=x\arctan x-\int\dfrac{x}{1+x^2}dx=x\arctan x-\tfrac12\ln(1+x^2). [ ]01=π4−12ln⁡2−0[\ ]_0^1=\tfrac\pi4-\tfrac12\ln2-0.

Question 7easy

Find ∫5x+1(x−1)(x+2) dx\displaystyle\int\frac{5x+1}{(x-1)(x+2)}\,dx.

Show answer
2 ln|x - 1| + 3 ln|x + 2| + C

5x+1(x−1)(x+2)=Ax−1+Bx+2\dfrac{5x+1}{(x-1)(x+2)}=\dfrac{A}{x-1}+\dfrac{B}{x+2}, that is 5x+1=A(x+2)+B(x−1)5x+1=A(x+2)+B(x-1). x=1x=1: 6=3A⇒A=26=3A \Rightarrow A=2. x=−2x=-2: −9=−3B⇒B=3-9=-3B \Rightarrow B=3. The integral is 2ln⁡∣x−1∣+3ln⁡∣x+2∣+C2\ln|x-1|+3\ln|x+2|+C.

Question 8medium

Find ∫dxx2−9\displaystyle\int\frac{dx}{x^2-9}.

Show answer
16ln⁡∣x−3x+3∣+C\dfrac16\ln\left|\dfrac{x-3}{x+3}\right|+C

1(x−3)(x+3)=Ax−3+Bx+3\dfrac{1}{(x-3)(x+3)}=\dfrac{A}{x-3}+\dfrac{B}{x+3}, 1=A(x+3)+B(x−3)1=A(x+3)+B(x-3). x=3x=3: A=16A=\tfrac16. x=−3x=-3: B=−16B=-\tfrac16. 16ln⁡∣x−3∣−16ln⁡∣x+3∣=16ln⁡∣x−3x+3∣+C\tfrac16\ln|x-3|-\tfrac16\ln|x+3|=\tfrac16\ln\left|\tfrac{x-3}{x+3}\right|+C.

Question 9hard

Find ∫x2+1x(x−1)2 dx\displaystyle\int\frac{x^2+1}{x(x-1)^2}\,dx.

Show answer
ln⁡∣x∣−2x−1+C\ln|x|-\dfrac{2}{x-1}+C

Repeated factor: Ax+Bx−1+C(x−1)2\dfrac Ax+\dfrac{B}{x-1}+\dfrac{C}{(x-1)^2}. x2+1=A(x−1)2+Bx(x−1)+Cxx^2+1=A(x-1)^2+Bx(x-1)+Cx. x=0x=0: A=1A=1. x=1x=1: C=2C=2. Coefficients of x2x^2: 1=A+B⇒B=01=A+B \Rightarrow B=0. Integral: ln⁡∣x∣+∫2(x−1)−2dx=ln⁡∣x∣−2x−1+C\ln|x|+\int2(x-1)^{-2}dx=\ln|x|-\dfrac{2}{x-1}+C.

Question 10medium

Find ∫x3+xx−1 dx\displaystyle\int\frac{x^3+x}{x-1}\,dx.

Show answer
x33+x22+2x+2ln⁡∣x−1∣+C\dfrac{x^3}{3}+\dfrac{x^2}{2}+2x+2\ln|x-1|+C

The numerator's degree is larger than the denominator's: first polynomial division. x3+x=(x−1)(x2+x+2)+2x^3+x=(x-1)(x^2+x+2)+2. So the integrand is x2+x+2+2x−1x^2+x+2+\dfrac{2}{x-1}. Integrate term by term.

Question 11hard

Find ∫2x+3x2+2x+5 dx\displaystyle\int\frac{2x+3}{x^2+2x+5}\,dx.

Show answer
ln⁡(x2+2x+5)+12arctan⁡x+12+C\ln(x^2+2x+5)+\dfrac12\arctan\dfrac{x+1}{2}+C

The denominator does not factor (discriminant 4−20<04-20<0). Write the numerator as "derivative of the denominator + constant": 2x+3=(2x+2)+12x+3=(2x+2)+1. The first part is ∫2x+2x2+2x+5=ln⁡(x2+2x+5)\int\dfrac{2x+2}{x^2+2x+5}=\ln(x^2+2x+5). Second part: complete the square, x2+2x+5=(x+1)2+4x^2+2x+5=(x+1)^2+4. ∫dx(x+1)2+4=12arctan⁡x+12\int\dfrac{dx}{(x+1)^2+4}=\tfrac12\arctan\tfrac{x+1}{2}.

Question 12hard

Evaluate ∫01x+5(x+1)(x2+1) dx\displaystyle\int_0^1\frac{x+5}{(x+1)(x^2+1)}\,dx.

Show answer
ln⁡2+3π4≈3.0493\ln2+\dfrac{3\pi}{4}\approx3.0493

Ax+1+Bx+Cx2+1\dfrac{A}{x+1}+\dfrac{Bx+C}{x^2+1}: x+5=A(x2+1)+(Bx+C)(x+1)x+5=A(x^2+1)+(Bx+C)(x+1). x=−1x=-1: 4=2A⇒A=24=2A \Rightarrow A=2. x2x^2: 0=A+B⇒B=−20=A+B \Rightarrow B=-2. Constant: 5=A+C⇒C=35=A+C \Rightarrow C=3. Integral: 2ln⁡∣x+1∣−ln⁡(x2+1)+3arctan⁡x2\ln|x+1|-\ln(x^2+1)+3\arctan x. [ ]01=2ln⁡2−ln⁡2+3π4=ln⁡2+3π4[\ ]_0^1=2\ln2-\ln2+\tfrac{3\pi}{4}=\ln2+\tfrac{3\pi}{4}.

Verification: All answers were checked with node (verify/MAT1051/13.mjs): the central-difference derivative of every indefinite integral answer was compared with the integrand at three or four points; partial fraction decompositions were compared with the original fraction; definite integrals with Simpson's rule.

Review card

PARTS: ∫ u dv = uv - ∫ v du Choosing u with LIATE (the earlier one is u): Log, Inverse trig, Algebraic, Trig, Exponential ∫ ln x, ∫ arctan x: u = that function, dv = dx x^n · (e^x, sin, cos): tabular method, signs + - + - e^x sin x type: parts twice -> the integral comes back -> solve for I PARTIAL FRACTIONS: 1) numerator degree >= denominator -> DIVIDE first 2) factor the denominator (x - a) -> A/(x - a) (x - a)^2 -> A/(x - a) + B/(x - a)^2 (x^2 + bx + c) irreducible -> (Bx + C)/(x^2 + bx + c) Plug in the roots (quick A, B), equate coefficients for the rest ∫ A/(x - a) = A ln|x - a| ∫ dx/(x^2 + a^2) = (1/a) arctan(x/a)