Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 12: ∫x2+1x2−5x+6 dx\int\frac{x^2+1}{x^2-5x+6}\,dx

ExamplesPartial fractions · Section 7.5
The question

Find

∫x2+1x2−5x+6 dx\int \frac{x^2+1}{x^2-5x+6}\,dx
Exam answer

Let I=∫x2+1x2−5x+6 dxI = \displaystyle\int\frac{x^2 + 1}{x^2 - 5x + 6}\,dx⁠.

Dividing x2+1x^2 + 1 by x2−5x+6x^2 - 5x + 6⁠,

x2+1x2−5x+6=1+5x−5(x−2)(x−3)\begin{aligned} &\frac{x^2 + 1}{x^2 - 5x + 6} \\ &= 1 + \frac{5x - 5}{(x - 2)(x - 3)} \end{aligned}

Let

5x−5(x−2)(x−3)=Ax−2+Bx−3\frac{5x - 5}{(x - 2)(x - 3)} = \frac{A}{x - 2} + \frac{B}{x - 3} ⇒ 5x−5=A(x−3)+B(x−2)\Rightarrow\ 5x - 5 = A(x - 3) + B(x - 2)

Putting x=2x = 2⁠: 5=−A5 = -A⁠, so A=−5A = -5⁠. Putting x=3x = 3⁠: B=10B = 10⁠.

∴ I=∫dx−5∫dxx−2+10∫dxx−3\begin{aligned} \therefore\ I &= \int dx - 5\int\frac{dx}{x - 2} \\ &\quad + 10\int\frac{dx}{x - 3} \end{aligned}

∴ I=x−5log⁡∣x−2∣\therefore\ I = x - 5\log|x - 2| +10log⁡∣x−3∣+C+ 10\log|x - 3| + C⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The top and the bottom have the same degree (both are quadratics), so the fraction is improper. An improper fraction always hides a whole-number part, exactly as 73=2+13\frac{7}{3} = 2 + \frac13⁠. So we divide first: the integrand becomes 11 plus a proper fraction. The proper fraction has a bottom that factorises into two different linear factors, so it splits into Ax−2+Bx−3\frac{A}{x-2} + \frac{B}{x-3}⁠, and each of those integrates to a logarithm.

Given, to find, and the plan
Given
The integrand x2+1x2−5x+6\dfrac{x^2+1}{x^2-5x+6}⁠. Its bottom is zero at x=2x = 2 and x=3x = 3⁠, so it is defined for every real xx except 22 and 33⁠.
To find
∫x2+1x2−5x+6 dx\int \frac{x^2+1}{x^2-5x+6}\,dx⁠, and where the answer is valid.
Plan
(1) Factorise the bottom. (2) Divide, because the fraction is improper. (3) Write the proper part as Ax−2+Bx−3\frac{A}{x-2} + \frac{B}{x-3}⁠. (4) Find AA and BB⁠. (5) Integrate term by term. (6) Differentiate the answer to check it.

Basics you need

1Proper and improper rational functions

A rational function P(x)Q(x)\frac{P(x)}{Q(x)} is proper when the degree of PP is less than the degree of QQ⁠, and improper otherwise. An improper one can be written as a polynomial plus a proper one by long division (Section 7.5). Basics: splitting fractions

2Partial fractions for two different linear factors

Table 7.2, row 1: px+q(x−a)(x−b)=Ax−a+Bx−b\frac{px+q}{(x-a)(x-b)} = \frac{A}{x-a} + \frac{B}{x-b} when a≠ba \ne b⁠, with real numbers AA⁠, BB to be found. Basics: splitting fractions

3The logarithm integral

Standard formula (xii): ∫1x dx=log⁡∣x∣+C\int \frac{1}{x}\,dx = \log|x| + C⁠. With the substitution t=x−at = x - a (so dt=dxdt = dx⁠) it gives ∫dxx−a=log⁡∣x−a∣+C\int \frac{dx}{x-a} = \log|x-a| + C⁠. Basics: logarithms and 1/x

4Integrate term by term

Property V (Section 7.2.1): the integral of a sum of constant multiples is the same sum of constant multiples of the integrals. And because integration undoes differentiation, any answer can be checked by differentiating it. Basics: integration undoes differentiation

