# What is the integral of (x+1)/(x(x^2+x-6))?

May 20, 2017

$- \frac{1}{6} \ln | x | - \frac{2}{15} \ln | x + 3 | + \frac{3}{10} \ln | x - 2 | + C$

Well, for one, we can factor the denominator:

$\int \frac{x + 1}{x \left({x}^{2} + x - 6\right)} \mathrm{dx}$

$\int \frac{x + 1}{x \left(x + 3\right) \left(x - 2\right)} \mathrm{dx} \equiv \int \frac{A}{x} + \frac{B}{x + 3} + \frac{C}{x - 2} \mathrm{dx}$

Now we just have linear denominators, which is a fairly straightforward decomposition.

By achieving common denominators on the righthand side, we can equate the numerator to $x + 1$. Therefore, multiply the top and bottom so that all the terms have the denominator $x \left({x}^{2} + x - 6\right)$.

$\frac{A \left(x + 3\right) \left(x - 2\right) + B \left(x\right) \left(x - 2\right) + C \left(x\right) \left(x + 3\right)}{\cancel{x \left(x + 3\right) \left(x - 2\right)}} = \frac{x + 1}{\cancel{x \left(x + 3\right) \left(x - 2\right)}}$

Simplify the left side so that it looks like a general polynomial. First, distribute:

$A {x}^{2} + A x - 6 A + B {x}^{2} - 2 B x + C {x}^{2} + 3 C x = x + 1$

Group together terms.

$A {x}^{2} + B {x}^{2} + C {x}^{2} + A x - 2 B x + 3 C x - 6 A = x + 1$

Now make sure you get it into this correct form, $\boldsymbol{a {x}^{2} + b x + c}$:

$\underline{\left(A + B + C\right)} {x}^{2} + \underline{\left(A - 2 B + 3 C\right)} x + \underline{\left(- 6 A\right)}$

$= \underline{0} {x}^{2} + \underline{1} x + \underline{1}$

This means we have a system of three equations:

$A + B + C = 0$
$A - 2 B + 3 C = 1$
$- 6 A = 1$

Clearly, $\textcolor{g r e e n}{A = - \frac{1}{6}}$, so the rest follows. Add the negative of the second equation to the first.

$\text{ } A + B + C = 0$
$- \left(A - 2 B + 3 C = 1\right)$
$\text{------------------------------}$
$\text{ "" "" } 3 B - 2 C = - 1$

This gives $C = \frac{- 1 - 3 B}{- 2} = \frac{1}{2} + \frac{3}{2} B$, so from the first equation:

$- \frac{1}{6} + B + \frac{1}{2} + \frac{3}{2} B = 0$

$\frac{1}{6} - \frac{1}{2} = \frac{5}{2} B$

$\implies \textcolor{g r e e n}{B = - \frac{2}{15}}$

Thus:

$\textcolor{g r e e n}{C} = \frac{1}{2} + \frac{3}{2} \cdot - \frac{2}{15} = \textcolor{g r e e n}{\frac{3}{10}}$

You can verify $A$, $B$, and $C$ by plugging them back into the system of equations. And so, we have:

$\int \frac{x + 1}{{x}^{3} + {x}^{2} - 6 x} \mathrm{dx}$

$= - \frac{1}{6} \int \frac{1}{x} \mathrm{dx} - \frac{2}{15} \int \frac{1}{x + 3} \mathrm{dx} + \frac{3}{10} \int \frac{1}{x - 2} \mathrm{dx}$

We know the integral of $\frac{1}{u}$ to be $\ln | u |$. Thus:

$\implies \textcolor{b l u e}{\int \frac{x + 1}{{x}^{3} + {x}^{2} - 6 x} \mathrm{dx}}$

$\textcolor{b l u e}{= - \frac{1}{6} \ln | x | - \frac{2}{15} \ln | x + 3 | + \frac{3}{10} \ln | x - 2 | + C}$