Integral $\int\frac{1}{1+x^3}dx$ 
Calculate$$\int\frac{1}{1+x^3}dx$$

After calculating the partial fractions I got:
$$\frac{1}{3}\int\frac{1}{x+1}dx+\frac{1}{3}\int\frac{2-x}{x^2-x+1}dx=\frac{1}{3}\ln(x+1)+\frac{1}{3}\int\frac{2-x}{x^2-x+1}dx$$
I have no idea on how to proceed. Am I missing a substitution or something?
 A: To integrate $\frac{2- x}{x^2- x+ 1}$, complete the square in the denominator:  $\int \frac{2- x}{x^2- x+ 1}dx= \int\frac{2- x}{x^2- x+ \frac{1}{4}-\frac{1}{4}+ 1}dx= \int\frac{2-x}{\left(x- \frac{1}{2}\right)+ \frac{3}{4}}dx$.
Now let $u= x- \frac{1}{2}$ so that $du= dx$ and $x= u+ \frac{1}{2}$ and $2- x= \frac{3}{2}- u$ and $dx= -dy.
$\int \frac{2- x}{x^2- x+ 1}dx= $$-\int \frac{\frac{3}{2}- u}{u^2+ \frac{3}{4}}du= $$-\frac{3}{2}\int\frac{du}{u^2+ \frac{3}{4}}+ \int\frac{u du}{u^2+ \frac{3}{4}}$.
A: Hint: You can break up your second calculated indefinite integral into two components as so:
$$\frac{2-x}{x^2-x+1} = -\frac{1}{2}(\frac{2x -1}{x^2-x+1}) + \frac{3/2}{(x-\frac{1}{2})^2 + 3/4}$$
Note that $x^2-x+1 = (x - \frac{1}{2})^2 + \frac{3}{4}$
A: Alternative approach: Partial fractions.
Recall that for any complex $z$, and any $n=1,2,...$
$$z^{1/n}=|z|^{1/n}\exp\left[\frac{i}{n}(2\pi k+\arg z)\right],\qquad k=0,1,...,n-1$$
Then plug in $z=-1$ and $n=3$ to see that $\arg z=\arg(-1)=\pi$ so that in fact,
$$1+x^3=\prod_{k=0}^2\left(x-\exp\frac{i\pi(2k+1)}3\right)$$
So, letting $r_k=\exp\frac{i\pi(2k+1)}3$, 
$$\frac1{1+x^3}=\prod_{k=0}^2\frac1{x-r_k}$$
Look! That's a thing we can do partial fractions on! To do so, we say that 
$$\prod_{k=0}^2\frac1{x-r_k}=\sum_{k=0}^2\frac{b(k)}{x-r_k}$$
$$\left(\prod_{a=0}^2(x-r_a)\right)\prod_{k=0}^2\frac1{x-r_k}=\left(\prod_{a=0}^2(x-r_a)\right)\sum_{k=0}^2\frac{b(k)}{x-r_k}$$
$$1=\sum_{k=0}^2\frac{b(k)}{x-r_k}\prod_{a=0}^2(x-r_a)$$
$$1=\sum_{k=0}^2b(k)\prod_{a=0\\ a\neq k}^2(x-r_a)$$
then for any $j=0,1,2$, we may plug in $x=r_j$ and notice that all the terms of the sum vanish except for the case $k=j$, which gives
$$1=b(j)\prod_{a=0\\ a\neq j}^2(r_j-r_a)$$
$$b(j)=\prod_{a=0\\ a\neq j}^2\frac1{r_j-r_a}$$
Which is an explicit formula for our partial fractions coefficients. Anyway, we may now integrate:
$$I=\int\frac{\mathrm dx}{1+x^3}=\int\sum_{k=0}^2\frac{b(k)}{x-r_k}\mathrm dx$$
$$I=\sum_{k=0}^2b(k)\int\frac{\mathrm dx}{x-r_k}$$
Which is very easily shown to be 
$$I=\sum_{k=0}^{2}b(k)\ln\left|x-r_k\right|$$
$$I=b(0)\ln\left|x-r_0\right|+b(1)\ln\left|x-r_1\right|+b(2)\ln\left|x-r_2\right|$$
And since $b(k)=\prod\limits_{a=0\\ a\neq k}^2\frac1{r_k-r_a}$, we have that 
$$
b(0)=\frac1{(r_0-r_1)(r_0-r_2)}\\
b(1)=\frac1{(r_1-r_0)(r_1-r_2)}\\
b(2)=\frac1{(r_2-r_0)(r_2-r_1)}$$
And from $\exp(i\theta)=\cos\theta+i\sin\theta$, 
$$
r_0=\exp\frac{i\pi}3=\frac{1+i\sqrt3}2\\
r_1=\exp\frac{3i\pi}3=-1\\
r_2=\exp\frac{5i\pi}3=\frac{1-i\sqrt3}2
$$
So
$$
b(0)=-\frac16(1+i\sqrt3)\\
b(1)=\frac16(1+i\sqrt3)\\
b(2)=\frac16(-1+i\sqrt3)
$$
And finally
$$I=-\frac{1+i\sqrt3}6\ln\left|x-\frac{1+i\sqrt3}2\right|+\frac{1+i\sqrt3}6\ln\left|x+1\right|+\frac{-1+i\sqrt3}6\ln\left|x+\frac{-1+i\sqrt3}2\right|+C$$

In fact, using the same method, it can be shown that
$$\int\frac{\mathrm dx}{1+x^n}=\sum_{k=0}^{n-1}\ln\left|x-\exp\frac{i\pi(2k+1)}{n}\right|\prod_{a=0\\a\neq k}^{n-1}\frac1{\exp\frac{i\pi(2k+1)}{n}-\exp\frac{i\pi(2a+1)}{n}}$$
