Calculate $\int\frac{x}{x^2-x+1}\, dx$

integration

$$\int \frac{x}{x^2-x+1}\, dx = \int \frac{x}{(x-\frac 1 2)^{2} + \frac 3 4}\, dx = \int \frac{x}{(x-\frac 1 2)^2 + (\frac {\sqrt{3}} {2})^2}$$

Substitute $u= \frac{2x-1}{\sqrt{3}}, du=\frac{2}{\sqrt{3}}dx$:

$$\frac {\sqrt{3}} 2 \int \frac{\frac{\sqrt{3}} {2}u + \frac 1 2}{(\frac{\sqrt{3}}{2}u)^2+(\frac {\sqrt{3}}{2})^2} = \int \frac{u}{u^2+1}du + \frac{1}{\sqrt{3}}\int\frac 1 {u^2+1}du.$$

This gives $$\frac 1 2\log({u^2+1})+\frac{1}{\sqrt{3}}\arctan{u}.$$
Substituting back in x yields $$\frac 1 2\log(\frac 4 3x^2-\frac 4 3 x+ \frac 4 3)+\frac 1 {\sqrt{3}}\arctan(\frac{2x-1}{\sqrt{3}})$$

However, according to Wolfram Alpha, the integral should evaluate to $$\frac 1 2 \log(x^2-x+1)+\frac{1}{\sqrt{3}}\arctan(\frac{2x-1}{\sqrt{3}})$$After working some time on the integral, I know how to reach this solution, but I don't understand why my first attempt didn't arrive at the correct answer. Do you see where I went wrong?

Thank you for any help!

Best Answer

Hello and welcome to math.stackexchange. The solution that you developed and the one given by Wolfram Alpha only differ by a constant (of integration), since
$$ \frac 1 2\log(\frac 4 3x^2-\frac 4 3 x+ \frac 4 3) = \frac 1 2\log(x^2- x+ 1) + \frac 1 2 \log \frac 4 3 \, . $$

Related Question