It is not easy to solve a quartic equation but we see that it is quadratic in a
= a^2 – a(2x^2+ 1) + x^4 + x
now we try to factor x^4 + x such that
sum is 2x^2 + 1
we have x^4+ x = x(x^3+1) =
x(x+1)(x^2- x + 1) = (x^2 + x)(x^2-x + 1)
so the 2 factors are x^2 + x and x^2-x
+ 1 as we see that sum is 2x^2+ 1
so the original expression factors to
(a-x^2-x)(a-x^2+x-1) or (x^2+x-a)(x^2-x+1-a)