3

Let $a,b,c$ be integers with $a$ positive. Is there a criterion for $ax^2+bx+c$ with $x$ integer being a square number? That is, is there a criterion for the equation $ax^2+bx+c=y^2$ has an integer solution $(x,y)$?

For example if $(a,b,c)=(1,0,0)$ then there will be infinitely many solutions, but if $(a,b,c)=(2,0,0)$ then there will be no solution.

Also I wonder that if there is a solution, then there are infinitely many.

P.S. There is a similar question number of solutions of a quadric diophantine equation here, but I'm not sure that it is equivalent to my question. We can complete the square $ax^2+bx+c=a(x+\frac{b}{2a})^2+(c-\frac{b^2}{4a})$ and substitute $x'=x+\frac{b}{2a}$, but $\frac{b}{2a}$ and $\frac{b^2}{4a}$ may not be integers.

user302934
  • 1,738
  • 1
  • 9
  • 27
  • 6
    take $\delta = b^2 - 4ac$ If there are solutions to $u^2 - 4a v^2 = \delta, $ then see if there are solutions $(2ax+b)^2 - 4a y^2 = \delta$ There are various special cases, it all changes if $a$ is square in the first place. – Will Jagy Dec 22 '23 at 01:33
  • @WillJagy Is there a criterion on $a$ and $\delta$ for the equation $u^2-4av^2=\delta$ has solutions? – user302934 Dec 26 '23 at 00:24
  • @user302934 If there is an initial solution and if $a$ is not a square, then there are infinitely many. Details in answer below. – Tito Piezas III Jan 11 '25 at 12:23
  • For second question, see this answer, link: https://math.stackexchange.com/a/4989074/1296310 – Guruprasad Jan 11 '25 at 12:29
  • @Guruprasad The second question just needs a short identity to quickly answer it. (Deriving that identity, on the other hand, took more time.) – Tito Piezas III Jan 11 '25 at 12:56
  • @TitoPiezasIII , you are right .I shared a link because to answer : how to reduce any Quadratic Diophantine equation to $x^2-ay^2=n$. – Guruprasad Jan 12 '25 at 09:09

2 Answers2

1

The OP has two related questions:

  1. What are the criteria for $ax^2+bx+c=y^2$ to have an integer solution $(x,y)$?
  2. If there is one solution, then are there in fact infinitely many?

The first one is a bit tricky, but the second is more manageable.

"If there is an initial solution, and $a>0$ which is not a square, then there are infinitely many solutions by solving a Pell equation."


I. Proof:

$$ax^2+bx+c = \left(\frac{(b+2an)pq + (p^2+aq^2)\sqrt{a n^2+b n+c\,}}{p^2-aq^2}\right)^2$$

$$x = \frac{np^2 + (b+an)q^2+2pq\sqrt{a n^2+b n+c\,}}{p^2-aq^2}$$

The identity is valid for any $(p,q)$. But to get rid of the denominator and have integer $x$, one simply chooses $(p,q)$ that solves the Pell equation $p^2-aq^2=\pm1$ which has infinitely many solutions.

Note: And it is assumed there is an initial solution "$n$" to $a n^2+bn+c = y^2$ to get rid of the square root.


II. Example

We consider $F(x)=2x^2+x+3 = y^2$. This also has the special property that, in bivariate form, has multiplicative closure,

$$(2p^2+pq+3q^2)(2r^2+rs+3s^2)=2x^2+xy+3y^2$$

discussed in this post just like Brahmagupta's identity,

$$(p^2+q^2)(r^2+s^2)=x^2+y^2$$

A small solution is $F(-1)=2^2$. Hence,

$$F(x)=2x^2+x+3 = \left(\frac{-3pq\pm2(p^2+2q^2)}{p^2-2q^2}\right)^2$$

$$x = \frac{-p^2-q^2\pm4pq}{p^2-2q^2}$$

