Practice / Calculus

Partial fractions and integrating rational functions

Ten rational functions split into partial fractions and integrated: distinct linear factors by the cover-up rule, three factors, a repeated factor, an irreducible quadratic, an improper fraction that needs long division first, and the definite integral of 1/(x² − 1), with worked solutions and the mistakes that choose the wrong form or skip the division.

Before you start

Substitution and parts do not integrate 1x2−1\tfrac{1}{x^2 - 1}, but splitting it into 12(1x−1−1x+1)\tfrac12\big(\tfrac{1}{x - 1} - \tfrac{1}{x + 1}\big) turns it into two logs. Partial fractions is that split, done systematically: the form of the answer is fixed by the factors of the denominator, and only the constants are unknown. The work goes wrong in the set-up more than in the arithmetic: a repeated or quadratic factor given too few terms, an improper fraction decomposed without dividing first, a cover-up evaluated at the wrong root. These ten problems decompose first, then integrate.

  • A rational function is P(x)Q(x)\tfrac{P(x)}{Q(x)} with PP and QQ polynomials. It is proper when deg⁡P<deg⁡Q\deg P < \deg Q. If it is not, divide first: PQ=S+RQ\tfrac PQ = S + \tfrac RQ with deg⁡R<deg⁡Q\deg R < \deg Q, and decompose only RQ\tfrac RQ.
  • Factor QQ completely into linear factors and irreducible quadratics (quadratics with no real roots, such as x2+1x^2 + 1). Each factor contributes terms to the form:
Factor of QQ Terms in the decomposition
x−ax - a, once Ax−a\tfrac{A}{x - a}
(x−a)2(x - a)^2 Ax−a+B(x−a)2\tfrac{A}{x - a} + \tfrac{B}{(x - a)^2}
x2+px+qx^2 + px + q, irreducible Bx+Cx2+px+q\tfrac{Bx + C}{x^2 + px + q}
  • To find the constants, multiply both sides by QQ and either substitute convenient values of xx (the roots of QQ first) or match coefficients of each power of xx. The cover-up rule is the substitution done in one step: for a factor x−ax - a that appears once, AA is PQ\tfrac PQ with the factor x−ax - a covered up, evaluated at x=ax = a. For the factor x+2x + 2, a=−2a = -2.
  • Integrals used: ∫dxx−a=ln⁡∣x−a∣+C\int\tfrac{dx}{x - a} = \ln|x - a| + C; ∫dx(x−a)2=−1x−a+C\int\tfrac{dx}{(x - a)^2} = -\tfrac{1}{x - a} + C; ∫2xx2+1dx=ln⁡(x2+1)+C\int\tfrac{2x}{x^2 + 1}dx = \ln(x^2 + 1) + C; ∫dxx2+1=arctan⁡x+C\int\tfrac{dx}{x^2 + 1} = \arctan x + C.

Builds on: Integration: substitution and parts

Problems

  1. ·

    Decompose 5x−1(x+1)(x−2)\dfrac{5x - 1}{(x + 1)(x - 2)} into partial fractions.

  2. ·

    Decompose x+7x2−x−6\dfrac{x + 7}{x^2 - x - 6}.

  3. ··

    Decompose 2x2+6x−2x(x−1)(x+2)\dfrac{2x^2 + 6x - 2}{x(x - 1)(x + 2)}.

  4. ··

    Decompose x2+3x(x−1)2\dfrac{x^2 + 3}{x(x - 1)^2}.

  5. ··

    Decompose 2x2+3x+3(x+1)(x2+1)\dfrac{2x^2 + 3x + 3}{(x + 1)(x^2 + 1)}.

  6. ··

    Write x3+x2+x+3x2−1\dfrac{x^3 + x^2 + x + 3}{x^2 - 1} as a polynomial plus partial fractions.

  7. ··

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

  8. ···

    Evaluate ∫23dxx2−1\displaystyle\int_2^3\frac{dx}{x^2 - 1} exactly.

  9. ···

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

  10. ···

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

Worked solutions

