Rational Numbers – Determine Integers for Rational Square Root

rational numberssquare-numbers

the question

Determine all the integers $x$ that have the property that $\sqrt{x^2+7x+21}$ is a rational number.

the idea

The number would be rational only if $x^2+7x+21$ would be a square number which means that $x^2+7x+21=k^2 => k^2-x^2=(x+k)(k-x)=7(x+3)$.

From here i thought of going with divisibilities, but got nothing useful. Idk what to do froward. Hope one of tou can help me! Thank you!

Best Answer

While there is a solution by completing a square, I want to present another way. We have that $x^2+7x+21$ is a square of an integer.

Let $x>0$. Then $$(x+3)^2< x^2+7x+21< (x+5)^2.$$ It means that $$x^2+7x+21=(x+4)^2.$$ This gives $x= 5$. Now let $x\le-9$. Then $$(x+4)^2< x^2+7x+21< (x+3)^2+12<(x+2)^2.$$

So we have that $$x^2+7x+21=(x+3)^2.$$ This gives $x= -12$. Now we just try all $x$ from $\{-8,-7,-6,-5,-4,-3,-2,-1,0\}$ and find that $x=-3$ and $x=-4$ work, too. So the answer is $x\in\{-12,-4,-3,5\}$.

Related Question