What is the method to factor $x^3 + 1$? In the solution to a problem, it's stated that 

We see that $x^3+1=(x+1)(x^2-x+1)$.

Why is this, and what method can I use for similar problems with different coefficients?
The full problem is 

Find the remainder when $x^{81}+x^{48}+2x^{27}+x^6+3$ is divided by $x^3+1$. 


$x^3+1=(x+1)(x^2-x+1)$ is something one just knows, similar to how one knows that
$
x^2+2x+1=(x+1)^2
$, or $
x^2-1=(x+1)(x-1)
$
If you don't already know it, note that $(-1)^3+1=0$, which implies that $x-(-1)$ is a factor of $x^3+1$. Finding the second factor can be done through long division.
