<s>[INST] 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$. 

 [/INST] For the full problem, working modulo $x^3+1$ we have $$x^3=-1\implies x^{3n}=(-1)^n\implies x^{81}+x^{48}+2x^{27}+x^6+3=-1+1-2+1+3=2.$$
So no such factorisation is needed. But when it is needed, here's how to do it. By the factor theorem, the fact that $(-1)^3+1=0$ implies $x-(-1)=x+1$ is a factor. So try $x^3+1=(x+1)(ax^2+bx+c)$. We know $a=1$ from the $x^3$ coefficient and $c=1$ from the constant term, and the $x^2$ coefficient tells us $0=a+b\implies b=-1$.
</s>