How to factorize the polynomial $a^6+8a^3+27$? 
I would like to factorize $a^6+8a^3+27$.

I got different answers but one of the answers is 
$$(a^2-a+3)(a^4+a^3-2a^2+3a+9)$$
Can someone tell me how to get this answer? Thanks.
 A: $$a^6+8a^3+27= (a^2)^3+3^3+(-a)^3-3\cdot a^2\cdot3(-a)$$
Now $$x^3+y^3+z^3-3xyz=(x+y+z)(x^2+y^2+z^2-xy-yz-zx)$$
See :  If $a,b,c \in R$ are distinct, then $-a^3-b^3-c^3+3abc \neq 0$.
A: The roots of $a^6+8a^3+27$ are the cubic roots of the roots of $x^2+8x+27$, given by $-4\pm\sqrt{-11}$. If we set $\alpha=-4+\sqrt{-11}=\left(\frac{1-\sqrt{-11}}{2}\right)^3$ and $\omega=\exp\left(\frac{2\pi i}{3}\right)$, it follows that:
$$ a^6+8a^3+27 = \color{red}{\left(a-\alpha^{1/3}\right)\left(a-\bar{\alpha}^{1/3}\right)}\color{blue}{\left(a-\omega\alpha^{1/3}\right)\left(a-\omega\bar{\alpha}^{1/3}\right)\left(a-\omega^2\alpha^{1/3}\right)\left(a-\omega^2\bar{\alpha}^{1/3}\right)}$$
and we just have to understand how to "couple back" such factors (as suggested by colors), that is easy through the identities
$$ \alpha^{1/3}+\bar{\alpha}^{1/3}=1,\qquad \alpha\bar{\alpha}=3^3,\qquad \omega+\bar{\omega}=-1. $$
A: One may write
$$
\begin{align}
a^6+8a^3+27&=a^3\left(a^3+\frac{27}{a^3}+8 \right)
\\&=a^3\left(\left(a+\frac3a\right)^3-9\left(a+\frac3a\right)+9-1 \right)
\\&=a^3\left(\left[\left(a+\frac3a\right)^3-1\right]-9\left[\left(a+\frac3a\right)-1\right] \right)
\\&=a^3\left(a+\frac3a-1\right)\left(\left(a+\frac3a\right)^2+\left(a+\frac3a\right)-8 \right)
\\&=a \cdot \left(a+\frac3a-1\right)\cdot a^2 \cdot\left(\left(a+\frac3a\right)^2+\left(a+\frac3a\right)-8 \right)
\\&=\left(a^2-a+3\right)(a^4+a^3-2a^2+3a+9).
\end{align}
$$
A: Here's a slightly sneaky way to arrive at the factorization.
Let $P(a)=a^6+8a^3+27$.  Then
$$P(10)=1008027=3\cdot3\cdot31\cdot3613=93\cdot3\cdot3613=(10^2-10+3)\cdot3\cdot3613$$
so we might guess that $a^2-a+3$ is a factor of $a^6+8a^3+27$.  If it is, then the other factor would have to take the form $a^4+a^3+\cdots+9$ (so that the product with $a^2-a+3$ has no $a^5$ term and ends with a $27$), and we can see that
$$3\cdot3613=10839=10^4+10^3-2\cdot10^2+3\cdot10+9$$
suggests $a^4+a^3-2a^2+3a+9$ as the other factor.
Note, one might also try grouping $P(10)=9\cdot31\cdot3613=(10-1)\cdot31\cdot3613$, but $a-1$ is clearly not a factor.  (Note also that the hard work that's been swept under the rug here is the work that goes into factoring $1008027$.)
A: By the rational root theorem, we guess the factors include at least one of the following:
$$x \pm 27$$
$$x \pm 9$$
$$x \pm 3$$
$$x \pm 1$$
Where did I get those?


*

*Take the absolute value of the last term (in descending order), $27$, and the absolute value of the last term, $1$.

*Take the factors of each:
$$27: \color{red}{1,3,9,27}$$
$$1: \color{green}{1}$$


*Consider $x-a$ where $a$ may be any of the ff:


$$\pm \frac{\color{red}{27}}{\color{green}{1}}$$
$$\pm \frac{\color{red}{9}}{\color{green}{1}}$$
$$\pm \frac{\color{red}{3}}{\color{green}{1}}$$
$$\pm \frac{\color{red}{1}}{\color{green}{1}}$$
