9

This is something that came up as part of another problem that I was trying to solve.

My theory is that if a quadratic equation with integer coefficients has coefficients that are equal for the $x^2$ term and the $x$ term and has rational roots this will imply that the leading and second coefficient are square numbers, i.e.

If $a>0$ and $b$ are coprime integers and $ax^2+ax+b=0$ has rational roots, then $a$ is a perfect square.

I've tried looking at the discriminant and also subbing in $\frac{p}{q}$ and thought about taking mods but so far am a bit stuck.

Edit: as noted in comments, we must assume $a>0$, and $a$ and $b$ are coprime (otherwise we could multiply the quadratic by any non-square number to create counter examples).

Bill Dubuque
  • 282,220
2d1nn3rz
  • 187
  • An easy counterexample comes with such quadratics with $b = \frac a 4$. For instance, $$ 12x^2 + 12x + 3 = 0 $$ has a double rational root, $x = -\frac 1 2$ – PrincessEev May 13 '25 at 08:03
  • That quadratic will simplify to $4x^2+4x+1=0$ and 4 is a square number so my theory will hold. But you're right. I should have specified that $a$ and $b$ should be coprime. I will edit my post. – 2d1nn3rz May 13 '25 at 08:12
  • 6
    A counterexample: $-4x^2-4x-1=0$ – jjagmath May 13 '25 at 10:47

6 Answers6

8

Edit: I had missed that when $a$ is even, a slight change is needed. Thanks to commenters for pointing this out.

For $x$ to be rational, the discriminant $a^2-4ab$ must be a square number; say it's $c^2$. Adding $(2b)^2$ to both sides, $$(a-2b)^2=(2b)^2+c^2$$

which is a Pythagorean triple. Per the question $a$ and $b$ are coprime, and if $a$ is odd, the triple is primitive. So we know (Euclid) that

$$a-2b=m^2+n^2;\quad 2b=2mn;\quad c=m^2-n^2$$

From the first two of these, $a=m^2+n^2+2mn=(m+n)^2$ so $a$ is indeed a square number, as conjectured.


If $a$ is even, then $b$ must be odd ($a$ and $b$ are coprime). Say $a=2a'$, where $a'$ and $b$ are coprime. Now

