# Find int \ (x^2+x+1)/(x^2(x+2)) \ dx  using partial fractions?

Sep 30, 2017

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

#### Explanation:

We seek:

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

We can decompose the integrand into partial fractions:

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

${x}^{2} + x + 1 \equiv A x \left(x + 2\right) + B \left(x + 2\right) + C {x}^{2}$

Where $A , B , C$ are constants that are to be determined. We can find them by substitutions (In practice we do this via the "cover up" method:

Put $x = 0 \implies 1 = 2 B \implies B = \frac{1}{2}$
Put $x = - 2 \implies 3 = 4 C \implies C = \frac{3}{4}$
Coeff$\left({x}^{2}\right) : 1 = A + C \implies A = \frac{1}{4}$

Hence, we can now write the integral as:

$I = \int \setminus \frac{\frac{1}{4}}{x} + \frac{\frac{1}{2}}{x} ^ 2 + \frac{\frac{3}{4}}{x + 2} \setminus \mathrm{dx}$
$\setminus \setminus = \frac{1}{4} \int \setminus \frac{1}{x} \setminus \mathrm{dx} + \frac{1}{2} \int \setminus \frac{1}{x} ^ 2 \setminus \mathrm{dx} + \frac{3}{4} \setminus \int \frac{1}{x + 2} \setminus \mathrm{dx}$
$\setminus \setminus = \frac{1}{4} \ln | x | + \frac{1}{2} {x}^{- 1} / \left(- 1\right) + \frac{3}{4} \ln | x + 2 | + C$
$\setminus \setminus = \frac{1}{4} \ln | x | - \frac{1}{2 x} + \frac{3}{4} \ln | x + 2 | + C$