Solution

  1. Factorise the bottom and note where the integrand lives

    We need two numbers with product 66 and sum 55⁠: they are 22 and 33⁠. So

    x2−5x+6=(x−2)(x−3).x^2 - 5x + 6 = (x-2)(x-3).

    The integrand is therefore defined for all real xx except x=2x = 2 and x=3x = 3⁠.

    Partial fractions are built from the factors of the bottom, so factorising is always the first job. Knowing where the bottom is zero also tells us in advance where the final answer can be valid: nowhere near x=2x = 2 or x=3x = 3 can the integral be taken across.
    Check the factorisation by expanding: (x−2)(x−3)(x-2)(x-3) is x2−3x−2x+6x^2 - 3x - 2x + 6⁠, which is x2−5x+6x^2 - 5x + 6⁠. Basics: splitting fractions
  2. The fraction is improper, so divide first

    The top x2+1x^2 + 1 and the bottom x2−5x+6x^2 - 5x + 6 both have degree 2, so the fraction is not proper. Dividing x2+1x^2+1 by x2−5x+6x^2-5x+6⁠: the quotient is 11⁠, and the remainder is

    (x2+1)−1⋅(x2−5x+6)=5x−5.(x^2+1) - 1\cdot(x^2-5x+6) = 5x - 5.

    So

    x2+1x2−5x+6=1+5x−5(x−2)(x−3).\frac{x^2+1}{x^2-5x+6} = 1 + \frac{5x-5}{(x-2)(x-3)}.
    Table 7.2 only applies to proper fractions. If we tried x2+1=A(x−3)+B(x−2)x^2 + 1 = A(x-3) + B(x-2) directly, the left side has an x2x^2 term and the right side cannot produce one, so no AA⁠, BB would work. Division removes the whole-number part 11 and leaves a remainder of degree 1, lower than the degree 2 of the bottom.
    Dividend = quotient × divisor + remainder, with the remainder of lower degree than the divisor. Here x2+1=1⋅(x2−5x+6)+(5x−5)x^2 + 1 = 1\cdot(x^2-5x+6) + (5x-5)⁠. Lesson: partial fractions
  3. Set up the partial fractions

    The bottom has two different linear factors, so by Table 7.2, row 1, we write

    5x−5(x−2)(x−3)=Ax−2+Bx−3.\frac{5x-5}{(x-2)(x-3)} = \frac{A}{x-2} + \frac{B}{x-3}.

    Multiply both sides by (x−2)(x−3)(x-2)(x-3)⁠:

    5x−5=A(x−3)+B(x−2).5x - 5 = A(x-3) + B(x-2).
    Multiplying through clears every denominator and leaves an equation between two polynomials. It has to hold for every xx (it is an identity, not an equation to solve), and that is what lets us find AA and BB in the next step.
    Two polynomials that are equal for every xx have equal coefficients of each power of xx⁠. Basics: splitting fractions
  4. Find AA and BB

    Expand the right side:

    A(x−3)+B(x−2)=(A+B)x−(3A+2B).A(x-3) + B(x-2) = (A+B)x - (3A+2B).

    Equating the coefficients of xx and the constant terms with those of 5x−55x - 5⁠:

    A+B=5,3A+2B=5.A + B = 5, \qquad 3A + 2B = 5.

    From the first, B=5−AB = 5 - A⁠. Then 3A+2(5−A)=53A + 2(5 - A) = 5⁠, so A+10=5A + 10 = 5 and

    A=−5,B=10.A = -5, \qquad B = 10.

    Quick cross-check. Put x=2x = 2 in 5x−5=A(x−3)+B(x−2)5x - 5 = A(x-3) + B(x-2)⁠: 5=−A5 = -A⁠, so A=−5A = -5⁠. Put x=3x = 3⁠: 10=B10 = B⁠. The same values. Hence

    x2+1x2−5x+6=1−5x−2+10x−3.\frac{x^2+1}{x^2-5x+6} = 1 - \frac{5}{x-2} + \frac{10}{x-3}.
    Comparing coefficients is the book's method. Substituting the roots x=2x = 2 and x=3x = 3 is a fast independent check: each choice makes one bracket zero and leaves a single unknown. (This is legitimate even though the original fraction is undefined at 2 and 3: the two sides of 5x−5=A(x−3)+B(x−2)5x - 5 = A(x-3) + B(x-2) are polynomials that agree at every other xx⁠, and two polynomials that agree at infinitely many points are identical, so they agree at 2 and 3 as well.)
    Watch the sign of the constant term: −3A−2B=−5-3A - 2B = -5 is the same as 3A+2B=53A + 2B = 5⁠. Lesson: partial fractions
  5. Integrate term by term

    By Property V,

    ∫x2+1x2−5x+6 dx=∫dx−5∫dxx−2+10∫dxx−3.\begin{aligned} \int \frac{x^2+1}{x^2-5x+6}\,dx &= \int dx - 5\int \frac{dx}{x-2} \\ &\quad + 10\int \frac{dx}{x-3}. \end{aligned}

    For ∫dxx−2\int \frac{dx}{x-2}⁠, substitute t=x−2t = x - 2⁠, dt=dxdt = dx⁠: it becomes ∫dtt=log⁡∣t∣\int \frac{dt}{t} = \log|t| by formula (xii), that is log⁡∣x−2∣\log|x-2|⁠. In the same way ∫dxx−3=log⁡∣x−3∣\int \frac{dx}{x-3} = \log|x-3|⁠. Therefore

    ∫x2+1x2−5x+6 dx=x−5log⁡∣x−2∣+10log⁡∣x−3∣+C.\begin{aligned} \int \frac{x^2+1}{x^2-5x+6}\,dx &= x - 5\log|x-2| \\ &\quad + 10\log|x-3| + C. \end{aligned}
    After the split, every piece is a standard integral: ∫dx=x\int dx = x⁠, and each 1x−a\frac{1}{x-a} is a shifted 1x\frac1x⁠. The absolute value bars matter: x−2x - 2 is negative for x<2x < 2⁠, and the log of a negative number is not defined, but log⁡∣x−2∣\log|x-2| is.
    Standard formula (xii), ∫1x dx=log⁡∣x∣+C\int \frac1x\,dx = \log|x| + C⁠, with a linear substitution. Basics: logarithms and 1/x
  6. Check: differentiate the answer

    Using ddxlog⁡∣u∣=1u\frac{d}{dx}\log|u| = \frac1u (for u≠0u \ne 0⁠):

    ddx[x−5log⁡∣x−2∣+10log⁡∣x−3∣]=1−5x−2+10x−3.\begin{aligned} &\frac{d}{dx}\Big[x - 5\log|x-2| + 10\log|x-3|\Big] \\ &= 1 - \frac{5}{x-2} + \frac{10}{x-3}. \end{aligned}

    Over the common denominator (x−2)(x−3)(x-2)(x-3) the top is

    (x−2)(x−3)−5(x−3)+10(x−2)=x2−5x+6−5x+15+10x−20=x2+1.\begin{aligned} &(x-2)(x-3) - 5(x-3) + 10(x-2) \\ &= x^2 - 5x + 6 - 5x + 15 + 10x - 20 \\ &= x^2 + 1. \end{aligned}

    So the derivative is x2+1x2−5x+6\frac{x^2+1}{x^2-5x+6}⁠, exactly the integrand.

    An antiderivative is, by definition, a function whose derivative is the integrand. Differentiating back is therefore a complete check, and it catches sign slips in AA or BB at once.
    ddxlog⁡∣x∣=1x\frac{d}{dx}\log|x| = \frac1x for x≠0x \ne 0 (Section 7.2); the constant CC differentiates to 0. Basics: integration undoes differentiation
