Integral $\int{\frac{1}{\sqrt{2x^2+x+1}}}dx$ I am trying to solve this integral but I can not figure what I do wrong.  

$$I=\int{\frac{1}{\sqrt{(2x^2+x+1)}}}dx$$

Here's how I go about it: I think that maybe it can be solved following the $$\int{\frac{1}{\sqrt{\color{red}{x}^2+\color{blue}{a}^2}}}dx=\ln\left(x+\sqrt{x^2+a^2}\right)$$
I turn the denominator into a sum of 2 products: 
$$2x^2+x+1=\left(x\sqrt{2}+\frac{1}{2\sqrt{2}}\right)^2+\left(\frac{\sqrt{7}}{2\sqrt{2}}\right)^2$$
and "$\color{red}{x}$" from the formula would be "$\left(x\sqrt{2}+\frac{1}{2\sqrt{2}}\right)$" while "$\color{blue}a$" would be "$\left(\frac{\sqrt{7}}{2\sqrt{2}}\right)$ also "$x^2+a^2$" is the denominator "$2x^2+x+1$".
When I plug in these numbers I get the following result:
$$I=\ln\left(\left(x\sqrt{2}+\frac{1}{2\sqrt{2}}\right)+{\sqrt{2x^2+x+1}}\right)$$ 
I sometimes check my results using an online integral calculator and for this one it shows a different result:$$\frac{\ln\left(\sqrt{\frac{(4x+1)^2}{7}+1}+\frac{4x+1}{\sqrt{7}}\right)}{\sqrt{2}}$$
I am sorry if the formatting is not quite right, It's the best I can do and it took me about an hour aswell. $\ddot \frown$ 
 A: Second edit:
On my second thought, I found that there is a rather intuitive way to look at the reason why you must factor out the coefficient of $x$. As you say, if you treat "$x$" as $(x\sqrt2 + \frac{1}{2\sqrt2})$, "$dx$" would then become $\sqrt2dx$ instead of $dx$ only. So if you substitute the numbers including $\sqrt2x$ into the formula, what you would get is actually $\sqrt2$ times the original integral. Thus you need to divide your answer by $\sqrt2$ to make it right. Does this explanation makes sense?
First edit:
I forgot what the proof is, but the condition of using that formula that you stated at the start is that the co-efficient of $x$ must be 1. So what you need to do at the start, is to factor out the $1/\sqrt2$, instead of forming the sum of two squares straightaway. Probably someone else could answer you why that condition I mentioned holds true.
Original answer:
There is actually nothing wrong with the calculation. However, you should not forget about the arbitrary constant when solving the indefinite integral. The coefficients "missing" from the integral can be added by taking from the arbitrary constant.
