Number of values for a such that the following polynomial has only integral roots: $P(x) =X^3-X+a^2+a$? How do I solve this problem? I thought of solving it with Viete but I only have 2 relations from which I can find the roots.

Let $(X-\alpha)(X-\beta)(X-\gamma) = X^3 - X + a^2 + a$ where $\alpha,\beta,\gamma \in \mathbb{Z}$. Then
$$\alpha + \beta + \gamma = 0, \qquad \alpha\beta + \alpha\gamma + \beta\gamma = -1, \qquad \alpha\beta\gamma = -a^2 -a.$$
From the first equation, $\gamma = -(\alpha + \beta)$. Then from the second equation
$$\alpha^2 + \alpha\beta + \beta^2 - 1 = 0$$
so 
$$\beta = \dfrac{-\alpha \pm \sqrt{4 -3\alpha^2}}{2}$$
but since $\alpha,\beta\in \mathbb{Z}$, then $\alpha$ must be either $0$ or $\pm 1$. This gives the solutions
$$(\alpha,\beta,\gamma) \in \{(-1,0,1), (-1,1,0),(0,-1,1),(0,1,-1),(1,-1,0),(1-0,-1)\}$$
Which means that $X^3 - X + a^2 + a = X(X-1)(X+1) = X^3 - X$, i.e. $a^2 + a = 0$ which can only happen if $a = 0$ or if $a = -1$ so there are only two possible values of $a$ for which the equation only have integral roots.
