Integral of $\frac{1}{x^2+x+1}$ and$\frac{1}{x^2-x+1}$ How to integrate two very similar integrals. I am looking for the simplest approach to that, it cannot be sophisticated too much as level of the textbook this was taken from is not very high. $$\int \frac{1}{x^2+x+1} dx$$ and$$\int \frac{1}{x^2-x+1} dx$$

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