\(x^{12}-3x^6+1=\left(x^{12}+x^9-x^6\right)-\left(x^9-x^3+x^6\right)-\left(x^3-1+x^6\right)=x^6\left(x^6+x^3-1\right)-x^3\left(x^6+x^3-1\right)-\left(x^6+x^3-1\right)\)
\(=\left(x^6+x^3-1\right)\left(x^6-x^3-1\right)\)
x12-2x6+1-x6
=(x6-1)2-x6
= (x6-1-x3)(x6-1+x3)
\(x^{12}-3x^6+1=\left[\left(x^6\right)^2-2x^6+1\right]-x^6=\left(x^6-1\right)^2-\left(x^3\right)^2=\left(x^6-1-x^3\right)\left(x^6-1+x^3\right)\)