# How do you integrate int (x^2+x+1)/(1-x^2) using partial fractions?

Aug 2, 2017

The answer is $= - x + \frac{1}{2} \ln \left(| x + 1 |\right) - \frac{3}{2} \ln \left(| x - 1 |\right) + C$

#### Explanation:

Let's simplify the quotient

$\frac{{x}^{2} + x + 1}{1 - {x}^{2}} = \frac{{x}^{2} + x + 1}{- {x}^{2} + 1} = \frac{- {x}^{2} - x - 1}{{x}^{2} - 1}$

$= - 1 + \frac{- x - 2}{{x}^{2} - 1} = - 1 - \frac{x + 2}{{x}^{2} - 1}$

Now, we perform the decomposition into partial fractions

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

The numerators are the same. we compare the numerators

x+2=A(x-1)+B(x+1))

Let $x = 1$, $\implies$, $3 = 2 B$, $\implies$, $B = \frac{3}{2}$

Let $x = - 1$, $\implies$, $1 = - 2 A$, $\implies$, $A = - \frac{1}{2}$

Therefore,

$\frac{{x}^{2} + x + 1}{1 - {x}^{2}} = - 1 + \frac{\frac{1}{2}}{x + 1} - \frac{\frac{3}{2}}{x - 1}$

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

$= - x + \frac{1}{2} \ln \left(| x + 1 |\right) - \frac{3}{2} \ln \left(| x - 1 |\right) + C$