I'm trying to factor $$x^4+2x^3+6x^2+2x+1$$
I compare a quartic equation to the form:
$$(x^2+ax+b)(x^2+cx+d)$$
$$x^4+(a+c)x^3+(b+d+ac)x^2+(ad+bc)x+bd$$
By comparing, I get 4 equations to solve:
$$a+c=2$$ $$b+d+ac=6$$ $$ad+bc=2$$ $$bd=1$$
I picked the solutions on the first line to get that
$$x^4+2x^3+6x^2+2x+1=(x^2+(1-\sqrt3)x+1)(x^2+(1+\sqrt3)x+1)$$
I check it with the value x=7. On the left side, I get 3396. On the right side, I get 3102. That means that I must have factored it wrongly.
What went wrong?

Note that $a=1-\sqrt3\,i$ and that $c=1+\sqrt3\,i$. So, you should have written$$\left(x^2+\left(1-\sqrt3\,i\right)x+1\right)\left(x^2+\left(1+\sqrt3\,i\right)x+1\right)$$instead.