TITLE: Condition For Integer Roots
QUESTION [6 upvotes]: Find the number of values of a such that the eauation$$x^2+ax+6a$$ has integer roots.
$$x=\frac{-a\pm\sqrt{a^2-24a}}2$$
let$$a^2-24a=m^2$$where m$\in\Bbb{Z}$ $$(a-12)^2=m^2+12^2$$
$$a=12\pm\sqrt{m^2+144}$$
now by putting different values of $m$ $(0,5,35)$ we get the number of values of $a$ as as 6. Is there any other method where I don't have to check the values of $m$ ?

REPLY [4 votes]: we get the number of values of $a$ as as 6. 

I don't think this is correct. For example, $m=16$ works.

Is there any other method where I don't have to check the values of $m$ ? 

We have
$$a=\frac{-x^2}{x+6}=-x+6-\frac{36}{x+6}$$
Since $a$ has to be an integer, 
$$\frac{36}{x+6}$$
has to be an integer. So, $x+6$ has to be a divisor of $36$. 
Note here that the discriminant is $a^2-24a$, so considering the cases where $a=0$ or $a=24$ gives : for $a=0$, $x=0$, and for $a=24$, $x=-12$. 
Now since the number of the divisors of $36$ is $18$, the number of $a$ we want is 
$$1+1+\frac{18-2}{2}=\color{red}{10}$$