# Solving parametric in rationals

I want to find all values of a such that the equation

$$\sqrt{a - x} = a - x^2$$

has at least one real root and none of its roots are irrational. I made some decent progress (I think) but stuck at the latest stages.

Here's what I deduced myself so far:

First, we must have $$a \ge 0$$ because on the left hand side we have a square root which should be non-negative and if $$a < 0$$ then the right hand side will be strictly negative since $$x^2$$ is non-negative. Now, for the special case when $$a=0$$ we have $$\sqrt{-x} = -x^2$$ which has one real solution $$x=0$$ and it satisfies the condition. So, $$a=0$$ works.

Let's now have $$a>0$$. I solve the equation directly this way:

• Square both sides. We get $$a-x = (a-x^2)^2$$, so $$a-x = a^2-2ax^2+x^4$$ and this is quadratic in a :
• $$a^2-(2x^2+1)a+(x^4+x)=0$$ for which we have $$D=(2x^2+1)^2-4(x^4+x)=4x^2-4x+1=(2x-1)^2$$ so it's a perfect square and we get the solutions in a :
• $$a_{1,2} =\frac{2x^2+1\pm\sqrt{D}}{2} = \frac{2x^2+1\pm(2x-1)}{2}$$ (we don't have to use absolute value here because we got $$\pm$$ anyways). Now, considering both values separately we arrive at two different equations:
• $$x^2-x+(1-a)=0$$ and $$x^2-x-a=0$$ and we're off to the final stage here

The final stage is to ensure that these equations have solutions and if they do, all of those are not irrational. First, the easier case is - when only one of this equations has a solution. We have:

$$D_{1} = 1 - 4(1-a) = 4a - 3$$ $$D_{2} = 1 - 4(-a) = 4a + 1$$ ($$D_{1,2}$$ stand for the respective discriminants of these equations). We have a strict inequality $$4a-3 \lt4a+1$$ therefore if it is the case of only one equation having a real root, it must be the second one. This means we need to solve the following system of inequalities: $$4a-3\lt0$$ $$4a+1\ge0$$ which yields $$a\in(0,\frac{3}{4})$$ - (as established above, a must be non-negative and we exclude $$a=0$$ since we handled that case earlier) for these values of a, so long as 4a+1 is a square of a rational number, things will work. We can set $$4a+1=\frac{p^2}{q^2}$$ where p and q have no common divisors and get $$a=\frac{p^2-q^2}{4q^2}$$ ; Now, substituting our restriction for a we get: $$0\lt a\lt\frac{3}{4}$$, so $$0\lt 4a\lt3$$, so $$0\lt\frac{p^2-q^2}{q^2}\lt3$$ and finally $$q^2\lt p^2 \lt 4q^2$$

Finally, the most interesting is the case when both of the equations will have a solution. Starting with the value of $$a=\frac{3}{4}$$ (the second discriminant is equal to 0). We can check that in this case the first discriminant is equal to $$4\times\frac{3}{4}+1 = \frac{12}{4}+1 = \frac{16}{4} = 4$$ which is a perfect square, hence the solutions will be rational numbers. Thus $$a=\frac{3}{4}$$ works. Now, let's consider $$a\gt\frac{3}{4}$$ In this case our goal is to make sure that both discriminants are perfect squares.

It is sort of "obvious" that there can be no solutions to this when a is a natural number. This is because $$4a-3$$ and $$4a+1$$ are separated by 4, but no perfect squares of natural numbers have such gap: the smallest one is $$4-1=3$$ followed by $$9-4=5$$ and then it will only be increasing, thus the difference of 4 between perfect squares of two natural numbers is an impossibility. (We can also prove that more rigorously if we set $$D_{1}=n^2$$ and $$D_{2}=m^2$$, then subtracting one from another and factoring it) ; This leaves us with the only possibility - that a is a rational number. Then a is expressible as $$a=\frac{p}{q}$$ in lowest terms (so p and q are co-primes). Then we have $$4a-3=4\times\frac{p}{q}-3=\frac{4p-3q}{q}$$ but since p and q are co-primes, then so are 4p-3q and q and since we want a perfect square of a rational number, the denominator must be itself a perfect square. Thus for $$q=k^2$$ for some integer k. Rewriting these both using k we get $$4a-3=\frac{4p-3k^2}{k^2}$$ $$4a+1=\frac{4p+k^2}{k^2}$$ Since our denominators are perfect squares, then the numerators must be too. And we can also notice that the first numerator differs from the second one by $$4k^2$$ which itself is $$(2k)^2$$ , hence - a perfect square. In the end we have a Pythagorean triple of numbers $$4p-3k^2, (2k)^2, 4p+k^2$$ as a solution here and... that's it. I don't really know how to arrive at some closed form for a in terms of p and q . I tried with Euclid Formula, but I didn't go far with it. I know for sure that such solutions exist. For instance $$\frac{p}{q}=\frac{21}{16}$$ works, but I want to find all of the values of a in some closed form which make this work in the case when both equations have real roots.

Any ideas on how to finish it off? You can, of course, offer a completely different way of solving it, but I would also like to know how to complete my take on the problem.

• I got some results, but I can't see any closed form $$\left\{\frac{3}{4},\frac{481}{576},\frac{133}{144},\frac{931}{900},\frac{21}{16},\frac{741}{400},\frac{91}{36},\frac{273}{64},\frac{651}{100}\right\}$$ Commented Jan 11, 2021 at 20:52
• @Raffaele if there is a way to prove those are the only solutions then it's fine to have it as a list but I suspect there are infinitely many Commented Jan 11, 2021 at 21:25
• No! They are what I found limiting the search to num and den less that $1000$. I am convinced they are infinity, but I've no idea how to find a closed form, if it exists. Sure you were very clever to discover that denominator are all perfect squares. Keep studying Commented Jan 11, 2021 at 21:44
• @Raffaele well, I'm not learning anything. This is pretty much "math for fun" :) Commented Jan 11, 2021 at 23:36

I came up with a general idea for a working solution, I think. Will post the idea here, there are several cases to consider carefully.

Ok. If we continue from where I left off, we can say that the solution, whatever it might be, should satisfy:

$$4p-3k^2=n^2$$ $$4p+k^2=m^2$$

For some integers n and m . Now, it is obvious that $$m\gt n$$ because $$k^2$$ is strictly positive (we can't have 0 as a denominator). Also we can safely say $$m>n>0$$ because otherwise we have at least one discriminant as 0 and that is the case we approached before and now we are under assumption that both of the discriminants are positive. Continuing from here we get:

$$4p-3k^2=n^2$$ $$12p+3k^2=3m^2$$

therefore, $$16p = n^2+3m^2$$ and if we subtract $$4m^2$$ from both sides, we get $$16p-4m^2=n^2-m^2$$ or $$4\times(4p-m^2) = (n-m)\times(n+m)$$

As we noticed before, $$m\gt n$$ but let's also note that $$4p\lt m^2$$ (because $$4p=m^2-k^2$$). Hence we're actually dealing with both negative sides of the equation and we can flip the order:

$$4\times(m^2-4p)=(m-n)\times(m+n)$$

or, if we write is as factors of 4:

$$4=\frac{(m-n)\times(m+n)}{m^2-4p}$$

And this is where we start considering different factorization of 4 and its distribution among all these members on the right hand side. I'll give several examples.

First : $$m-n=1$$ , then we have $$m=n+1$$ and $$\frac{m+n}{m^2-4p}=4$$ this leads us to $$\frac{2n+1}{m^2-4p}=4$$, thus $$2n+1=4(m^2-4p)$$ which is clearly an impossibility because one side of this is odd while another one is even

Second : $$m+n=1$$ - immediately an impossibility because we defined $$m>n>0$$

Third : $$m-n=4$$ and $$\frac{m+n}{m^2-4p}=1$$. Here we have $$m=n+4$$, so $$2n+4=n^2+8n+16-4p$$ and $$4p=n^2+6n+16$$ . Since left hand side is divisible by 4, we need $$n=2b$$ for some integer b (in which case both sides are divisible by 4).

So far we have $$n=2b$$ , thus $$m=2b+4$$ , now returning to our k from the second original equation:

$$k^2=m^2-4p = (2b+4)^2-(n^2+6n+12)=4b+4=4(b+1)$$

As we know, if we have a perfect square as a product of "something" and another perfect square, then that "something" must itself be a perfect square. The "something" we have is b+1 , therefore for some integer c the equality $$b+1=c^2$$ must hold. This means $$b=c^2-1$$ and substituting it further we get:

$$n=2c^2-2$$ $$m=2c^2+2$$

which leads to the following solution:

$$k^2 = m^2-4p = 4c^4+8c^2+4-4c^4-4c^2-4 = 4c^2 = (2c)^2$$ $$4p-3k^2 = 4c^4+4c^2+4-12c^2 = (2c^2-2)^2$$ $$4p+k^2 = 4c^4+4c^2+4+4c^2=(2c^2+2)^2$$

for any arbitrary integer c . In the end, getting back to the p and q notation, we get:

$$D_{1} = 4a-3 = \frac{4p-3q}{q} = \frac{4p-3k^2}{k^2}=\frac{(2c^2-2)^2}{(2c)^2}$$ $$D_{2} = 4a+3 = \frac{4p+q}{q} = \frac{4p+k^2}{k^2}=\frac{(2c^2+2)^2}{(2c)^2}$$

or in other words,

$$\frac{p}{q} = \frac{c^4+c^2+1}{4c^2}$$

An example that I found randomly before (the $$\frac{p}{q}=\frac{21}{16}$$) is an outcome of this closed form when $$c=2$$ . I think many others posted in the comment above come from this too. Didn't check all of them, but some definitely are (like for $$c=3$$)

Fourth : $$m+n=4$$ . Also an easy case, since we have $$m>n>0$$ the only possibility it leaves us with is $$m=3, n=1$$ but in that case we arrive at $$3k^2=5$$ so no solutions here either

Fifth : $$m+n=2$$ . An impossibility as much as in the second case since $$m>n>0$$

Sixth : $$m-n=2$$ Similarly to the third case, this means $$\frac{m+n}{m^2-4p} = 2$$ or $$4p = n^2+3n+3 = n(n+3) + 3$$ . We can now notice that if we have two numbers $$n$$ and $$n+3$$ when one of them is guaranteed to be even meaning that our right hand side is a sum of an even and an odd numbers. This is an impossibility because the sum of an even and an odd numbers is odd while our left hand side is even. Hence we have no solutions here either.

And that's it! These are all the cases of how we can factor 4! This means that our $$a=\frac{p}{q}=\frac{c^4+c^2+1}{4c^2}$$ is indeed the only family of solutions to this problem in case $$a>\frac{3}{4}$$ . A cool thing is that the border value of $$a=\frac{3}{4}$$ is also included into this family of solutions when $$c=1$$!

The complete answer therefore is the combination of all the special values for a and the two general cases, the first is when only one equation has a solution and the second one when both have:

$$a = \begin{cases} \frac{p^2-q^2}{4q^2}, & \text{for 0

($$a=0$$ is included into the first one when $$p=q$$ and $$a=\frac{3}{4}$$ is included into second one when $$c=1$$)

EDIT

I'd still like to know if the approach with Pythagorean triples is a viable one and if so, how is it possible to get that to a working form. If you know how - please post an answer

• To be a person who is "not learning anything", you did an amazing work! Having fun with math is a great pleasure. Commented Jan 12, 2021 at 11:18
• I subbed your $p/q$ in the equation and got a nice factorization which gives up to four rational solution for any integer $c$. $$\left(c^2-2 c x-c+1\right) \left(c^2-2 c x+c-1\right) \left(c^2+2 c x-c-1\right) \left(c^2+2 c x+c+1\right)=0$$ Commented Jan 12, 2021 at 11:20
• @Raffaele no, there can't be 4 roots here. The maximum is 2. This is simply because left-hand side is a "half-parabola" turned 90 degrees counter-clockwise, while the right-hand side is just a normal upside-down parabola. But to be honest, I don't care much about how many roots the original equation has, so long as it has at least one and they all are rational :) Commented Jan 12, 2021 at 11:35
• @Raffaele yes, but not all of these are actual roots. The $c=2$ corresponds to the $a=\frac{21}{16}$ and the equation $\sqrt{\frac{21}{16}-x}=\frac{21}{16}-x^2$ And clearly, right hand side must be non-negative, so $|x|\le\frac{\sqrt{21}}{4}$ . Now $\sqrt{21}$ is about 4.5 meaning your $x_{1}$ and $x_4$ disqualify Commented Jan 12, 2021 at 11:46

You're on the right track with the discriminant but use quadratic equation.

$$\sqrt{a - x} = a - x^2\\ \implies a-x =a^2 - 2 a x^2 + x^4\\ \implies a^2 - 2ax^2 - a + x^4+x=0\\ \implies a^2 -(2x^2+1)a+(x^4+x)=0\\ \implies a=\frac{(2x^2+1)\pm\sqrt{(2x^2+1)^2-4(1)(x^4+x)}}{2(1)}\\ =\frac{(2x^2+1)\pm\sqrt{4 x^2 - 4 x + 1}}{2}\\ =\frac{(2x^2+1)\pm (2x-1)}{2}$$ $$\implies a_1=\frac{2 x^2 + 2 x}{2}=x(x+1)\qquad\quad x\in\mathbb{Q} \quad (+)\tag{1}$$ $$\implies a_2=\frac{2 x^2 - 2 x + 2}{2}=x^2-x+1\quad x\in\mathbb{Q} \quad (-)\tag{2}$$

\begin{align*} \text{For example}\quad x &\in\{ 2/2,\space 2/3,\space 2/4,\space 2/5,\space 2/6,\space 2/7,\space 2/8,\space 2/9,\space 2/10,\space \}\\ \implies a_1 &\in\{ 2,\space 1\space1/9,\space 3/4,\space 14/25,\space 4/9,\space 18/49,\space 5/16,\space 22/81,\space 6/25\} \\ \implies a_2 &\in\{ 1,\space 7/9,\space 3/4,\space 19/25,\space 7/9,\space 39/49,\space 13/16,\space 67/81,\space 21/25\} \end{align*}

We can solve for $$x$$ to find valid $$a$$-values in terms of $$a=p/q$$ $$\sqrt{a-x} = a-x^2\implies x = \frac{\pm1\pm\sqrt{4 a + 1}}{2}$$ To be rational $$\quad 4a+1\quad$$ must be a perfect square.

$$\text{Let}\qquad\qquad 4a+1=\frac{4p}{q}+1=\frac{4p+q}{q} =\sqrt{ \frac{4\frac{j}{k}+\frac{l}{m}}{\frac{l}{m}}} =\sqrt{\frac{4 j m + k l}{k l}}\\ \implies 4 j m + k l=r^2\quad\land\quad k l=s^2\quad r,s\in\mathbb{N}$$

Some examples of $$j,k,l,m$$ are

$$(1,1,1,6)\quad (1,1,1,12)\quad (1,1,1,20)\quad (1,1,1,30)\quad (1,1,1,42),\space m\uparrow 2n+4$$ $$(1,1,4,3)\quad (1,1,4,8)\quad (1,1,4,15)\quad (1,1,4,24)\quad (1,1,4,35),\space m\uparrow 2n+3$$ $$(1,1,9,4)\quad (1,1,9,10)\quad (1,1,9,18)\quad (1,1,9,28)\quad (1,1,9,40),\space m\uparrow 2n+2$$ $$(1,4,1,3)\quad (1,4,1,8)\quad (1,4,1,15)\quad (1,4,1,24)\quad (1,4,1,35)\quad$$ $$(1,4,4,5)\quad (1,4,4,12)\quad (1,4,4,21)\quad (1,4,4,32)\quad (1,4,4,45)\quad$$ $$(1,4,9,7)\quad (1,4,9,16)\quad (1,4,9,27)\quad (1,4,9,40)\quad (1,4,9,55)\quad$$ $$(1,9,9,10)\quad (1,9,9,22)\quad (1,9,9,36)\quad (1,9,9,52)\quad (1,9,9,70)\quad$$

$$(2,1,1,3)\quad (2,1,1,6)\quad (2,1,1,10)\quad (2,1,1,15)\quad (2,1,1,21)\quad$$

$$(2,1,4,4)\quad (2,1,4,12)\quad (2,1,4,24)\quad (2,1,4,40)\quad (2,1,4,60)\quad$$

$$(2,4,4,6)\quad (2,4,4,16)\quad (2,4,4,30)\quad (2,4,4,48)\quad (2,4,4,70)\quad$$

$$(3,4,4,4)\quad (3,4,4,7)\quad (3,4,4,15)\quad (3,4,4,20)\quad (3,4,4,32)\quad$$

In the first four example I noted what I think is the increment between $$m$$-values as $$m\uparrow\cdots$$ but this interval changes with the values of $$j,k,l$$. Still, you may be able to find patterns in this data to help you understand what makes an $$a$$-value valid.

Let's take the case for $$\quad(4,4,4,3)\quad$$ where $$x=\frac{\pm1\pm\sqrt{4 a + 1}}{2} =\frac{\pm1\pm\sqrt{\sqrt{\frac{4 j m + k l}{k l}} }}{2} =\frac{\pm1\pm\sqrt{\sqrt{\frac{4(4)( 3) + 4 (4)}{4(4)}}}}{2} \tag{3}$$ We now substitute the innermost part $$\quad\sqrt{4a+1}= \sqrt{\frac{4(4)( 3) + 4 (4)}{4(4)}}=2$$

We can now see that $$x=\frac{\pm1\pm\sqrt{4 a + 1}}{2} =\frac{\pm 1 \pm2}{2}$$ is rational.

On the surface, it appears to me that

$$j\in\mathbb{N}\quad k,l\in\mathbb{N^2}\quad m=f(n)\\ \quad\text{where}\quad f(n)$$ is a function of a that will generate the first and subsequent numbers as a series including an interval such as those intervals I suggested the $$\uparrow$$. The function would include a starting point as a function of $$j,k,l$$ but I leave it up to you to figure out what that function may be.

We can see that finding $$a$$ as a function of $$x$$ is easy. It seems that we might be able to extrapolate a pattern from the data provided by my dual solutions for $$a$$ above. I used a spreadsheet to find these modest amounts of data. A computer program using these solutions could generate unlimited samples for your analysis in finding valid $$a$$-values.

• This bit I got on my own, but I'm not interested in just any real roots. I want them all to be rational, so I'm not sure how does this answer that. Do I miss something here? Commented Jan 12, 2021 at 10:21
• @Alma Do If you look at the "solutions", any rational input will result in a rational output. I've changed my answer to reflect that. Commented Jan 12, 2021 at 12:10
• @poestasis I still don't follow it, I'm afraid. I want to find values of a (the parameter), such that all the roots of the original equation are not irrational. You arrived to two equations, but you'll actually need to solve them in x and then make sure these values are not irrational for the chosen value of a. To give you an example - if you chose a to be a natural number, then no matter how you chose a in this case, there always will be at least one irrational root x for the original equation. Commented Jan 12, 2021 at 12:14
• @Alma Please take a look near the end of my modified answer. I have not found the complete formula for finding a-values but I have made progress and, perhaps the data will help you finish. Commented Jan 12, 2021 at 17:45
• You only take a look on one equation. In the general case when both of those equations will have roots (happens when $a>\frac{3}{4}$) your solution will not work because I want all roots to be rational while what you have only takes roots of one equation into account. In fact, there is a special sub-case when only one of the equations has real roots, this is also mentioned in my question (for $a\in (0,\frac{3}{4})$) and I arrive at the solution $a=\frac{p^2-q^2}{4q^2}$ in that case (not really sure why you use rational numbers for p and q in that case) Commented Jan 12, 2021 at 18:37