The value of the expression $x^4-8x^3+18x^2-8x+2$ when $x=\cot\frac{\pi}{12}$ The value of the expression $x^4-8x^3+18x^2-8x+2$ when $x=\cot\frac{\pi}{12}$

I know that $\cot\frac{\pi}{12}=2+\sqrt3$,but putting this value and evaluating is a long process.Isn't there a short and intuitive method to solve this?

The hint
$$x^4-8x^3+18x^2-8x+2=(x^2-4x+1)^2+1$$ and try to solve
$$x^2-4x+1=0.$$
