I have already looked at this post and this post but can't seem to apply completing the square to some cases because the numbers become non-integers.
Given a quadratic equation of the form $$f(x)=ax^2+bx+c$$ $$a,b,c \in \mathbb{Z}$$ $$ a, b, c \neq 0,$$ How can I determine whether or not $f(x)$ will ever yield a value that is a perfect square integer?
The second post I linked has a method of completing the square for equations of the form $4x^2+4kx-p$ which is slightly too specific for my case, but has led me on the right track.
Based on this comment by Andre Nicholas, it appears to be difficult to tackle this problem in the general case for arbitrary $a, b, c$, so I will place some constraints:
In addition to $a, b, c \neq 0$, assume the following:
- $a$ is always a product of two perfect square integers and is therefore always a perfect square itself (i.e., $a = m^2n^2 = (mn)^2$)
- $a,$ $b,$ and $c$ need not divide one another, but $gcd(a,b,c)$ is always a perfect square $\gt 1$
- $c$ is never a perfect square so the trivial case $f(0)$ will never be a perfect square
Take, for example,
$$f(x)=810000x^2-45642249684x+642606171242553$$ $$g(x)=810000x^2-45641877084x+642981810606444$$ $$h(x)=810000x^2-45642751884x+642957163366248$$ The question is, which of these functions will yield a perfect square for at least one $x$, and which will not?
By brute force computation, I have found that $f(29136) = 387846209529$ and $\sqrt{387846209529}=622773$ (perfect square). I failed to find values of $x$ for which $g(x)$ and $h(x)$ yield positive squares, but that does not necessarily mean that there do not exist any, since I only iterated from $x=1$ to $x=10000000$. I am not sure how (or if it's even possible) to mathematically prove that these functions cannot possibly yield perfect square solutions. Brute force iteration might be able to prove that a perfect-square solution exists, but it cannot disprove the existence of a solution because you cannot iterate to infinity.
I have tried to complete the square as suggested in the linked posts, but am not sure how to evaluate the rewritten quadratic with non-integers.
$$f(x) = 810000x^2-45642249684x+642606171242553$$ $$=$$ $$810000(x-\frac{140871141}{5000})^2-(\frac{1267840269}{50})^2+642606171242553$$
How do I proceed from here to determine whether or not $f(x)$ has any $x$ yielding a perfect square, similar to the $(2n+a+m)(2n+a−m)=b$ method in one of the comments on the 2nd post? The comment author mentions that once in that form, $b$'s prime factorization will yield all perfect-square solutions. However, I am not sure how to extract such a $b$ from the complete-the-square above.
Note: I am not extremely well-versed in math, so I do not fully understand some of the topics mentioned in those other posts like Pell's equations, Cayley-Hamilton theorem, etc.
Essentially, the method is to solve the Diophantine Equation $y^2 = ax^2 + bx + c$ by transforming it to a Pell Equation and using one of the methods for solving Pell Equations.
– vvg Jul 15 '23 at 01:21