Problem 1

Decompose 5x−1(x+1)(x−2)\dfrac{5x - 1}{(x + 1)(x - 2)} into partial fractions.

  1. 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}Two distinct linear factors, one constant over each. The fraction is proper: degree 1 over degree 2.
  2. 5x−1=A(x−2)+B(x+1)5x - 1 = A(x - 2) + B(x + 1)Multiply both sides by (x+1)(x−2)(x + 1)(x - 2). This holds for every xx.
  3. x=2x = 2: 9=3B9 = 3B, so B=3B = 3.At x=2x = 2 the AA term is 0. This is the cover-up rule: cover x−2x - 2 and evaluate 5x−1x+1\tfrac{5x - 1}{x + 1} at 2.
  4. x=−1x = -1: −6=−3A-6 = -3A, so A=2A = 2.At x=−1x = -1 the BB term is 0.
  5. 2x+1+3x−2\dfrac{2}{x + 1} + \dfrac{3}{x - 2}Check: 2(x−2)+3(x+1)=5x−12(x - 2) + 3(x + 1) = 5x - 1.

Problem 2

Decompose x+7x2−x−6\dfrac{x + 7}{x^2 - x - 6}.

  1. x2−x−6=(x−3)(x+2)x^2 - x - 6 = (x - 3)(x + 2)Factor the denominator first: −3-3 and 22 multiply to −6-6 and add to −1-1.
  2. x+7(x−3)(x+2)=Ax−3+Bx+2\dfrac{x + 7}{(x - 3)(x + 2)} = \dfrac{A}{x - 3} + \dfrac{B}{x + 2}Two distinct linear factors.
  3. A=3+73+2=2A = \dfrac{3 + 7}{3 + 2} = 2Cover-up for x−3x - 3: cover it and evaluate x+7x+2\tfrac{x + 7}{x + 2} at its root, x=3x = 3.
  4. B=−2+7−2−3=5−5=−1B = \dfrac{-2 + 7}{-2 - 3} = \dfrac{5}{-5} = -1Cover-up for x+2x + 2: its root is x=−2x = -2, so evaluate x+7x−3\tfrac{x + 7}{x - 3} there.
  5. 2x−3−1x+2\dfrac{2}{x - 3} - \dfrac{1}{x + 2}Check: 2(x+2)−(x−3)=x+72(x + 2) - (x - 3) = x + 7.

Problem 3

Decompose 2x2+6x−2x(x−1)(x+2)\dfrac{2x^2 + 6x - 2}{x(x - 1)(x + 2)}.

  1. 2x2+6x−2x(x−1)(x+2)=Ax+Bx−1+Cx+2\dfrac{2x^2 + 6x - 2}{x(x - 1)(x + 2)} = \dfrac{A}{x} + \dfrac{B}{x - 1} + \dfrac{C}{x + 2}Three distinct linear factors; degree 2 over degree 3, so proper.
  2. A=−2(0−1)(0+2)=−2−2=1A = \dfrac{-2}{(0 - 1)(0 + 2)} = \dfrac{-2}{-2} = 1Cover up xx and evaluate the rest at x=0x = 0.
  3. B=2+6−21⋅(1+2)=63=2B = \dfrac{2 + 6 - 2}{1\cdot(1 + 2)} = \dfrac{6}{3} = 2Cover up x−1x - 1 and evaluate at x=1x = 1.
  4. C=8−12−2(−2)(−2−1)=−66=−1C = \dfrac{8 - 12 - 2}{(-2)(-2 - 1)} = \dfrac{-6}{6} = -1Cover up x+2x + 2 and evaluate at x=−2x = -2.
  5. 1x+2x−1−1x+2\dfrac{1}{x} + \dfrac{2}{x - 1} - \dfrac{1}{x + 2}Check: (x−1)(x+2)+2x(x+2)−x(x−1)=(x2+x−2)+(2x2+4x)−(x2−x)=2x2+6x−2(x - 1)(x + 2) + 2x(x + 2) - x(x - 1) = (x^2 + x - 2) + (2x^2 + 4x) - (x^2 - x) = 2x^2 + 6x - 2.

