Example 1: Three Distinct Linear Factors
integral ((x−1)x2+x+1(x-2)(x-3)) dx
First check: degree 2 = degree 3 - 1. OK, no long division needed.
x−1A + x−2B + x−3C:
x = 1: ((1−2)1+1+1(1-3)) = (−13(-2)) = 3/2 = A
x = 2: ((2−1)4+2+1(2-3)) = 17(-1) = -7 = B
x = 3: ((3−1)9+3+1(3-2)) = 213(1) = 13/2 = C
Answer: 23ln|x-1| - 7ln|x-2| + 213ln|x-3| + C
Example 2: Repeated Linear Factor
integral (x−1)3x+2^2(x+1) dx
= x−1A + x−1B^2 + x+1C
x = 1: 15(2) = 5/2 = B
x = -1: -−21^2 = -1/4 = C
Compare x2 coefficients: 0 = A + C, so A = 1/4
Answer: 41ln|x-1| - 25(x−11) + (-1/4)ln|x+1| + C
= 41ln|(x+1)x−1| - 2(x−15) + C
Example 3: Irreducible Quadratic
integral ((x−1)2x2+3(x2+x+1)) dx
= x−1A + (x2+x+1)Bx+C
x = 1: 5/3 = A
Compare x2: 2 = A + B, so B = 2 - 5/3 = 1/3
Compare constants: 3 = -A + C, so C = 3 + 5/3 = 14/3
integral = 35ln|x-1| + integral (x2+x+1)x/3+14/3 dx
For the second part: split (x2+x+1)x/3+14/3:
Write x/3 + 14/3 = 61(2x+1) + (14/3 - 1/6) = 61(2x+1) + 9/2
= 61ln|x2+x+1| + 29integral (x+1/2dx^2 + 3/4)
= 61ln|x2+x+1| + 29(2/sqrt(3))arctansqrt(2x+1(3))
= 61ln|x2+x+1| + 3*sqrt(3)*arctansqrt(2x+1(3))