<s>[INST] help me to evaluate these integrals Find the value of $$\int\frac{x}{x^2-x+1} dx$$ and $$\int\frac{1}{x^2-x+1} dx$$ This was not the original question. Original question was tougher and I have simplified that to these two integrals. I am having a hard time evaluating these two integrals but what I know is that, in these two integrals there is arctan occurring in a term of both integrals. Maybe we have to do some operations in the numerators?
Any help will be greatly appreciated.
EDIT: The original question was: $$\int\frac{3x}{x^3+1}dx$$
EDIT: $$\begin{align}\int\frac{3x}{x^3+1}dx&=3\int\frac{x}{x^3+1}dx\\&=3\int\frac{x+1}{3x^2-3x+3}dx - 3\int\frac{1}{3x+3}dx\\&=\int\frac{x+1}{x^2-x+1}dx - \int\frac{1}{x+1}dx\end{align}$$
The value of last integral is $\ln|x+1|$ so we will consider it later. We will only consider the first integral now and we can write that as:
$$\int\frac{x}{x^2-x+1}dx + \int\frac{1}{x^2-x+1}dx$$ after this I am stuck.
 [/INST] The real problem is the second integral since the first one has the form
\begin{align}
\int{{x \over x^2-x+1}dx} & = \int{{x-{1 \over 2} \over x^2-x+1}dx}+{1 \over 2}\int{{1 \over x^2-x+1}dx} \\
& = {1 \over 2}\int{{1 \over x^2-x+1}d(x^2-x+1)}+{1 \over 2}\int{{1 \over x^2-x+1}dx} \\
& = {1 \over 2}\bigg(\log{(x^2-x+1)}+\int{{1 \over x^2-x+1}dx}\bigg)
\end{align}
To solve the second one, we notice $\int{{1 \over y^2+1}dy}=\int{{1 \over \tan^2{\theta}+1}d\tan{\theta}}=\int{{1 \over \sec^2{\theta}}\sec^2{\theta}d\theta}=\theta=\arctan{y}$. Therefore, it is easy with
\begin{align}
\int{{1 \over x^2-x+1}dx} & = \int{{1 \over (x-{1 \over 2})^2+{3 \over 4}}d(x-{1 \over 2})} \\
& = \sqrt{4 \over 3}\int{{1 \over \bigg(\sqrt{4 \over 3}(x-{1 \over 2})\bigg)^2+1}d\bigg(\sqrt{4 \over 3}(x-{1 \over 2})}\bigg) \\
& = \sqrt{4 \over 3}\arctan{\bigg(\sqrt{4 \over 3}(x-{1 \over 2})\bigg)}
\end{align}
</s>