Problem 4

Decompose x2+3x(x−1)2\dfrac{x^2 + 3}{x(x - 1)^2}.

  1. x2+3x(x−1)2=Ax+Bx−1+C(x−1)2\dfrac{x^2 + 3}{x(x - 1)^2} = \dfrac{A}{x} + \dfrac{B}{x - 1} + \dfrac{C}{(x - 1)^2}The repeated factor (x−1)2(x - 1)^2 needs a term for each power, x−1x - 1 and (x−1)2(x - 1)^2. Three unknowns for a cubic denominator.
  2. x2+3=A(x−1)2+Bx(x−1)+Cxx^2 + 3 = A(x - 1)^2 + Bx(x - 1) + CxMultiply both sides by x(x−1)2x(x - 1)^2.
  3. x=0x = 0: 3=A3 = A. x=1x = 1: 4=C4 = C.Each root kills every term but one.
  4. Coefficient of x2x^2: 1=A+B1 = A + B, so B=−2B = -2.No root isolates BB, so match the x2x^2 terms: A(x−1)2A(x - 1)^2 gives Ax2Ax^2, Bx(x−1)Bx(x - 1) gives Bx2Bx^2, and CxCx has none.
  5. 3x−2x−1+4(x−1)2\dfrac{3}{x} - \dfrac{2}{x - 1} + \dfrac{4}{(x - 1)^2}Check at x=2x = 2: the left side is 72\tfrac{7}{2} and the right side is 32−2+4=72\tfrac32 - 2 + 4 = \tfrac72.

Problem 5

Decompose 2x2+3x+3(x+1)(x2+1)\dfrac{2x^2 + 3x + 3}{(x + 1)(x^2 + 1)}.

  1. 2x2+3x+3(x+1)(x2+1)=Ax+1+Bx+Cx2+1\dfrac{2x^2 + 3x + 3}{(x + 1)(x^2 + 1)} = \dfrac{A}{x + 1} + \dfrac{Bx + C}{x^2 + 1}x2+1x^2 + 1 has no real roots, so it stays as a factor, and its numerator is a general linear polynomial Bx+CBx + C, not a constant.
  2. 2x2+3x+3=A(x2+1)+(Bx+C)(x+1)2x^2 + 3x + 3 = A(x^2 + 1) + (Bx + C)(x + 1)Multiply both sides by (x+1)(x2+1)(x + 1)(x^2 + 1).
  3. x=−1x = -1: 2−3+3=2A2 - 3 + 3 = 2A, so A=1A = 1.The root of the linear factor.
  4. x2x^2: 2=A+B2 = A + B, so B=1B = 1. Constant: 3=A+C3 = A + C, so C=2C = 2.Match coefficients. (Bx+C)(x+1)=Bx2+(B+C)x+C(Bx + C)(x + 1) = Bx^2 + (B + C)x + C.
  5. 1x+1+x+2x2+1\dfrac{1}{x + 1} + \dfrac{x + 2}{x^2 + 1}Check the xx coefficient, which was not used: B+C=3B + C = 3, as required.

Problem 6

