Integration of rational functions (Section 8.4)

Integration of rational functions (Section 8.4)
Rational function: ratio (quotient) of two polynomials
f (x) =
Pm (x)
,
Qn (x)
Pm (x) = bm xm + bm−1 xm−1 + ... + b1 x + b0
Qn (x) = an xn + an−1 xn−1 + ... + a1 x + a0
If m < n — proper rational function.
We need to find
Z
Pm (x)
dx
Qn (x)
Idea — represent a proper rational function as a sum of simple terms, ”partial fractions”, for example
µ
¶
1
1
1
1
1
=
=
+
.
1 − x2
(1 − x) (1 + x)
2 1−x 1+x
For each term the integral can be evaluated by known methods.
Step I. If m ≥ n, transform f into polynomial + proper rational function.
Rule #1: Never integrate improper rational function. Transform.
Either divide Pm by Qn and find the remaider Pn−1 : Pm (x) = g(x)Qn (x) + Pn−1 (x) or sequentially
eliminate from P all terms with powers from m to n.
Example: improper rational function
f (x) =
P4 (x) = x4 − x2 ,
x4
x2
−x
−1
x4
x4 − x2
x2 + x + 1
Q2 (x) = x2 + x + 1
−x2
+x3
+x2
−x3
−2x2
−x3
−x2
−x
−x2
+x
−x2
−x
−1
2x
+1
MATH115 T2 Winter 04, A.Potapov
(= P4 (x) − x2 Q2 (x))
(= P4 (x) − (x2 Q2 (x) − xQ2 (x)))
(= P4 (x) − (x2 Q2 (x) − xQ2 (x) − 1Q2 (x)))
— 1 —
www.math.ualberta.ca/∼apotapov/math115.htm
Therefore, we can conclude that
³
´
P4 (x) = x2 − x − 1 Q2 + 2x + 1.
Check it:
³
x2 − x − 1
´³
´
x2 + x + 1 + 2x − 1 = x4 − (x + 1)2 + 2x + 1 =
= x4 − x2 − 2x − 1 + 2x + 1 = x4 − x2 .
Now
³
´
f (x) = x2 − x − 1 +
2x + 1
.
+x+1
x2
Step 2. Represent Qn (x) as a product of standard factors (ax − b)r and
³
´r
ax2 + bx + c
Example: quadratic equation Q2 = ax2 + bx + c.
a) b2 − 4ac > 0, Q2 = a (x − α1 ) (x − α2 ) = (ax − aα1 ) (x − α2 ). α1 and α2 are the roots of the
quadratic equation ax2 + bx + c = 0,
α1 =
−b +
√
b2 − 4ac
,
2a
b) b2 − 4ac = 0, Q2 = a (x − α1 )2
³
c) b2 − 4ac < 0, Q2 = a x2 + ab x +
c
a
α2 =
−b −
√
b2 − 4ac
2a
´
General case (supplementary)
(1) if x can take complex values z = α + iβ, i2 = −1, then there is a theorem: each polynomial
Qn (x) of degree n always has n roots (some of the roots may coincide). The polynomial can be rewriten
in the form
Qn (x) = an xn + an−1 xn−1 + ... + a1 x + a0 = an (x − z1 ) (x − z2 ) ... (x − zn )
So, every simple root contributes a factor (x − zk ), each repeated r times root — (x − zk )r
(2) All coefficients ak are real numbers, then complex roots always appear in pairs: if α + iβ is a root,
then α − iβ is a root too. Two such roots contribute a factor
(x − α − iβ)(x − α + iβ) = (x − α)2 − (iβ)2 = x2 − 2αx + α2 + β 2
This is a quadratic polynomial with the discriminant 4α2 − 4 (α2 + β 2 ) = −4β 2 < 0.
(3) if the root α + iβ is repeated r times, then α − iβ is repeated r times too. Then Qn (x) has a
factor
MATH115 T2 Winter 04, A.Potapov
³
x2 − 2αx + α2 + β 2
— 2 —
´r
www.math.ualberta.ca/∼apotapov/math115.htm
Conclusion:
³
Qn (x) = (a1 x − b1 )r1 (a2 x − b2 )r2 ... (ak x − bk )rk ak+1 x2 + bk+1 x + ck+1
´rk+1
³
... at x2 + bt x + ct
´rt
,
where b1 /a1 , b2 /a2 , ..., bk /ak — real roots of the equation Q(x) = 0,
r1 + r2 + ... + rk + 2rk+1 + 2rk+2 + ... + 2rr = n.
Step 3. express proper fraction P/Q as a sum of partial fractions
Pm (x)
=
(a1 x − b1 ) (a2 x − b2 ) ... (ak x − bk ) (ak+1 x2 + bk+1 x + ck+1 )rk+1 ... (at x2 + bt x + ct )rt
r1
r2
rk
=
X
(Partial Fractions)
Each factor in Qn (x) generates ri terms in the sum of partial fractions:
Factor
Terms
comment
A
(ax − b)
1 term
ax − b
A2
A2
A1
+
r terms
(ax − b)r
2 + ... +
ax − b (ax − b)
(ax − b)r
Ax + B
(ax2 + bx + c)
1 term
ax2 + bx + c
A1 x + B1
A r x + Br
r
(ax2 + bx + c)
+ ... +
r terms
2
ax + bx + c
(ax2 + bx + c)r
Unknown coefficients A, B, C to be determined at the next step
Example:
f (x) =
1
=
2
Ã
x7 − 3x4
=
2 (x + 1) (x − 1)3 (x2 + x + 1)2
A
D
Ex + F
B
C
Gx + H
+
+
+ 2
2 +
3 + 2
x + 1 x − 1 (x − 1)
x + x + 1 (x + x + 1)2
(x − 1)
!
where A...H are unknown coefficients. Note: the number of unknown coefficients equals to the power of
the polynomial in denominator — here 8.
Step 4. Find the coefficients for each partial fraction
• Bring the sum of partial fractions to common denominator
• Find the polynomial in the numerator,
• Coefficients at each power of x of this polynomial should be equal to that of Pm (x). This gives the
system of equations for the coefficients at partial fractions
MATH115 T2 Winter 04, A.Potapov
— 3 —
www.math.ualberta.ca/∼apotapov/math115.htm
• Solve the system and find the coefficients.
Example.
2x2 + 1
A
Bx + C
=
+
=
(x − 1) (x2 + x + 1)
x − 1 x2 + x + 1
=
A (x2 + x + 1) + (Bx + C) (x − 1)
=
(x − 1) (x2 + x + 1)
Ax2 + Ax + A + Bx2 + Cx − Bx − C
=
=
(x − 1) (x2 + x + 1)
(A + B) x2 + (A − B + C) x + A − C
=
.
(x − 1) (x2 + x + 1)
We need that for any x
(A + B) x2 + (A − B + C) x + A − C = 2x2 + 1
therefore coefficients at the same powers of x must coincide:
(a) A + B = 2,
(b) A − B + C = 0,
(c) A − C = 1.
This is a system of equations for A, B, C.
Standard way of solving:
From equation (a) A = 2 − B, substitute this into two other equations:
(b) 2 − B − B + C = 2 − 2B + C = 0,
(c) 2 − B − C = 1.
or
(b) 2B − C = 2,
(c) B + C = 1.
From (c) B = 1 − C, substitute into (b):
(b) 2 − 2C − C = 2,
3C = 0,
C = 0.
Knowing C we can find B = 1 − C = 1, and A = 2 − B = 1.
There may be faster ways. For example, add all 3 equations, then
A + B + A − B + C + A − C = 3,
3A = 3,
A = 1,
then from (a) B = 2 − A = 1, (c) C = A − 1 = 0.
Finally,
1
x
2x2 + 1
=
+ 2
2
(x − 1) (x + x + 1)
x−1 x +x+1
MATH115 T2 Winter 04, A.Potapov
— 4 —
www.math.ualberta.ca/∼apotapov/math115.htm
The cross-out method
Some coefficients, corresponding to the highest degree of (ax − b)r can be determined without solving
a system of equations.
Example. Partial fractions give the relation with 3 unknown constants
2x2 + 1
A
Bx + C
=
+ 2
.
2
(x − 1) (x + x + 1)
x−1 x +x+1
Multiply this equality by (x − 1)
2x2 + 1
Bx + C
= A + (x − 1) 2
.
2
(x + x + 1)
x +x+1
There is no singularity at x = 1 any longer. Let us set x = 1,
2+1
= 1 = A.
(1 + 1 + 1)
At x = 1 terms containing B and C vanished, and we obtain the value of A.
Unfortunately, B and C cannot be determined this way — you need complex numbers to do this.
Example. Let us consider a general case, Pm (x)/Qn (x). Suppose that Qn (x) = (ax − b)r Sn−r (x),
where Sn−r (x) does not contain factors (ax − b). Then
Pm (x)
Pm (x)
=
=
Qn (x)
(ax − b)r Sn−r (x)
=
Ar
A1
Ar−1
+ (other terms) .
r +
r−1 + . . . +
(ax − b)
(ax − b)
(ax − b)
Multiply by (ax − b)r ,
Pm (x)
= Ar + Ar−1 (ax − b) + . . . + A1 (ax − b)r−1 + (ax − b)r (other terms) .
Sn−r (x)
Now set x = b/a, all (ax − b) = 0, what remains is
Ar =
Pm ( ab )
.
Sn−r ( ab )
Other coefficients Ar−1 to A1 cannot be determined this way. Coefficients corresponding to quadratic
r
terms (ax2 + bx + c) cannot be determined either.
This methor can be briefly formulated as follows: to determine Ar
1) ”cross out” the term (ax − b)r from the denominator in P (x)/Q(x)
2) set x = b/a.
MATH115 T2 Winter 04, A.Potapov
— 5 —
www.math.ualberta.ca/∼apotapov/math115.htm
Step 5. Integrating
For each of the partial fractions evaluate the integral and obtain the final answer. For each partial fraction
the integral can be evaluated by known methods:
Z
dx
1 Z d (ax − b)
1
=
= ln |ax − b| + C,
ax − b
a
ax − b
a
(a)
Z
(b)
dx
1Z
1
=
(ax − b)−r d (ax − b) = −
(ax − b)−(r−1) + C,
r
(ax − b)
a
a (r − 1)
r > 1,
Z
Ax + B
dx =
ax2 + bx + c
here denominator has to be transformed to a standard form without linear term,
(c)
u=x+
b
,
2a
ax2 + bx + c = au2 + aβ 2 ,
³
1 Z Au + B −
=
a
u2 + β 2
Ab
2a
β2 =
4ac − b2
> 0,
4a2
´
du =
Ã
!
AZ
u
1
Ab Z
1
=
du +
B−
du.
2
2
2
a u +β
a
2a
u + β2
Evaluate the integrals separately
Z
h
i
1Z 1
u
2
2
du = v = u + β =
dv =
u2 + β 2
2 v
!
Ã
´
1 ³
1
ax2 + bx + c
= ln u2 + β 2 + C = ln
+ C,
2
2
a
Z
1
β Z
1
du
=
[u
=
βv]
=
dv =
2
2
2
u +β
β
1 + v2
Ã
2ax + b
1
1
= tan−1 v + C = tan−1 √
β
β
4ac − b2
!
+C
The last one we consider only schematically:
Z
(d)
Ax + B
1 Z A1 u + B1
dx = r
du =
(ax2 + bx + c)r
a
(u2 + β 2 )r
A1 Z
u
B1 Z
1
= r
du
r du + r
2
2
2
a
(u + β )
a
(u + β 2 )r
In the first integral we use substitution v = u2 + β 2 , in the second u = β tan θ, so
Z
Z
Z
1
1−2r
2r
2
1−2r
cos θ sec θdθ = β
cos2r−2 θ dθ.
r du = β
2
2
(u + β )
This integral can be evaluated by successive application of double angle identity.
MATH115 T2 Winter 04, A.Potapov
— 6 —
www.math.ualberta.ca/∼apotapov/math115.htm
Examples
1.
Z
1
dx
1 − x2
1
1
A
B
=
=
+
2
1−x
(1 − x) (1 + x)
1−x 1+x
Here both coefficients can be obtained by cross-out method:
1
A=
1+x
¸
x=1
1
= ,
2
1
B=
1−x
¸
=
x=−1
1
2
Z
Z
1
1Z
1
1
dx =
dx +
dx =
2
1−x
2 1−x
1+x
¯
¯
1
1 ¯¯ 1 + x ¯¯
1
+ C.
= − ln |1 − x| + ln |1 + x| + C = ln ¯
2
2
2
1 − x¯
2.
Z
Z
Z
dθ
dx
dx
= [x = sin θ] =
3 =
5
2
cos θ
(1 − x )
(1 − x)3 (1 + x)3
1
A
B
C
E
F
D
+
3 =
3 +
2 +
3 +
2 +
1 − x (1 + x)
1+x
(1 − x) (1 + x)
(1 − x)
(1 − x)
(1 + x)
3
A and D can be determined by cross-out:
1
A=
(1 + x)3
#
x=1
1
= ,
8
1
B=
(1 − x)3
#
x=−1
1
= .
8
For other coefficients it is necessary to solve a system of equations.
1
(1 + x)3 + B (1 − x) (1 + x)3 + C (1 − x)2 (1 + x)3 +
8
1
+ (1 − x)3 + E (1 + x) (1 − x)3 + F (1 + x)2 (1 − x)3 = 1
8
´
³
´³
´
³
´2
1³
1 + 3x2 + B 1 − x2 1 + x2 + 2x + C 1 − x2 (1 + x) +
4
³
+E 1 − x2
´³
´
³
1 + x2 − 2x + F 1 − x2
³
´
´2
(1 − x) = 1
³
´
B 1 − x4 + 2x − 2x3 + C 1 − 2x2 + x4 + x − 2x3 + x5 +
³
´
³
´
+E 1 − x4 − 2x + 2x3 + F 1 − 2x2 + x4 − x + 2x3 − x5 =
3 3 2
− x
4 4
3
4
1
x : 2B + C − 2E − F = 0
3
x2 : −2C − 2F = −
4
3
x : −2B − 2C + 2E + 2F = 0
x0 :
MATH115 T2 Winter 04, A.Potapov
B+C +E+F =
— 7 —
www.math.ualberta.ca/∼apotapov/math115.htm
x4 :
−B + C − E + F = 0
x5 :
So C = F ,
C −F =0
3
3
(2) 2C + 2F = 4C = ,
C=F = ,
4
16
(3) B + C = E + F,
B=E
3
3 3
3
3
(0) B + E = 2B = − C − F = − = ,
B=E= .
4
4 8
8
16
Z
dx
1Z
dx
3 Z
dx
3 Z dx
=
+
+
+
8 (1 − x)3 16 (1 − x)2 16 1 − x
(1 − x2 )3
1Z
dx
3 Z
dx
3 Z dx
+
+
+
=
8 (1 + x)3 16 (1 + x)2 16 1 + x
3 1
1
1
3
=
−
ln |1 − x| −
2 +
16 (1 − x)
16 1 − x 16
1
3 1
3
1
−
+
ln |1 + x| + C =
2 −
16 (1 + x)
16 1 + x 16
¯
¯
3 1 + x − (1 − x)
1 (1 + x)2 − (1 − x)2
3 ¯¯ 1 + x ¯¯
+
=
+
ln
+C =
16
16
1 − x2
16 ¯ 1 − x ¯
(1 − x2 )2
¯
¯
3x
3 ¯¯ 1 + x ¯¯
x
+
+
ln ¯
=
+ C = ... (x = sin θ)
1 − x¯
4 (1 − x2 )2 8 (1 − x2 ) 16
3.
Z
3x2 + 2
dx
(x − 1) (x2 + 2x + 2)
3x2 + 2
A
Bx + C
=
+ 2
,
2
(x − 1) (x + 2x + 2)
x − 1 x + 2x + 2
#
3x2 + 2
A= 2
= 1,
(x + 2x + 2) x=1
Bring to common denominator,
J=
3x2 + 2 = x2 + 2x + 2 + (Bx + C) (x − 1) ,
Bx2 + Cx − Bx − C = 2x2 − 2x,
B = 2,
C − B = −2,
−C = 0.
Z
Z
2
3x + 2
1
x
dx =
dx + 2
dx
2
2
(x − 1) (x + 2x + 2)
x−1
x + 2x + 2
Z
1
dx = ln |x − 1| + C,
x−1
Z
Z
x
x+1−1
dx
=
dx = [u = x + 1]
2
x + 2x + 2
(x + 1)2 + 1
Z
Z
Z
´
1 ³ 2
u−1
udu
du
=
du
=
−
=
ln
u
+
1
− tan−1 u + C.
2
2
2
u +1
u +1
u +1
2
³
´
2
J = ln |x − 1| + ln x + 2x + 2 − 2 tan−1 (x + 1) + C
Z
MATH115 T2 Winter 04, A.Potapov
— 8 —
www.math.ualberta.ca/∼apotapov/math115.htm