$(x-a)$ is a factor of the polynomial $P(x)$, where $a$ is an integer. If $P(x) = x^3-kx^2+2kx-8$, prove that the values of k for which P(x) has real roots are $K\le-2$ or $K\ge6$.
I tried differentiating it and using the discriminant but I couldn't that prove $K\le-2$
Thanks in advance