# Find all rational values of $x$, at which $\sqrt{x^2 + x + 3}$ is rational

How to find all rational values of $x$, at which $y = \sqrt{x^2 + x + 3}$ is rational?

-
It's false for most quadratic expressions, but true for those of the form $(ax+b)^2$ with $a$ and $b$ rational, like $x^2+2x+1$. – Jonas Meyer Oct 4 '13 at 4:58
@JonasMeyer! Please look at my re-edit question. Thank you for your observation and reply. – mehar1212 Oct 4 '13 at 5:08
mehar1212: You're welcome. I don't know what the edited question is supposed to mean. It still states "Square root of $x^2 + x + 3$ is rational for all rational x." This is still false. – Jonas Meyer Oct 4 '13 at 5:09
@JonasMeyer! Find all rational value of x at which y = square root of $X^2 + x + 3$ is a rational number. – mehar1212 Oct 4 '13 at 5:11
Interesting. In what context did you encounter this problem? – Jonas Meyer Oct 4 '13 at 5:15

This is quite easily shown to be false: The square root of $0^2 + 0 + 3 = 3$ is not rational.

For a non-zero example, just note that $\sqrt{5}$ is irrational and set $x = 1$.

-
! Sir, you are correct. But, is there any cases to prove my expression is rational for a rational x? But, you have given wonderful example. Thanks a lot. – mehar1212 Oct 4 '13 at 5:02
! I re-edited my question. Please look at my new edit. – mehar1212 Oct 4 '13 at 5:07

If you want $\frac{a^2}{b^2}+\frac{a}{b}+3=\frac{c^2}{d^2}$ with $a,b$ coprime integers and $c,d$ integers, then you want $$a^2+ab+3b^2=z^2$$ where $z$ is rational. Dividing through by $z^2$, and letting $u$ and $v$ be the rational numbers $\frac{a}{z}$ and $\frac{b}{z}$ respectively, you have the equation $$u^2+uv+3v^2=1$$ On the $uv$-plane, this defines a conic section containing $(1,0)$. Now take any rational slope $r$ and construct the line $v=r(u-1)$ passing through $(1,0)$. A line and a conic section intersect in two places, and we already know one of them here is $(1,0)$. The other one will automatically be rational. We can find it:

\begin{align} u^2+ur(u-1)+3(r(u-1))^2&=1\\ u^2-1+ur(u-1)+3(r(u-1))^2&=0\\ (u+1)(u-1)+ur(u-1)+3(r(u-1))^2&=0\\ (u+1+ur+3r^2(u-1))(u-1)&=0\\ \end{align}

So there is another intersection when $u+1+ur+3r^2(u-1)=0$, in other words when $u=\frac{3r^2-1}{3r^2+r+1}$. And therefore when $v=r\left(\frac{3r^2-1}{3r^2+r+1}-1\right)=\frac{-r^2-2r}{3r^2+r+1}$.

So now for any rational number $r$, this gives us a $u$ and a $v$. Take the equation $u^2+uv+3v^2=1$, substitute these in, and then we can obtain: $$\left(3r^2-1\right)^2+\left(3r^2-1\right)\left(-r^2-2r\right)+3\left(-r^2-2r\right)^2=\left(3r^2+r+1\right)^2$$ which then can give

$$\left(\frac{3r^2-1}{-r^2-2r}\right)^2+\left(\frac{3r^2-1}{-r^2-2r}\right)+3=\left(\frac{3r^2+r+1}{-r^2-2r}\right)^2$$

So in summary, pick any rational $r$ you like, and $x=\frac{3r^2-1}{-r^2-2r}$ will satisfy your question.

It's not too hard to show that this does not merely give an infinite collection of solutions, but characterizes all solutions. Any rational solution would have provided a rational point on that conic section, and so the slope between that point and $(1,0)$ would be rational. So using that slope for $r$ would recover the solution.

-
+1 nice and clean answer. – achille hui Aug 3 '14 at 10:33
The solution is determined by the 2 parameters? – individ Aug 3 '14 at 11:26
@individ Just one rational parameter $r$, but that can be thought of as two (coprime) integer parameters. – alex.jordan Aug 3 '14 at 17:46

There exist unfinitely many solutions. Putting $\frac{x}{y}$ instead of $x$ rewrite the question as

Find all integer solutions of $x^2+xy+3y^2=z^2$. The equation is equvalent the following $(2z-2x-y)(2z+2x+y)=11y^2$. Now for any $y$ choose some factorisation $uv=11y^2$ and have the system $\left\{\begin{matrix}2z-2x-y=u\\ 2z+2x+y=v\\ uv=11y^2 \end{matrix}\right.$

For which $y$ this system is solvable? Show the answer is Yes for any odd $y$. In this case $11y^2\equiv -1\pmod{4}$ and so for any factorisation we have $u+v\equiv 0\pmod {4}$ and we hawe $z=\dfrac{u+v}{4},\ \ x=\dfrac{v-y}{2}-z$.

For instance for any odd $y$ not dividing by $11$ we can choose $u=11, \ \ v=y^2$ and have $x=\dfrac{y^2-y}{2}-\dfrac{11+y^2}{4}$ providing an irreducible of the fraction $\dfrac xy$.

The even case is more complicated.

PS. \not\equiv doesn't work here

-
! This is very hard. If you can explain more clearly. Where you got 11y^2 etc – mehar1212 Oct 5 '13 at 5:12
x^2+xy+3y^2=z^2\Leftrightarrow 4x^2+4xy+12y^2=4z^2\Leftrightarrow (2x+y)^2+11y^2=4z^2 \Leftrightarrow (2z)^2-(2x+y)^2=11y^2 $– bot Oct 6 '13 at 15:15 Understand so. It is necessary to solve the equation: $$x^2+xy+3y^2=z^2$$ You can easily write the formula of the solution. $$x=3s^2-p^2$$ $$y=(2p-s)s$$ $$z=p^2-ps+3s^2$$ To write all the decisions. You should check out the rest of the formula. Their output is to use the formula for the solutions of this equation in the General form. The formula you can see there: Solutions to$ax^2 + by^2 = cz^2$- You usage of variables$x,y$are in conflict with what in the question. Please define what$x,y,z$are when you assign new meanings to them. – achille hui Aug 3 '14 at 9:17 @achille hui What was not? Decisions depend on 2 parameters. And not one. – individ Aug 3 '14 at 11:16 In the question, it is$y = \sqrt{x^2+x+3}$and$x,y$are rational numbers. in your answer, it becomes$x^2 + xy + 3y^2 = z^2$. In addition to$x,y,z$are now integers, you have introduced a new$y$and rename your old$y$to$z\$. This is confusing. If you need to reuse variable names to match your other answer, you should explicitly say that in the beginning. – achille hui Aug 3 '14 at 11:31
@achille hui What? It is hard to share? There the solution is determined by 2, not 1 parameter. – individ Aug 3 '14 at 11:36