Lecture: Integration of Rational Functions (Rational
Fractions)
P (x)
Goal: Learn how to integrate any rational function using a systematic method.
Q(x)
Introduction
A rational function is a ratio of two polynomials:
P (x)
R(x) = .
Q(x)
To integrate rational functions, we follow this universal strategy:
• Make the rational function proper.
• Factor the denominator.
• Apply the correct partial fraction form.
• Integrate each term using standard formulas.
Proper vs Improper Rational Function
Improper Rational Function
deg P (x) ≥ deg Q(x)
Perform polynomial long division before integrating.
Proper Rational Function
deg P (x) < deg Q(x)
Proceed directly to partial fractions.
Factor the Denominator
Typical factor types:
• Linear: (ax + b)
• Repeated linear: (ax + b)n
• Irreducible quadratic: ax2 + px + q
• Repeated quadratic: (ax2 + px + q)n
1
Partial Fraction Forms
(a) Linear factor (ax + b)
A
ax + b
(b) Repeated linear factor (ax + b)n
A1 A2 An
+ 2
+ ··· +
ax + b (ax + b) (ax + b)n
(c) Irreducible quadratic factor (ax2 + px + q)
Ax + B
ax2 + px + q
(d) Repeated quadratic factor
A1 x + B1 A2 x + B2
+ + ···
ax + px + q (ax2 + px + q)2
2
2
Examples Covering All Rules
A. Linear Factors
Example 1. Z
3
dx
x−5
Z Z
3 1
dx = 3 dx = 3 ln |x − 5| + C.
x−5 x−5
Z
3
dx = 3 ln |x − 5| + C
x−5
Example 2.
5x − 1
Z
dx
(x − 2)(x + 3)
First use partial fractions. We assume
5x − 1 A B
= + .
(x − 2)(x + 3) x−2 x+3
Then
5x − 1 = A(x + 3) + B(x − 2) = (A + B)x + (3A − 2B).
Equating coefficients:
A + B = 5, 3A − 2B = −1.
Solve:
16
A = 5−B, 3(5−B)−2B = −1 ⇒ 15−3B−2B = −1 ⇒ 15−5B = −1 ⇒ 5B = 16 ⇒ B = .
5
Then
16 25 16 9
A=5− = − = .
5 5 5 5
So
9 16
5x − 1
= 5 + 5 .
(x − 2)(x + 3) x−2 x+3
Thus
5x − 1
Z Z Z
9 dx 16 dx
dx = +
(x − 2)(x + 3) 5 x−2 5 x+3
9 16
= ln |x − 2| + ln |x + 3| + C.
5 5
5x − 1
Z
9 16
dx = ln |x − 2| + ln |x + 3| + C
(x − 2)(x + 3) 5 5
3
Example 3. Z
cos x
dx
(a + sin x)(b − sin x)
Let
t = sin x ⇒ dt = cos x dx.
Then Z Z
cos x dt
dx = .
(a + sin x)(b − sin x) (a + t)(b − t)
Decompose:
1 A B
= + .
(a + t)(b − t) a+t b−t
Then
1 = A(b − t) + B(a + t) = (Ab + Ba) + (B − A)t.
So
1
B − A = 0 ⇒ B = A, A(b + a) = 1 ⇒ A = .
a+b
Hence
1 1 1 1
= + .
(a + t)(b − t) a+b a+t b−t
Thus Z Z
dt 1 1 1
= + dt
(a + t)(b − t) a+b a+t b−t
1
= (ln |a + t| − ln |b − t|) + C.
a+b
Substitute t = sin x:
Z
cos x 1 a + sin x
dx = ln +C
(a + sin x)(b − sin x) a+b b − sin x
4
B. Repeated Linear Factors
Example 4. Z
1
dx
(x + 1)2
We use Z
(x + 1)−2 dx = −(x + 1)−1 + C.
So Z
1 1
2
dx = − +C
(x + 1) x+1
Example 5. Z
5x + 4
dx
(x − 1)2
Write
5x + 4 5(x − 1) + 9 5 9
2
= 2
= + .
(x − 1) (x − 1) x − 1 (x − 1)2
Then Z Z Z
5x + 4 dx dx
dx = 5 +9
(x − 1)2 x−1 (x − 1)2
9
= 5 ln |x − 1| − + C.
x−1
Z
5x + 4 9
dx = 5 ln |x − 1| − +C
(x − 1)2 x−1
5
Example 6.
x2
Z
dx
(x + 1)2 (x + 2)
Decompose:
x2 A B C
2
= + + .
(x + 1) (x + 2) x + 2 x + 1 (x + 1)2
Then
x2 = A(x + 1)2 + B(x + 1)(x + 2) + C(x + 2).
Expand:
(x + 1)2 = x2 + 2x + 1, (x + 1)(x + 2) = x2 + 3x + 2.
So
x2 = A(x2 + 2x + 1) + B(x2 + 3x + 2) + C(x + 2).
x2 = (A + B)x2 + (2A + 3B + C)x + (A + 2B + 2C).
Equate coefficients:
A + B = 1,
2A + 3B + C = 0,
A + 2B + 2C = 0.
Solving gives
A = 4, B = −3, C = 1.
Thus
x2 4 3 1
= − + .
(x + 1)2 (x + 2) x + 2 x + 1 (x + 1)2
Hence
x2
Z Z Z Z
dx dx dx
dx = 4 −3 +
(x + 1)2 (x + 2) x+2 x+1 (x + 1)2
1
= 4 ln |x + 2| − 3 ln |x + 1| − + C.
x+1
x2
Z
1
2
dx = 4 ln |x + 2| − 3 ln |x + 1| − +C
(x + 1) (x + 2) x+1
6
C. Irreducible Quadratic Factors
Example 7. Z
1
dx
x2 +4
Z
dx 1 x
We use the standard form = arctan + C with a = 2:
x2 + a 2 a a
Z
1 1 x
dx = arctan +C
x2 + 4 2 2
Example 8. Z
3x + 1
dx
x2 + 2x + 5
Complete the square:
x2 + 2x + 5 = (x + 1)2 + 4.
Rewrite the numerator:
3
3x + 1 = (2x + 2) − 2.
2
So Z Z Z
3x + 1 3 2x + 2 dx
2
dx = 2
dx − 2 2
.
x + 2x + 5 2 x + 2x + 5 x + 2x + 5
For the first integral, let u = x2 + 2x + 5, then du = (2x + 2) dx:
Z Z
3 2x + 2 3 du 3 3
2
dx = = ln |u| + C = ln(x2 + 2x + 5).
2 x + 2x + 5 2 u 2 2
For the second integral, use the standard form with (x + 1)2 + 22 :
Z Z
dx dx 1 x+1
= = arctan + C.
x2 + 2x + 5 (x + 1)2 + 4 2 2
Hence Z
dx 1 x+1 x+1
−2 2
= −2 · arctan = − arctan .
x + 2x + 5 2 2 2
Therefore
Z
3x + 1 3 x+1
2
dx = ln(x2 + 2x + 5) − arctan +C
x + 2x + 5 2 2
7
D. Repeated Quadratic Factors
Example 9. Z
x
dx
(x2 + 1)2
Let
1
u = x2 + 1 ⇒ du = 2x dx ⇒ x dx = du.
2
Then
Z Z Z
x 1 1 1 1 1
u−2 du = −u−1 + C = − + C.
dx = · du =
(x + 1)2
2 2
u 2 2 2 2u
Substitute u = x2 + 1: Z
x 1
dx = − +C
(x2 + 1) 2 2
2(x + 1)
Example 10.
3x2 + 1
Z
dx
(x2 + 1)2
Rewrite the numerator:
3x2 + 1 = 3(x2 + 1) − 2.
Thus
3x2 + 1
Z Z Z
1 1
dx = 3 dx − 2 dx.
(x2 + 1)2 2
x +1 (x2 + 1)2
We use: Z
dx
= arctan x + C,
x2 +1
and the standard exact result
Z
dx x 1
= + arctan x + C.
(x2 + 1)2 2(x2 + 1) 2
Hence Z
1
3 dx = 3 arctan x,
x2 +1
and Z
dx x 1 x
−2 = −2 + arctan x = − 2 − arctan x.
(x + 1)2
2 2
2(x + 1) 2 x +1
Combine:
3x2 + 1
Z
x x
2 2
dx = 3 arctan x − 2 − arctan x = 2 arctan x − 2 + C.
(x + 1) x +1 x +1
3x2 + 1
Z
x
2 2
dx = 2 arctan x − 2 +C
(x + 1) x +1
8
Example 11. Z
5x + 7
dx
(x2 + 4)2
Rewrite numerator to match derivatives:
5
5x + 7 = (2x) + 7.
2
So
5x + 7 5 2x 7
2 2
= · 2 2
+ 2 .
(x + 4) 2 (x + 4) (x + 4)2
First part: Let u = x2 + 4, then du = 2x dx.
Z Z
5 2x 5 du 5 5
2 2
dx = 2
= (−u−1 ) + C = − 2
.
2 (x + 4) 2 u 2 2(x + 4)
Second part: use the exact formula
Z
dx x 1 x
= + arctan + C.
(x2 + a2 )2 2a2 (x2 + a2 ) 2a3 a
Here a2 = 4, so a = 2:
Z
dx x 1 x
= + arctan .
(x2 + 4)2 8(x2 + 4) 16 2
Therefore Z Z
7 dx 7x 7 x
dx = 7 = + arctan .
(x + 4)2
2 (x2 + 4)2 8(x2 + 4) 16 2
Combine:
Z
5x + 7 5 7x 7 x
dx = − + + arctan + C.
(x2 + 4)2 2(x2 + 4) 8(x2 + 4) 16 2
Put over common denominator 8(x2 + 4):
5 20
− =− .
2(x2 + 4) 2
8(x + 4)
So the rational part is
7x − 20
.
8(x2 + 4)
Thus
7x − 20
Z
5x + 7 7 x
dx = + arctan +C
(x2 + 4)2 8(x2 + 4) 16 2
9
E. Mixed Linear + Quadratic
Example 12. Z
2x + 5
dx
x(x2 + 4)
Partial fractions:
2x + 5 A Bx + C
2
= + 2 .
x(x + 4) x x +4
Then
2x + 5 = A(x2 + 4) + x(Bx + C) = (A + B)x2 + Cx + 4A.
Equate:
A + B = 0,
C = 2,
4A = 5.
So
5 5
A= , B=− , C = 2.
4 4
Thus
2x + 5 5/4 5x/4 2
2
= − 2 + 2 .
x(x + 4) x x +4 x +4
Then Z Z Z Z
2x + 5 5 dx 5 x dx dx
2
dx = − 2
·2 +2 .
x(x + 4) 4 x 4 x +4 2 x2+4
More directly: Z
5 dx 5
= ln |x|,
4 x 4
Z Z
5x 5 2x 5
2
dx = 2
dx = ln(x2 + 4),
4(x + 4) 8 x +4 8
Z
2 1 x x
dx = 2 · arctan = arctan .
x2 + 4 2 2 2
So Z
2x + 5 5 5 2
x
dx = ln |x| − ln(x + 4) + arctan + C.
x(x2 + 4) 4 8 2
Z
2x + 5 5 5 2
x
dx = ln |x| − ln(x + 4) + arctan +C
x(x2 + 4) 4 8 2
10
F. Improper Rational Function
Example 13.
x3 + 2
Z
dx
(x − 1)2
This is improper: deg(numerator) = 3, deg(denominator) = 2.
Perform polynomial long division of x3 + 2 by (x − 1)2 = x2 − 2x + 1.
x3 + 2 3x
2
=x+2+ 2 .
x − 2x + 1 x − 2x + 1
Thus
x3 + 2 3x
2
=x+2+ .
(x − 1) (x − 1)2
Now decompose
3x A B
2
= + .
(x − 1) x − 1 (x − 1)2
Then
3x = A(x − 1) + B = Ax − A + B.
Equate:
A = 3, −A + B = 0 ⇒ B = 3.
So
3x 3 3
2
= + .
(x − 1) x − 1 (x − 1)2
Therefore
x3 + 2 3 3
2
=x+2+ + .
(x − 1) x − 1 (x − 1)2
Integrate term-by-term:
x3 + 2
Z Z Z Z Z
dx dx
dx = x dx + 2 dx + 3 + 3
(x − 1)2 x−1 (x − 1)2
x2 3
= + 2x + 3 ln |x − 1| − + C.
2 x−1
x3 + 2 x2
Z
3
2
dx = + 2x + 3 ln |x − 1| − +C
(x − 1) 2 x−1
11
Mixed Case
Example 14.
x4 + 3x2 + 5
Z
dx
x(x2 + 1)2
We look for
x4 + 3x2 + 5 A Bx + C Dx + E
2 2
= + 2 + 2 .
x(x + 1) x x +1 (x + 1)2
Multiply both sides by x(x2 + 1)2 :
x4 + 3x2 + 5 = A(x2 + 1)2 + x(Bx + C)(x2 + 1) + x(Dx + E).
Compute:
(x2 + 1)2 = x4 + 2x2 + 1,
x(Bx + C)(x2 + 1) = x Bx3 + Bx + Cx2 + C = Bx4 + Cx3 + Bx2 + Cx,
x(Dx + E) = Dx2 + Ex.
So
x4 + 3x2 + 5 = A(x4 + 2x2 + 1) + (Bx4 + Cx3 + Bx2 + Cx) + (Dx2 + Ex).
Collect:
x4 + 3x2 + 5 = (A + B)x4 + Cx3 + (2A + B + D)x2 + (C + E)x + A.
Match coefficients with x4 + 0x3 + 3x2 + 0x + 5:
A + B = 1,
C = 0,
2A + B + D = 3,
C + E = 0 ⇒ E = −C = 0,
A = 5.
From A = 5 and A + B = 1:
B = 1 − 5 = −4.
Then
2A + B + D = 3 ⇒ 10 − 4 + D = 3 ⇒ D = −3.
And C = 0, E = 0.
Hence
x4 + 3x2 + 5 5 4x 3x
2 2
= − 2 − 2 .
x(x + 1) x x + 1 (x + 1)2
Integrate each term: Z
5
dx = 5 ln |x|,
x
12
−4x
Z Z
1 2x
2
dx = −4 · dx = −2 ln(x2 + 1),
x +1 2 x2
+1
−3x
Z
dx.
(x + 1)2
2
For the last one, set u = x2 + 1, du = 2x dx, so x dx = 12 du:
−3x
Z Z Z
x 1 −2 3 −1
3
2 2
dx = −3 2 2
dx = −3 · u du = − −u +C = 2
.
(x + 1) (x + 1) 2 2 2(x + 1)
Thus
x4 + 3x2 + 5
Z
3
2 2
dx = 5 ln |x| − 2 ln(x2 + 1) + 2
+ C.
x(x + 1) 2(x + 1)
x4 + 3x2 + 5
Z
3
2 2
dx = 5 ln |x| − 2 ln(x2 + 1) + 2
+C
x(x + 1) 2(x + 1)
13