valid for any $(p,q)$. However, if we choose $p^2-2q^2=\pm1$, then $x$ is an integer.

  • Of course, for all non-square $a>0$, then $p^2-aq^2=1$ is solvable. But only certain $a$ qualifies for the negative Pell $p^2-aq^2=-1$. – Tito Piezas III Jan 11 '25 at 12:29
  • When you say any (p,q) how do you know the rhs is an integer squared? – Krishiv P Jan 11 '25 at 12:30
  • @KrishivP The method is actually known way back to Fermat. For $x$ as defined above, then the RHS is a square for any $(p,q)$. (If you have Mathematica, this is easily verified.) But if $(p,q)$, is chosen to solve $p^2-aq^2=1$, then the RHS is an integer squared. – Tito Piezas III Jan 11 '25 at 12:35
  • For the example discussed above… if you take $(p,q)$ as $(0, 1/\sqrt{2})$ won’t you get x as $1/2$? – Krishiv P Jan 12 '25 at 02:01
  • @KrishivP If you read the post carefully, I clearly stated one should solve the Pell equation $p^2-aq^2=1$. Are you familiar with Pell equations? – Tito Piezas III Jan 12 '25 at 02:07
  • In the above post you’ve written $p^2 - 2q^2 = \pm1$ – Krishiv P Jan 12 '25 at 02:12
  • @KrishivP Read the WHOLE post. I've already mentioned Pell equations TWO times. Shall I mention it in every sentence? – Tito Piezas III Jan 12 '25 at 02:16
  • Im sorry i forgot to notice the one comment in the beginning… but say i take $(p,q)$ as $(9,\sqrt{40})$ im failing to see an integer x – Krishiv P Jan 12 '25 at 02:22
  • @KrishivP Sigh. Please read up on "Pell equations". And this is the end of my responses to you, as I have other things to do. – Tito Piezas III Jan 12 '25 at 02:25
0

We may write:

$A=ax^2+bx+c=(x+\frac{b-\sqrt{\Delta}}{ 2a})(x-\frac{-b-\sqrt{\Delta}}{ 2a})=(x+\frac {b}{2a}-\frac{\sqrt {\Delta}}{2a})(x+\frac {b}{2a}+\frac{\sqrt {\Delta}}{2a})$

$A$ can be a perfect square if $\Delta=0$, so we must have:

$\Delta= b^2-4ac=0$

For example:

$a=1, c=4\rightarrow b^2= 4^2\rightarrow b=\pm 4$

and we get :

$x^2\pm4x+4=(x\pm2)^2$

But a cannot be equal to c unless it is a perfect square:

$a=c=2\rightarrow b^2=4^2\rightarrow b=\pm4$

and we get:

$2x^2\pm4x+2=2(x\pm1)^2$

Which is not a perfect square,but for $a=c=4$ we get:

$b^2=4\times 4^2=8^2\rightarrow b=\pm 8$

and we have:

$4x^2\pm8x+4=4(x+1)^2=[2(x+1)]^2$

Generally for $a=1$ and $c=4^{2n-1}$ we have:

$b^2=\pm 4^{2n}\rightarrow b=\pm 4^n$

and the equation becomes:

$x^2\pm 4^n x+4^{2n-1}=(x+2^{2n-1})^2$

Examples:

$n=2\rightarrow 2n-1 =3\rightarrow c=4^3, b^2=4\times 4^3=4^4\rightarrow b=\pm 4^2$

and equation becomes:

$x^2\pm 4^2 x+4^3=(x\pm 2 ^3)^2$

similarly we can get:

$n=3\rightarrow x^2\pm 4^3x+ 4^5=(x\pm 2^5)^2$

$n=4\rightarrow x^2\pm 4^4x+ 4^7=(x\pm 2^7)^2$

etc...

In relation $\Delta=b^2-4ac$ , $a$ and $c$ are cyclic , so may also have:

$4^{2n-1}x^2\pm4^n x+1=(2^{2n-1}x\pm 1)^2$

Or $a=c=4^{2n-1}$ which gives:

$4^{2n-1} x^2\pm 4^n x+4^{2n-1}=(2^{2n-1}x\pm 2^{2n-1})^2$

sirous
  • 12,694