Find $x$ so that rational function is an integer

algebra-precalculusintegerspolynomialsrational numbersrational-functions

Find all rational values of $x$ such that $$\frac{x^2-4x+4}{x^2+x-6}$$ is an integer.

How I attempt to solve this: rewrite as $x^2-4x+4=q(x)(x^2+x-6)+r(x)$. If we require that $r(x)$ be an integer then we can get some values of $r(x)$ by solving $x^2+x-6=0$, so that $x=-3$ or $x=2$. In the former case, $r=25$, and in the latter case $r=0$.

[I should note, however, that I'm not really convinced that this step is actually correct, because when $x$ is a root of $x^2+x-6$, the rational function above can have no remainder due to division by $0$. But I read about it as a possible step here and I can't explain it. Q1 How can this be justified?]

Now we want $(x^2+x-6)$ to divide $0$ (trivial) or $x^2+x-6$ to divide $25$. So we set $x^2+x-6=25k$ for some integer $k$ and solve. So $$x=\frac12 (\pm5\sqrt{4k+1}-1)$$

One of the trial-and-error substitutions for $k$ and then for $x$ gives $x=-8$, but that is just one number. Q2: So I'm wondering, how can we find all such $x$? The condition here is that $4k+1$ must be a perfect square, $k\ge 0$. Aren't there infinitely many perfect squares of this form?

I'd appreciate some clarifications about these two questions, Q1 and Q2.

Best Answer

$\frac{x^2-4x+4}{x^2+x-6}=\frac{x-2}{x+3}=1-\frac{5}{x+3}$, for this to be an integer, $\frac{5}{x+3}$ has to be an integer.

Say, $\frac{5}{x+3}=K$, where $K \in \Bbb Z$. This implies for each $K \in \Bbb Z$, $x=\frac{5}{K}-3$ would make the given expression an integer.