Write x3+x2+x+3x2−1\dfrac{x^3 + x^2 + x + 3}{x^2 - 1} as a polynomial plus partial fractions.

  1. The fraction is improper: degree 3 over degree 2.Divide before decomposing.
  2. x3+x2+x+3=(x+1)(x2−1)+(2x+4)x^3 + x^2 + x + 3 = (x + 1)(x^2 - 1) + (2x + 4)Long division: x⋅(x2−1)=x3−xx \cdot (x^2 - 1) = x^3 - x leaves x2+2x+3x^2 + 2x + 3; 1⋅(x2−1)1\cdot(x^2 - 1) leaves 2x+42x + 4, of degree less than 2. Quotient x+1x + 1, remainder 2x+42x + 4.
  3. x3+x2+x+3x2−1=x+1+2x+4(x−1)(x+1)\dfrac{x^3 + x^2 + x + 3}{x^2 - 1} = x + 1 + \dfrac{2x + 4}{(x - 1)(x + 1)}Step 2 divided by x2−1x^2 - 1.
  4. 2x+4(x−1)(x+1)=3x−1−1x+1\dfrac{2x + 4}{(x - 1)(x + 1)} = \dfrac{3}{x - 1} - \dfrac{1}{x + 1}Cover-up: at x=1x = 1, 62=3\tfrac{6}{2} = 3; at x=−1x = -1, 2−2=−1\tfrac{2}{-2} = -1.
  5. x+1+3x−1−1x+1x + 1 + \dfrac{3}{x - 1} - \dfrac{1}{x + 1}Check at x=2x = 2: the left side is 173\tfrac{17}{3} and the right side is 3+3−13=1733 + 3 - \tfrac13 = \tfrac{17}{3}.

Problem 7

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

  1. ∫(2x+1+3x−2)dx\displaystyle\int\left(\frac{2}{x + 1} + \frac{3}{x - 2}\right)dxThe decomposition from Problem 1.
  2. ∫2x+1dx=2ln⁡∣x+1∣\displaystyle\int\frac{2}{x + 1}dx = 2\ln|x + 1| and ∫3x−2dx=3ln⁡∣x−2∣\displaystyle\int\frac{3}{x - 2}dx = 3\ln|x - 2|.∫dxx−a=ln⁡∣x−a∣\int\tfrac{dx}{x - a} = \ln|x - a|, with the constant carried along. The absolute value keeps the log defined on both sides of the root.
  3. 2ln⁡∣x+1∣+3ln⁡∣x−2∣+C2\ln|x + 1| + 3\ln|x - 2| + CCheck by differentiating: 2x+1+3x−2\tfrac{2}{x + 1} + \tfrac{3}{x - 2}, which is the integrand.

Problem 8

Evaluate ∫23dxx2−1\displaystyle\int_2^3\frac{dx}{x^2 - 1} exactly.

  1. 1(x−1)(x+1)=1/2x−1−1/2x+1\dfrac{1}{(x - 1)(x + 1)} = \dfrac{1/2}{x - 1} - \dfrac{1/2}{x + 1}Cover-up: at x=1x = 1, 12\tfrac{1}{2}; at x=−1x = -1, 1−2\tfrac{1}{-2}.
  2. ∫dxx2−1=12(ln⁡∣x−1∣−ln⁡∣x+1∣)=12ln⁡∣x−1x+1∣\displaystyle\int\frac{dx}{x^2 - 1} = \tfrac12\big(\ln|x - 1| - \ln|x + 1|\big) = \tfrac12\ln\left|\frac{x - 1}{x + 1}\right|Integrate each term, then combine with ln⁡p−ln⁡q=ln⁡pq\ln p - \ln q = \ln\tfrac pq.
  3. At x=3x = 3: 12ln⁡24=12ln⁡12\tfrac12\ln\tfrac24 = \tfrac12\ln\tfrac12. At x=2x = 2: 12ln⁡13\tfrac12\ln\tfrac13.Neither root of x2−1x^2 - 1 lies in [2,3][2, 3], so the integrand is continuous there and the antiderivative can be evaluated at the ends.
  4. 12ln⁡12−12ln⁡13=12ln⁡1/21/3\tfrac12\ln\tfrac12 - \tfrac12\ln\tfrac13 = \tfrac12\ln\dfrac{1/2}{1/3}Upper value minus lower value, then the same log rule.
  5. 12ln⁡32≈0.2027\tfrac12\ln\tfrac32 \approx 0.2027Sanity check: the integrand falls from 13\tfrac13 to 18\tfrac18 on an interval of length 1, so the integral lies between 0.1250.125 and 0.3330.333.

