Number of possible integer values of $x$ for which $\frac{x^3+2x^2+9}{x^2+4x+5}$ is integer How many integer numbers, $x$, verify that the following
\begin{equation*}
\frac{x^3+2x^2+9}{x^2+4x+5}
\end{equation*}
is an integer?
I managed to do:
\begin{equation*}
\frac{x^3+2x^2+9}{x^2+4x+5} = x-2 + \frac{3x+19}{x^2+4x+5}
\end{equation*}
but I cannot go forward.

Here is another method that works well when Diophantine quadratics $ax^2+bx+c=0$ are involved, it consists in saying that since a solution should exists then $\exists \delta\in\mathbb Z\mid b^2-4ac=\delta^2$.

In this problem we'd like $\quad\dfrac{3x+19}{x^2+4x+5}=n\quad$ to be an integer.
Thus applying the method to $$nx^2+(4n-3)x+(5n-19)=0$$

gives $\quad(4n-3)^2-4n(5n-19)=p^2\iff 4n^2-52n+(p^2-9)=0$

Which by itself should have solutions in $n$ : $\quad(-52)^2-4(4)(p^2-9)=q^2\iff 2848-16p^2=q^2$
We can divide by $16$ (setting $q=4r$) to get $$p^2+r^2=178$$
This has solutions $(\pm 3,\pm 13)$.



*

*case 1 : $p^2=3^2=9$
Leads to $4n^2-52n=0\iff 4n(n-13)=0\iff n=0,\ 13$
$n=0\implies 3x+19=0$ impossible
$n=13\implies 13x^2+49x+46=(x+2)(13x+23)=0$ and we verify that $x=-2$ is solution.



*

*case 2: $p^2=13^2=169$
Leads to $4n^2-52n+160=4(n-5)(n-8)=0\iff n=5,\ 8$
$n=5\implies 5x^2+17x+6=(x+3)(5x+2)=0$ and we verify that $x=-3$ is solution.
$n=8\implies 8x^2+29x+21=(x+1)(8x+21)=0$ and we verify that $x=-1$ is solution.

Finally we have found all solutions $x\in\{-3,-2,-1\}$
