Dividing a polynomial with integer coefficients by a quadratic In the following question, one of the coefficients of the divisor quadratic polynomial is unknown; so, it cant be factored for performing synthetic division. I tried to perform long division hoping to get some clues but ran into a conflict.
Appreciate your help. Thanks!!
Here is the question:
$x^2 -x +a$  evenly divides $x^8 + 5x^6 + 13x^4 + 20x^2 +36$. Determine positive integer $a$.
A few things I noted are:

*

*$a$ must be a factor of 36 so, I am thinking $a$ would be from $\{1, 2, 3, 4, 6, 9, 12, 18, 36\}$

*All the coefficients of the dividend polynomial are integers and degrees of all the terms are even. Not sure how to use this info.

*$P(x) = Q(x)(x^2 -x +a) + mx + n$.  Since the remainder is zero, $m$ and $n$ are zero. When I tried long division, I got two equations; but the value of $a$ would come as imaginary which conflicts with the first observation and the question asks for real integer $a$.


Some quick observations : if $x$ is a root of $P(x)$ then so is $-x$. Thus if $(x^2-x+a)$ is a factor of $P(x)$, so is $(-x)^2-(-x)+a=x^2+x+a.$
Then $(x^2-x+a)(x^2+x+a)=x^4+(2a-1)x^2+a^2$ is a factor of $P(x)$. $\, a^2|36 \,$ $\Rightarrow a \in \{1,2,3,6\}$. (Here @Anwesha1729 observe in their answer that as $P(x)$ takes odd values also for integer $x$, $a$ must be odd.)
Let $P(x)=(x^4+(2a-1)x^2+a^2)(x^4+bx^2+c)$.
Comparing coefficients :
$$b+(2a-1)=5$$
$$a^2+c+(2a-1)b=13$$
$$a^2b+(2a-1)c=20$$
$$a^2c=36$$
It can be readily checked $a=3$ $\, (b=0,c=4)$
