A rational function Q(x)P(x) can be integrated, but the techniques depend on its shape. Partial fractions is the algorithm for transforming the integrand into a sum of fractions whose denominators are linear or irreducible quadratic , each of which has a known antiderivative.
When does partial fractions apply?
The integrand must be a proper rational function: degP<degQ. If the integrand is improper, perform polynomial division first to write
Q(x)P(x)=S(x)+Q(x)R(x),degR<degQ.
Then ∫S is a polynomial integral (trivial), and we apply partial fractions to QR.
The four cases
After factoring Q(x) over the reals into linear and irreducible-quadratic factors, the decomposition depends on the shapes of the factors.
Case 1: Distinct linear factors. If Q(x)=(x−a1)(x−a2)⋯(x−an) with distinct ai, then
Q(x)P(x)=x−a1A1+x−a2A2+⋯+x−anAn.
Case 2: Repeated linear factor. If (x−a)k divides Q, the decomposition includes
x−aA1+(x−a)2A2+⋯+(x−a)kAk.
Case 3: Distinct irreducible quadratic factor. For each (x2+bx+c) factor of Q with b2−4c<0, include
x2+bx+cBx+C.
Case 4: Repeated irreducible quadratic. For (x2+bx+c)k, include
x2+bx+cB1x+C1+(x2+bx+c)2B2x+C2+⋯+(x2+bx+c)kBkx+Ck.
Finding the unknowns
Two methods. Method 1 , clear denominators and compare coefficients. Multiply both sides by Q(x), expand, and equate coefficients of like powers of x. This always works but can be slow.
Method 2 , Heaviside cover-up. For a distinct linear factor x−a, the coefficient A satisfies
A=limx→a(x−a)⋅Q(x)P(x)=Q′(a)P(a)(when convenient).
In practice, "cover up" the (x−a) in the denominator and substitute x=a into what remains.
For repeated factors and quadratic factors, you typically need Method 1 or a hybrid.
Integrating each piece
Once decomposed, each piece is one of:
∫x−aAdx=Aln∣x−a∣+C
∫(x−a)kAdx=−(k−1)(x−a)k−1A+C for k≥2
∫x2+bx+cBx+Cdx: split into 2B⋅x2+bx+c2x+b (a log) plus x2+bx+cC−Bb/2 (complete the square, tan−1).
Worked examples
Example 1.∫(x−1)(x−2)1dx.
Decompose: (x−1)(x−2)1=x−1A+x−2B. Cover-up: A=1−21=−1, B=2−11=1. So
∫(x−1)(x−2)dx=−ln∣x−1∣+ln∣x−2∣+C=lnx−1x−2+C.
Example 2.∫x2−4x+1dx.
x2−4=(x−2)(x+2). Decompose: (x−2)(x+2)x+1=x−2A+x+2B. Cover-up: A=43, B=−4−1=41. Integral =43ln∣x−2∣+41ln∣x+2∣+C.
Example 3.∫x(x−1)21dx.
Decompose: x(x−1)21=xA+x−1B+(x−1)2C. Multiply by x(x−1)2: 1=A(x−1)2+Bx(x−1)+Cx. Set x=0: 1=A. Set x=1: 1=C. Compare coefficients of x2: 0=A+B, so B=−1. Integral =ln∣x∣−ln∣x−1∣−x−11+C.
Example 4.∫(x−1)(x+1)2x2dx.
Decompose: (x−1)(x+1)2x2=x−1A+x+1B+(x+1)2C. Multiply through: x2=A(x+1)2+B(x−1)(x+1)+C(x−1). Set x=1: 1=4A, so A=1/4. Set x=−1: 1=−2C, so C=−1/2. Compare coefficients of x2: 1=A+B, so B=3/4. Integral =41ln∣x−1∣+43ln∣x+1∣+2(x+1)1+C.
Example 5.∫(x2+1)(x−1)xdx.
Decompose: (x2+1)(x−1)x=x2+1Ax+B+x−1C. Multiply: x=(Ax+B)(x−1)+C(x2+1). Set x=1: 1=2C, so C=1/2. Expand: x=Ax2−Ax+Bx−B+Cx2+C. Coefficient of x2: 0=A+C, so A=−1/2. Coefficient of x0: 0=−B+C, so B=1/2. Integral splits as −41ln(x2+1)+21tan−1x+21ln∣x−1∣+C.
Example 6.∫x2−1x3+1dx.
Improper , divide first: x2−1x3+1=x+x2−1x+1=x+x−11 (since (x−1)(x+1)x+1=x−11). Integral =2x2+ln∣x−1∣+C.
Try it yourself
∫x2−91dx
∫(x−1)(x+4)5dx
∫x2+3x+22x+3dx
∫x2−5x+61dx
∫(x+1)2(x−2)x2+1dx
∫x(x2+1)1dx
∫(x−1)(x2+1)3x+1dx
∫x2−1x2dx (improper)
∫x2+x2x3+1dx
∫(x−1)3xdx
∫x(x4+1)dx (substitute u=x4 and then partial fractions)