\[a^{3} + 27 - 3a - a^{2} =\]
\[= (a + 3)\left( a^{2} - 3a + 9 - a \right) =\]
\[= (a + 3)(a^{2} - 4a + 9)\]