# 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$$

• complete the square Commented May 20, 2017 at 12:17
• that was the point, I didn't get how to do it!
– dgan
Commented May 20, 2017 at 12:31
• @DenisGantsev: It's definitely surprising to see that someone got all the way to learning about integrals without ever learning about completing the square, which is the basis of the quadratic formula and is taught long before calculus. I'm assuming you merely forget how to do it? Or did they never teach it to you? Also, regardless of the answer, you should really consider reviewing algebra so that these become second nature to you. Otherwise higher-level math will not be friendly! Commented May 20, 2017 at 19:18
• I am studying at-distance. I dont have a real teacher, only exercises and answers. Also, I know what's quadratic formula is, I just didn't know how to use it in this case... whatever, its ok now
– dgan
Commented May 20, 2017 at 22:45

Note that $$(ax+b)^2=a^2x^2+2abx+b^2$$ Now we want to complete the square on $2x^2+x+1$. We then have $a^2=2, 2ab=1$ $\implies 4a^2b^2=1 \implies b^2=\frac 1 8$. Thus, we write $$2x^2+x+1 = \left(2x^2+x+\frac 1 8\right)+\frac 7 8 = \left(\sqrt 2 x+\frac{1}{2\sqrt 2}\right)^2+\frac 7 8$$ Thus, letting $\sqrt2 x+\frac{1}{2\sqrt 2}=\sqrt{\frac 7 8}\tan\theta$, our integral becomes $$\int \frac{1}{\frac 7 8 \tan^2 \theta+\frac 7 8}\cdot \frac {\sqrt{7}} 4\sec^2\theta d\theta$$
• Since $2ab$ is positive, $a$ and $b$ have to have the same sign. I could have also chosen them to be both negative, but that would have looked messier. Commented May 20, 2017 at 12:51
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$$
• +1 for evaluating the integral and avoiding $\tan^2$ & $\sec^2$. Commented May 20, 2017 at 18:50