<s>[INST] Given a polynomial $W(x)$. Find all pairs of integers $a,b$ that satisfy $W(a)=W(b)$ Given a polynomial $W(x) = x^4-3x^3+5x^2-9x$. Find all pairs of distinct integers $a,b$ that satisfy $W(a)=W(b)$. My approach was to factor the polynomial.
$$\begin{align*}
x^4-3x^3+5x^2-9x &= (x^4-3x^3+2x^2)+(3x^2-9x+6)-6\\
 &= x^2(x^2-3x+2)+3(x^2-3x+2)-6\\
&=(x-1)(x-2)(x^2+3)-6
\end{align*}$$
As $-6$ is a constant we can now consider the  following expression $$\\(x-1)(x-2)(x^2+3)$$ form this form we see that $(a,b)=(1,2)$ and $(a,b)=(2,1)$ satisfy the condition. We can also graph this function and see that $(1)$WLOG $a\ge 2$ and $b\le 1$ but as $1$ and $2$ have been used we get $a\ge 3$ and $b\le 0$. Now, if $|b|>|a|$ the following holds  $$\\(b-1)(b-2)(b^2+3)>(a-1)(a-2)(a^2+3)$$
So we get that $|a|>|b|$ and $(1)$.  How do I proceed? Any help appreciated.
 [/INST] I would proceed from there as follows :
One can say that if $a\geqslant 3,b\leqslant 0$ and $|b|\color{red}{\geqslant}|a|$, then $$\\(b-1)(b-2)(b^2+3)>(a-1)(a-2)(a^2+3)$$
So one gets that $a\geqslant 3,b\leqslant 0$ and $|a|>|b|$.
Note that if $a\geqslant 3$ and $b\leqslant 0$, then $|a|\gt |b|$ is equivalent to $a+b\gt 0$.
One has
$$\begin{align}0&=(a-1)(a-2)(a^2+3)-(b-1)(b-2)(b^2+3)
\\\\&=(a - b) (a^3+ b^3 + a^2 b + a b^2 - 3 a^2 - 3 b^2- 3 a b + 5 a   + 5 b - 9)
\\\\&=(a-b)\bigg((a+b)^2(a+b-3)-ab(2(a+b)-3)+5(a+b)-9\bigg)\end{align}$$
So, if $a\geqslant 3,b\leqslant 0$ and $a+b\geqslant 3$, then
$$0=(\underbrace{a-b}_{\text{positive}})\bigg(\underbrace{(a+b)^2(a+b-3)-ab(2(a+b)-3)}_{\text{non-negative}}+\underbrace{5(a+b)-9}_{\text{positive}}\bigg)$$
where LHS is zero while RHS is positive, which is impossible.
So, if $a\geqslant 3,b\leqslant 0$ and $a+b\gt 0$, then $a+b=1$ or $2$.

*

*If $b=1-a$, then $0 = (2 a - 1) (a^2 - a + 6)$ has no integer solutions.


*If $b=2-a$, then $0 = (a - 3) (a - 1) (a + 1)$ implies $a=3$.
In conclusion, the answer is
$$(a,b)=(2,1),(1,2),(3,-1),(-1,3)$$
</s>