Problem 9

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

  1. ∫(3x−2x−1+4(x−1)2)dx\displaystyle\int\left(\frac{3}{x} - \frac{2}{x - 1} + \frac{4}{(x - 1)^2}\right)dxThe decomposition from Problem 4.
  2. ∫3xdx=3ln⁡∣x∣\displaystyle\int\frac{3}{x}dx = 3\ln|x| and ∫−2x−1dx=−2ln⁡∣x−1∣\displaystyle\int\frac{-2}{x - 1}dx = -2\ln|x - 1|.The two linear terms give logs.
  3. ∫4(x−1)2dx=4∫(x−1)−2dx=−4x−1\displaystyle\int\frac{4}{(x - 1)^2}dx = 4\int(x - 1)^{-2}dx = -\frac{4}{x - 1}The squared term is a power, not a log: ∫u−2du=−u−1\int u^{-2}du = -u^{-1} with u=x−1u = x - 1.
  4. 3ln⁡∣x∣−2ln⁡∣x−1∣−4x−1+C3\ln|x| - 2\ln|x - 1| - \dfrac{4}{x - 1} + CCheck the last term: ddx(−4(x−1)−1)=4(x−1)−2\tfrac{d}{dx}\big(-4(x - 1)^{-1}\big) = 4(x - 1)^{-2}.

Problem 10

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

  1. ∫(1x+1+xx2+1+2x2+1)dx\displaystyle\int\left(\frac{1}{x + 1} + \frac{x}{x^2 + 1} + \frac{2}{x^2 + 1}\right)dxThe decomposition from Problem 5, with x+2x2+1\tfrac{x + 2}{x^2 + 1} split into its xx part and its constant part, which integrate differently.
  2. ∫xx2+1dx=12ln⁡(x2+1)\displaystyle\int\frac{x}{x^2 + 1}dx = \tfrac12\ln(x^2 + 1)Substitution u=x2+1u = x^2 + 1, du=2x dxdu = 2x\,dx: the numerator is half of dudu. No absolute value is needed because x2+1>0x^2 + 1 > 0.
  3. ∫2x2+1dx=2arctan⁡x\displaystyle\int\frac{2}{x^2 + 1}dx = 2\arctan xThe constant part gives the arctangent.
  4. ln⁡∣x+1∣+12ln⁡(x2+1)+2arctan⁡x+C\ln|x + 1| + \tfrac12\ln(x^2 + 1) + 2\arctan x + CSteps 2 and 3 plus ∫dxx+1=ln⁡∣x+1∣\int\tfrac{dx}{x + 1} = \ln|x + 1|.

Where this goes wrong

1. Decomposing an improper fraction without dividing

The cover-up rule produces numbers for any fraction, proper or not, so nothing seems to go wrong.

  1. x3+x2+x+3(x−1)(x+1)\dfrac{x^3 + x^2 + x + 3}{(x - 1)(x + 1)}Right so far: Problem 6 with the denominator factored.
  2. “Two linear factors, so Ax−1+Bx+1\tfrac{A}{x - 1} + \tfrac{B}{x + 1}; cover up to get A=62=3A = \tfrac62 = 3 and B=2−2=−1B = \tfrac{2}{-2} = -1.”The habit that causes the mistake: going straight to the form without comparing degrees.
  3. x3+x2+x+3x2−1=3x−1−1x+1\dfrac{x^3 + x^2 + x + 3}{x^2 - 1} = \dfrac{3}{x - 1} - \dfrac{1}{x + 1}The right side goes to 0 as x→∞x \to \infty while the left side grows like xx, so they cannot be equal; at x=2x = 2 they are 173\tfrac{17}{3} and 83\tfrac83. A proper-fraction form can only match a proper fraction. Divide first; the missing piece is the quotient x+1x + 1 (Problem 6).

2. One term for a repeated factor

