Integrating $\int \frac{dx}{x^2+x+1}$ I am trying to evaluate the following integral:
$$I=\int \frac{dx}{x^2+x+1}$$
I am not supposed to do it with complex numbers so it's kind of hard.
I checked the answer on WolframAlpha.
It gives $$I=\frac{\sqrt{3}}{2}\arctan{\left(\frac{\sqrt{3}}{2}x+\frac{1}{2}\right)}+C $$
Having this information I found that I need to set
$$t=\frac{\sqrt{3}}{2}x+\frac{1}{2}$$
consequently: $x^2+x+1=\frac{3}{4}(t^2+1)$   and  $dx=\frac{\sqrt{3}}{2}dt$
therefore: $$I=\frac{2}{\sqrt{3}} \int \frac{dt}{t^2+1}$$ which can be found easily by setting $t=\tan{\theta}$ giving the same answer stated above.
Practically, I cheated: if I had not known the final answer I would have not guessed what I needed to set as $t$.
My question is: how should I think in order to find this integral?
Is there a method to find integrals of the form $$\int \frac{dx}{ax^2+bx+c}$$
Without knowing the answer, how can I solve such integral?
Thanks

Answering your second question. 
Since $ax^2 + bx+c = a\Bigg[x^2 + \frac{b}{a}x + \frac{c}{a}\Bigg] = a\Bigg[(x+\frac{b}{2a})^2 - \frac{b^2 - 4ac}{4a^2} \Bigg]$ then
$$\int \frac{1}{ax^2+bx+c}dx = \frac{1}{a}\int \frac{1}{(x+\frac{b}{2a})^2 - \frac{b^2 - 4ac}{4a^2}}dx$$
And the next step will depend on the sign of $b^2-4ac$. 
