Evaluating the following integral: $\int\frac1{x^3+1}\,\mathrm{d}x$ How to integrate
$$\int\frac1{x^3+1}~\mathrm{d}x$$
Is it possible to use Taylor expansion?
 A: Hint:
$$ x^3 + 1 = (x+1)(x^2 - x + 1) $$
Now, use partial fractions.
A: If $x^3 + 1=0$ then $x^3=-1$ so $x=-1$, at least if $x$ is real.
If you plug $-1$ in for $x$ in a polynomial and get $0$, then $x-(-1)$ is a factor of that polynomial.
So you have $x^3+1=(x+1)(\cdots\cdots\cdots\cdots)$.
The second factor can be found by long division or other means.  It is $x^2-x+1$.
Can that be factored?  Solving the quadratic equation $x^2-x+1=0$ yields two non-real solutions, complex conjugates of each other.
Doing arithmetic or algebra with complex numbers is in many ways just like doing the same things with real numbers.  But doing calculus with complex numbers opens some cans of worms that get dealt with in more advanced courses.  With real numbers, the quadratic polynomial $x^2-x+1$ is irreducible, i.e. cannot be factored.  The quickest way to see that is by observing that the discriminant $b^2-4ac$ is negative.  A way that's not as quick but that may give some insight is completing the square:
$$
x^2-x+1 = \left( x-\frac12\right)^2 + \frac 3 4.
$$
Obviously this can never be $0$ when $x$ is real, so this can't be factored with real numbers.
So
$$
\frac{1}{x^3+1} = \frac{A}{x+1} + \frac{Bx+C}{x^2-x+1}
$$
and then you have to find $B$ and $C$.
Now another difficulty comes along: How to find
$$
\int \frac{Bx+C}{x^2-x+1} \,dx\text{ ?}
$$
Let $u=x^2-x+1$ so that $du = (2x-1)\,dx$ and you get part of it:
$$
(Bx+C)\,dx = \underbrace{\frac B 2 (2x-1)\,dx} + \left(C + \frac B2\right)\,dx.
$$
The substitution handles the part over the $\underbrace{\text{underbrace}}$.   What about the other part?  You have
$$
\text{constant}\cdot\int \frac{dx}{x^2-x+1}.
$$
Complete the square:
$$
\int \frac{dx}{\left(x - \frac 12\right)^2 + \frac 3 4}.
$$
Starts to remind you of an arctangent, but you have $3/4$ where you need $1$.
$$
\int \frac{dx}{\left(x - \frac 12\right)^2 + \frac 3 4} = \frac 4 3 \int \frac{dx}{\frac43\left(x-\frac12\right)^2+1}
$$
Now
$$
\frac43\left(x-\frac12\right)^2+1 = \left(\frac{2x-1}{\sqrt{3}}\right)^2+1
$$
So let $w=\dfrac{2x-1}{\sqrt{3}}$ and $\sqrt{3}\,dw=dx$, and then you're almost done.