$$(2a'-2b)^2=(2b)^2+c^2$$

so $c$ must be even; $c=2c'$ and

$$(a'-b)^2=b^2+c'^2$$

Recall $a'$ and $b$ are coprime; so this triple is primitive. In this case, since $b$ is odd, we must have

$$a'-b=m^2+n^2;\quad b=m^2-n^2;\quad c'=2mn$$

so $a'=2m^2$ and $a=4m^2=(2m)^2$, so again the conjecture holds.

Chris Lewis
  • 3,641
  • 1
  • 6
  • 11
  • The method is a good candidate for a proof, but it misses why you can only map a, b, & c to m & n as you did and no other way is possible. It is especially important, as you made a mistake by letting $a^2{\color{red} -}4ab+(2b)^2$ to be $(a{\color{red} +}2b)^2$. – Dávid Laczkó May 13 '25 at 08:51
  • 2
    Thanks for pointing out the typo (corrected now) - it doesn't fundamentally affect the proof, though. ${2b,c}$ can only map that way to ${2mn,m^2-n^2}$ since $2b$ is certainly even. – Chris Lewis May 13 '25 at 08:54
  • 1
    From $(a-2b)^2=(2b)^2+c^2$ being a primitive Pythagorean triple you may conclude $|a-2 b| =m^2+n^2$, but how do you know $a-2b>0$? – jjagmath May 13 '25 at 10:46
  • 3
    The triple is not necessarily primitive, as $a$ and $2b$ may both be even. (Witness the case $a=4$, $b=1$ mentioned in the comments.) – Emil Jeřábek May 13 '25 at 11:43
  • Thanks @BillDubuque and Emil Jeřábek for pointing out the issue with $a$ even - I've updated the solution for this case. I have to say this makes Bill's answer by far the neater but will leave this solution up to show an alternative method. – Chris Lewis May 18 '25 at 10:45
  • 1
    Glad to see you have fixed it. This way avoids parity case analysis and is probably the simplest. I posted a couple other approaches too since they give nice illustrations of methods that are widely applicable and useful to know. $\ \ $ – Bill Dubuque May 18 '25 at 11:07
5

${{\dfrac{\!\!\!-b}{\color{#c00}a}} =\overbrace{ x^2\!+\!x}^{x\ =\ \large \frac{p}q\!\!} = \dfrac{p^2\!+pq}{\color{#c00}{q^2}}}\:\!$ thus $\, \color{#c00}{a = q^2}\,$ by $\overbrace{\style{font-family:inherit;}{\text{both fractions reduced}}}^{\large \begin{align}\rm wlog \ \ &(q,\:\!p)\,=\,1,\ \rm so\\ (q,\,p^2+pq)\,=\,&(q,\:\!p^2)=1\\ \end{align}}\!,\, a>0.\ $ $\bf\small QED$

Bill Dubuque
  • 282,220
  • Generally above shows $,{\rm d}:!(x(x!+!n)) = {\rm d}:!(x)^2,,$ $,{\rm d}$ := least denom $\in \Bbb N,,$ for $x\in\Bbb Q,, n\in\Bbb Z.,$ Similarly $,{\rm d}:!(f(x)) = {\rm d}:!(x)^k$ for monic $:!f\in\Bbb Z[x],\ k = \deg f,,$ so $,f(x) = -b/a\Rightarrow a = {\rm d}:!(x)^k,$ if $,(a,b)!=!1,\ a>0.\ \ $ – Bill Dubuque May 13 '25 at 21:11
3

If $\,\color{#0a0}{2\nmid a}\,$ the square discriminant has $\color{#0a0}{\rm coprime}$ factors $\:\!a,\, a\!-\!\color{#0a0}4\:\!b\:\!$ thus both factors must be squares. Else $\,\color{#c00}{2\,|\,a,\ {\rm so}\,\ 4\,|\,a}\,$ by parity (cf. below) so same idea as above applies after cancelling $\:\!4^2$.

Bill Dubuque
  • 282,220
  • $\ \color{#c00}{2,|,a}\Rightarrow 2,|,0!=q^2f(p/q)=!ap^2!+!apq!+!bq^2,,$ so $,2,|,bq^2!!!\underset{(a,b)=1}\Rightarrow! 2,|,q,,$ so $,,4,|,ap^2!!!\underset{(p,q)=1}\Rightarrow!!\color{#c00}{4,|,a}.\ $ Note if $,a=4b,$ then $,b,|, a,$ so $,(a,b)!=!1\Rightarrow b=\pm 1,$ so $,a !=! 4b!=!2^2$ by $,a>0.\ \ $ – Bill Dubuque May 15 '25 at 07:26
2

Another way. Suppose $a=t^2r$ where $r\gt1$ is square-free.The discriminant is $$a^2-4ab=a(a-4b)=\square$$ then $a-4b=s^2r$ so we have $$4b=r(t^2-s^2)$$ Since $b$ cannot divide any prime factor of $r$ because $(a,b)=1$ and $r$ is not square we get $r=2$. Then $$2b=(t+s)(t-s)$$ If $t$ and $s$ have same parity then $2b$ is multiple of $4$ and $b$ is even so $(a,b)\gt1$, contradiction. And if $t$ and $s$ have distinct parity then $2b$ is odd, contradiction. Consequently $r=1$ and $a$ is square.

Ataulfo
  • 32,657
0

Since equation $ax^2+ax+b=0$ has rational roots, then we can factor it as follow: $$a\left(x+\frac{r}{s}\right)\left(x+\frac{u}{v}\right)=0, \quad r,s,u,v\in\mathbb{Z},(r,s)=1$$ Without loss of generality, let $v=s$, and observing that (expand LHS and compare with the primal): $$\frac{u}{v}=\frac{s-r}{s}$$ $$ax^2+ax+a\cdot\frac{r(s-r)}{s^2}=0$$ Due to $$a\cdot\frac{r(s-r)}{s^2}=b,\quad a,b\in\mathbb{Z}, (a,b)=1$$ then $$(r(s-r), s^2)=1$$ which means $\frac{r(s-r)}{s^2}=\frac{b}a$ is an irreducible fraction.

Thus, $a=s^2>0$ is a square.

Bill Dubuque
  • 282,220
  • Duplicate of this 2-day prior answer, i.e. the above argument is just a more roundabout way to derive that $\ {{\dfrac{!!!-b}{\color{#c00}a}} =\overbrace{ x^2!+!x}^{x\ =\ \large \frac{!-r}s!!} = \dfrac{r^2!-rs}{\color{#c00}{s^2}}}:!$ thus $, \color{#c00}{a = s^2},\ $ since both fractions are reduced. Please strive not to duplicate prior answers. $\ \ $ – Bill Dubuque Jun 05 '25 at 22:28
  • Thanks for your help, I will keep this in mind when I write my answer next time. – Grant Russell Jun 10 '25 at 00:25
0

$\overbrace{a\!\neq\! n^2\Rightarrow a \!=\! j\:\! p^{\:\!\color{#0af}{2\:\!i+1}},\, \color{#0a0}{p\nmid j}}^{a\ \text{non $\square\:\!$ so has a prime $\:\!p\:\!$ to $\rm\color{#0af}{odd}$ power}}\!\!\!.\,$ Let $X\! =\! p^i x\,$ so $\!\overbrace{a \,x^2\,+\,a\,x + b \!=\! f(x)}^{\textstyle \color{#c00}pj X^2\! +\! \color{#c00}pj\:\!p^i\! X^{\vphantom{|^|}}\!\! +\! b \!=\! g(X)}\!.\,$ If $\,x_1\!\in\! \Bbb Q\,$ is a root of $\:\!f\:\!$ then $\,X_1\!\in\!\Bbb Q\,$ is a root of $\:\!g,\,\:\!$ contra $\,g^{\vphantom{|^|}}\,$ is $\,\underbrace{{\color{#0a0}{\rm reverse}\ \color{#c00}{\rm Eisenstein}}}_{\large \color{#0a0}{p\ \nmid\ j}\:\!;\,\ p\ \nmid\ b\ {\rm by}\ (a,b)=1}\:\!$ so irreducible.

Bill Dubuque
  • 282,220
  • @Serial Downvoter: In the unlikely chance that the downvote has anything to do with mathematics you are welcome to ask for elaboration. Same for the other answers that you downvoted in quick succession. This (reverse) Eisenstein method deserves to be better known for problems like this, hence this answer. $\ \ $ – Bill Dubuque May 21 '25 at 17:15