Result ∫x2+1x2−5x+6 dx=x−5log⁡∣x−2∣+10log⁡∣x−3∣+C,\begin{aligned} &\int \frac{x^2+1}{x^2-5x+6}\,dx \\ &= x - 5\log|x-2| + 10\log|x-3| + C, \end{aligned}

valid for x≠2,3x \ne 2, 3⁠, that is on each of the intervals (−∞,2)(-\infty, 2)⁠, (2,3)(2, 3) and (3,∞)(3, \infty)⁠. This is the book's answer.

Check it with numbers

At a point. At x=4x = 4 the integrand is 16+116−20+6=172=8.5\frac{16+1}{16-20+6} = \frac{17}{2} = 8.5⁠, and the derivative of our answer is 1−52+101=8.51 - \frac52 + \frac{10}{1} = 8.5⁠.

Over an interval. On [4,5][4, 5] (which avoids 2 and 3), our answer gives

F(5)−F(4)=1−5log⁡3+15log⁡2=5.9041462650…\begin{aligned} F(5) - F(4) &= 1 - 5\log 3 + 15\log 2 \\ &= 5.9041462650\ldots \end{aligned}

Adding up the integrand numerically over [4,5][4, 5] gives 5.9041462650…5.9041462650\ldots⁠, the same value.

Common mistakes
  1. Skipping the division. Partial fractions of the improper fraction directly cannot work, and the term xx in the answer would be lost.
  2. Dropping the absolute value. Write log⁡∣x−2∣\log|x-2|⁠, not log⁡(x−2)\log(x-2)⁠, unless you know x>2x > 2⁠.
  3. Sign slips in the constant term. A(x−3)+B(x−2)A(x-3) + B(x-2) has constant term −3A−2B-3A - 2B⁠, not 3A+2B3A + 2B⁠.
  4. Using the answer across x=2x = 2 or x=3x = 3⁠. The integrand is undefined there; the formula holds on each interval separately.
What to take away
  1. If the degree of the top is at least the degree of the bottom, divide first.
  2. For distinct linear factors, substituting each root into the cleared identity gives each constant in one line.
  3. Every piece kx−a\frac{k}{x-a} integrates to klog⁡∣x−a∣k\log|x-a|⁠. Always differentiate the answer back.

Every fact used, and where it comes from

FactUsed inSource
Proper and improper rational functions; divisionStep 2Section 7.5 (Lesson: partial fractions)
px+q(x−a)(x−b)=Ax−a+Bx−b\frac{px+q}{(x-a)(x-b)} = \frac{A}{x-a} + \frac{B}{x-b}Steps 3, 4Table 7.2, row 1, Section 7.5
Equal polynomials have equal coefficientsStep 4Algebra (Class XI)
Integral of a sum of multiples (Property V)Step 5Section 7.2.1
∫1x dx=log⁡∣x∣+C\int \frac1x\,dx = \log|x| + C⁠; ∫dx=x+C\int dx = x + CStep 5Standard formulae (xii) and (i), Section 7.2
Substitution t=x−at = x - aStep 5Section 7.3.1 (Lesson: substitution)
ddxlog⁡∣x∣=1x\frac{d}{dx}\log|x| = \frac1xStep 6Section 7.2
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →