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

Jun 10, 2016

$\arctan \frac{\frac{x + \frac{1}{2}}{\frac{\sqrt{3}}{2}}}{\frac{\sqrt{3}}{2}}$

#### Explanation:

${x}^{2} + x + 1$ has two complex conjugate roots.
Let us generalize solving for

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

developping and equating coefficients

$\left\{\begin{matrix}a \left(A + B\right) - j b \left(A - B\right) = 1 \\ A + B = 0\end{matrix}\right.$

Solving for $\left\{A , B\right\}$ we get

$A = \frac{j}{2 b} , B = - \frac{j}{2 b}$

$\int \frac{\mathrm{dx}}{{\left(x + a\right)}^{2} + {b}^{2}} = j \int \frac{\mathrm{dx}}{2 b \left(x + a + j b\right)} - j \int \frac{\mathrm{dx}}{2 b \left(x + a - j b\right)}$

then

$\int \frac{\mathrm{dx}}{{\left(x + a\right)}^{2} + {b}^{2}} = {\log}_{e} {\left(\frac{j \left(x + a\right) + b}{j \left(x + a\right) - b}\right)}^{\frac{1}{j 2 b}}$

but

$j \left(x + a\right) + b = \left(\sqrt{\left(x + a\right) + {b}^{2}}\right) {e}^{j \phi}$
$j \left(x + a\right) - b = \left(\sqrt{\left(x + a\right) + {b}^{2}}\right) {e}^{- j \phi}$

with $\phi = \arctan \left(\frac{x + a}{a}\right)$

then

$\int \frac{\mathrm{dx}}{{\left(x + a\right)}^{2} + {b}^{2}} = {\log}_{e} {\left({e}^{2 j \phi}\right)}^{\frac{1}{j 2 b}} = {\log}_{e} \left({e}^{\frac{\phi}{b}}\right) = \frac{\phi}{b}$

Finally we have

$\int \frac{\mathrm{dx}}{{\left(x + a\right)}^{2} + {b}^{2}} = \arctan \frac{\frac{x + a}{b}}{b}$

For $a = \frac{1}{2} , b = \sqrt{\frac{3}{4}}$

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