Find, with proof, all values of $h$ so that $h + \sqrt{h^2 - 671}$ and $h - \sqrt{h^2 - 671}$ are both integers.
I found the two solutions $h=36$ and $h=336$ for these two equations, but I can't seem to justify why $h$ must be an integer. However, if I could, then one could easily see that $h=36$ and $h=336$ are the only possibilities using the following argument. Let $x=h+\sqrt{h^2 - 671}$ and $y = h-\sqrt{h^2 - 671}$. Then $(x-h)^2 = h^2 - 671$ so $x(x-2h) = -671$ and a similar equation is obtained for $y$. Since $671 = 1\cdot 671 = 61\cdot 11$, it follows that $\{x,2h-x\} \in \{\{11,61\}, \{1,671\}\}$ from which one can deduce that $h=36$ and $h=336$ are solutions.
Also, if $h$ were irrational, then how would one formally justify that the two given expressions in terms of h cannot be integers?
Note that $xy=671$ — without any $h$! This leaves you with only a few possibilities for $x,y$, and then must have $h=\frac{x+y}2$.