Alright, so I know that this is a couple months late, but here it is.

In this note, I will discuss how to find the maximum possible integral value of both x and y such that \(\sqrt{a^2x^2+bx+c}\) is an integer (note that \(b\neq 2a\sqrt{c}\) or else it can be factored to \((ax+c)^2\) which is integral for all integral values of ax).

Begin with the generic quadratic \(y=\sqrt{a^2x^2+bx+c}\).

Since \(a^2x^2\) is guaranteed a perfect square, \(bx+c\) must be a difference of squares. A short proof for this is \(y^2=a^2x^2+bx+c\Rightarrow y^2-a^2x^2=bx+c\)

This means that the left side can be rearranged to

\[\begin{eqnarray}
ax+n &=& \sqrt{a^2x^2+bx+c}\\
a^2x^2+2axn+n^2 &=& a^2x^2+bx+c\\
bx-2axn&=&n^2-c\\
x(b-2an)&=&n^2-c\\
x&=&\boxed{\dfrac{n^2-c}{b-2an}}\\
\end{eqnarray}\]

NOTE: \(n\) is a variable that is an integer.

This is maximized when the denominator is minimized or as the numerator tends infinity. Thus to minimize the denominator, \(n\approx \dfrac{b}{2a}\) (look familiar? It's the same as the negation of the vertex of a parabola. Why this is, I have no idea). The \(\approx\) sign (it means approximately) is important for two reasons. 1) because \(n\) has to be integral for y to be integral and \(\dfrac{b}{2a}\) isn't always integral. 2) \(n\) can't exactly equal \(\dfrac{b}{2a}\) because if it does, then we are dividing by 0 and the world will implode.

NOTE: this is a plug and chug because we need to find an integral value of n that will make the numerator divisible by the denominator.

Now that we have found the maximum value of x, we can plug this in to find y.

\(y=\sqrt{a^2x^2+bx+c}\)

\(y=\sqrt{a^2\left(\dfrac{n^2-c}{b-2an}\right)+b\left(\dfrac{n^2-c}{b-2an}\right)+c}\)

\(rearranging...\)

\(\boxed{y=\left|\dfrac{bn-a(n^2+c)}{b-2an}\right|}\)

(the long bars denote absolute value.. sorry it looks so bad)

This also further proves that y is maximized when \(n\) is as close as possible to \(\dfrac{b}{2a}\).

## Practice section

Maximum possible integer square root polynomial 1 (easier)

Maximum possible integer square root polynomial 2 (harder)

## Comments

Sort by:

TopNewestI have a few questions:

Why did you let \(y=ax+n\)?

Why is \(f(n)=\dfrac{n^2-c}{b-2an}\) maximized at \(n\approx \dfrac{b}{2a}\)? – Daniel Liu · 1 year, 10 months ago

Log in to reply

For The second half, it is not maximized there. But that is the largest possible integral value that is achievable by that function. I don't have a "full" proof as I'm very bad at explaining this kind of thing. If you'd like me to I could try to type up a full explicit proof for this.

Which also reminds me. I have a proof of why n must be integral for x to be integral. I could add that if you'd like me to. – Trevor Arashiro · 1 year, 10 months ago

Log in to reply

How did you wrote \[y =ax+n\]?

And there is \[x^{2}\] missing in the same expression. – Kushal Patankar · 2 years, 3 months ago

Log in to reply

But \(y=ax+n\) because \(a^2x^2\) is guaranteed a perfect square, so \(bx+c\) must be a difference between two squares. Assuming that \(bx+c\neq 0\), n is just an arbitrary value that is the difference between \(a^2x^2\) and \(y^2\). You could guess many numbers for the Max value of x to find a perfect square value for \(a^2x^2+bx+c\), but you would never know when to stop. This method allows you to check for values of n and know when you find the max value for x (since the denominator should be minimized). – Trevor Arashiro · 2 years, 3 months ago

Log in to reply

there it is

Log in to reply

– Trevor Arashiro · 2 years, 3 months ago

ah, thanks, missed thatLog in to reply