(x−1)2(x - 1)^2 looks like a single factor, so it gets a single fraction.

  1. x2+3x(x−1)2\dfrac{x^2 + 3}{x(x - 1)^2}Right so far: Problem 4.
  2. “One fraction per factor: xx and (x−1)2(x - 1)^2.”The habit that causes the mistake: counting factors, not powers.
  3. x2+3x(x−1)2=Ax+B(x−1)2\dfrac{x^2 + 3}{x(x - 1)^2} = \dfrac{A}{x} + \dfrac{B}{(x - 1)^2}Multiplying out gives x2+3=A(x−1)2+Bxx^2 + 3 = A(x - 1)^2 + Bx. The roots give A=3A = 3 and B=4B = 4, but then the x2x^2 coefficients say 1=A=31 = A = 3: no constants work. A repeated factor needs one term for each power, Bx−1+C(x−1)2\tfrac{B}{x - 1} + \tfrac{C}{(x - 1)^2} (Problem 4).

3. A constant over an irreducible quadratic

Every linear factor gets a constant on top, and that pattern gets carried to x2+1x^2 + 1.

  1. 2x2+3x+3(x+1)(x2+1)\dfrac{2x^2 + 3x + 3}{(x + 1)(x^2 + 1)}Right so far: Problem 5.
  2. “Put a constant over each factor.”The habit that causes the mistake: the numerator over a quadratic needs one degree less than the quadratic, which is degree 1, not 0.
  3. 2x2+3x+3(x+1)(x2+1)=Ax+1+Cx2+1\dfrac{2x^2 + 3x + 3}{(x + 1)(x^2 + 1)} = \dfrac{A}{x + 1} + \dfrac{C}{x^2 + 1}Matching coefficients of 2x2+3x+3=A(x2+1)+C(x+1)2x^2 + 3x + 3 = A(x^2 + 1) + C(x + 1) gives A=2A = 2 from x2x^2, C=3C = 3 from xx, and then 3=A+C=53 = A + C = 5 from the constants: no solution. With Bx+Cx2+1\tfrac{Bx + C}{x^2 + 1} there are three unknowns for three equations (Problem 5).

4. Evaluating the cover-up at the wrong root

The factor is x+2x + 2, and 2 is the number in it.

  1. x+7(x−3)(x+2)=Ax−3+Bx+2\dfrac{x + 7}{(x - 3)(x + 2)} = \dfrac{A}{x - 3} + \dfrac{B}{x + 2}, with A=2A = 2Right so far: Problem 2, steps 2 and 3.
  2. “Cover up x+2x + 2 and put in x=2x = 2.”The habit that causes the mistake: reading the number off the factor without its sign.
  3. B=2+72−3=−9B = \dfrac{2 + 7}{2 - 3} = -9The cover-up works because the covered factor is 0 at the chosen xx, and x+2x + 2 is 0 at x=−2x = -2, not 2. At x=−2x = -2: B=5−5=−1B = \tfrac{5}{-5} = -1. A quick check catches it: 2(x+2)−9(x−3)=−7x+312(x + 2) - 9(x - 3) = -7x + 31, not x+7x + 7.

5. Integrating 1/(x − 1)² as a log

Every other term in the decomposition integrates to a log, so this one does too.

  1. ∫(3x−2x−1+4(x−1)2)dx\displaystyle\int\left(\frac{3}{x} - \frac{2}{x - 1} + \frac{4}{(x - 1)^2}\right)dxRight so far: Problem 9, step 1.
  2. “∫duu=ln⁡∣u∣\int\tfrac{du}{u} = \ln|u| with u=(x−1)2u = (x - 1)^2.”The habit that causes the mistake: ∫duu\int\tfrac{du}{u} needs dudu on top, and du=2(x−1) dxdu = 2(x - 1)\,dx is not there.
  3. ∫4(x−1)2dx=4ln⁡(x−1)2\displaystyle\int\frac{4}{(x - 1)^2}dx = 4\ln(x - 1)^2Differentiating the claimed answer gives 8x−1\tfrac{8}{x - 1}, not 4(x−1)2\tfrac{4}{(x - 1)^2}. The term is the power 4(x−1)−24(x - 1)^{-2}, whose integral is −4x−1-\tfrac{4}{x - 1} (Problem 9).

Print this set: partial-fractions.pdf (problems, answers, and worked solutions on separate pages).

Read the guide: Partial fraction decomposition: pick the right form, then find A and B