Put fraction in "arctan-friendly" form I would like to put $\int\frac{1}{(2x^2+x+1)}dx$ into something like $\int\frac{1}{(u^2+1)}dx$. What is the quickest way to proceed? I know that previous fraction can be rewritten as $2t^2+t+1 = \frac{7}{8}\left( \left( \frac{4t+1}{\sqrt{7}} \right)^2 +1 \right)$, but I don't have any explaination from where this comes from.
Finally, the integral yields 
$$\int_b^a \frac{7}{8} \left( \left(\frac{4t+1}{\sqrt{7}} \right)^2+1 \right)dt = \frac{2}{\sqrt{7}}\left[\arctan \left(\frac{4t+1}{\sqrt{7}}\right)\right]^a_b $$

Multiply numerator and denominator by $4\cdot 2=8$ (the $2$ is the coefficient of $x^2$) and “complete the square”:
$$
\frac{1}{2x^2+x+1}=
\frac{8}{16x^2+8x+8}=
\frac{8}{16x^2+8x+1+7}=
\frac{8}{(4x+1)^2+7}
$$
Now you know that you should set $4x+1=u\sqrt{7}$, so you get
$$
\frac{8}{7}\frac{1}{u^2+1}
$$
Moreover, $4\,dx=\sqrt{7}\,du$ and the integral becomes
$$
\int\frac{8}{7}\frac{1}{u^2+1}\frac{\sqrt{7}}{4}\,du=
\frac{2}{\sqrt{7}}\int\frac{1}{u^2+1}\,du=
\frac{2}{\sqrt{7}}\arctan u+c=
\frac{2}{\sqrt{7}}\arctan\left(\frac{4x+1}{\sqrt{7}}\right)+c$$
