# Can number theory help me create equations with nice solutions?

I'm teaching a remedial algebra class, and I recently put a radical equation on a quiz. At this point, the students had only solved polynomial equations by factoring, so the equation had to turn out nice (plus, there would be issues checking whether a potential solution like $1 + \sqrt{2}$ is extraneous).

My Problem: Find $(a, b, c)$ so that $a\sqrt{x + b} = x + c$ has solutions that can be found by squaring and factoring a quadratic.

I asked a computer (Sage) to try various to run through combinations of $a, b, c$, weeding out those that didn't have at least one integer solution. It worked perfectly well, although it required some legwork to get the "program" running. I initially tried some algebraic things with discriminants (making the brute force more efficient, but it ended up taking less than a second either way), but I don't know much about Diophantine equations or perfect squares and had to resort to brute force all the same, just slightly differently.

Question: Is there any way number theory could help me out here? Has anyone personally benefited from a bit of number theory, creating problems like this?

I realize now that just picking two points on a graph like $x = a(y - k)^2 + h$ and connecting them with a line is probably a much more efficient approach to generate equations, but might require more manual labor to avoid equations that are more complicated to solve than I'd like. Even if that is the case...

...this is mostly a question of curiosity; I don't see a pressing need to churn out equations like this, and brute force works just fine. But I've always wondered whether knowing more (or any, at this point) number theory would be at all useful, creating problems for an algebra course like this.

Sidenote: I went through a similar process the last time I taught the class. Then, I wanted a quadratic equation whose solutions, using the quadratic formula, would need simplifying by reducing the radical and then cancelling a common factor of the numerator and denominator. I ended up stumbling around quadratic fields. Although I got my examples, nothing really came of it.

• I haven't wrestled with this specific issue, but exercises with radicals are definitely the hardest to construct in the remedial algebra courses. I can imagine the utility of a site that lists or generates all possible such problems. See also my blog: (1) madmath.com/2016/03/…, (2) madmath.com/2014/01/excellent-exercises-completing-square.html Jul 11 '17 at 6:12
• I don't really understand your problem. Given your equation, we could square both sides and then this is equivalent to finding $a,b,c$ such that $ax^2 + bx + c = 0$ has nice solutions, isn't it? And for such quadratic equations, you can just compute the solutions in terms of $a,b,c$ and then choose these variables such that the solutions are nice. Am I missing some important point here?
– Dirk
Jul 11 '17 at 9:01
• @DirkLiebhold In some sense you're right, but the coefficients depend on $a, b$, and $c$: $x^2 + (2c - a^2)x + (c^2 - a^2 b) = 0$. I personally found it difficult to ensure the solutions would be integers, unlike how easy it would be for $Ax^2 + Bx + C = 0$ for unconstrained $A, B, C$. Jul 11 '17 at 20:23
• Nice question. In general (as remarked before), this sort of thing could get hard. An easy construction is the following: for which $c$ does the equation $x^2+c^3 x - 1=0$ have "easy" (i.e. rational) solutions? Here the discriminant is $c^6+4$, so we are naturally led to the consideration of rational points on the algebraic curve $y^2=x^6+4$ (sorry for the overloading of the $x$-symbol). Once the number of parameters increases, so does the dimension, so in general one is looking at the problem of determining rational points on algebraic varieties of arbitrary dimension, which is hard.
– RP_
Jul 19 '17 at 15:15
• @René Thank you, that's a nice viewpoint to bring to the table! Having thought about the question more, I now think this is probably a situation that motivates one (me, at least) to study number theory, rather than benefits from number theoretic approaches. Certainly this isn't entirely true, but rather, it seems that the effort-to-results ratio goes way down, the more sophisticated the number theory gets. Jul 19 '17 at 18:59

I think that the number theory in this case is pretty light. Let's suppose that we want some integer solution for $x$ and that $a,b,c$ are also integers. Then $x+b$ must be a perfect square, so let $N^2=x+b$. The radical equation can then be rewritten as $$N^2-aN-b+c=0.$$ Note: I'm assuming $N\geq 0$ because it doesn't matter. The quadratic equation then gives $$N=\frac{a\pm\sqrt{a^2+4(b-c)}}{2}.$$ As $N$ is an integer, we need the part under the radical to again be a perfect square. So let $$M^2=a^2+4(b-c).$$ Again, we may as well suppose $M\geq 0$. Then $N=\frac{a\pm M}{2}$. Clearly $a$ and $M$ must have the same parity as the difference of their squares is divisible by 4, so we don't have to worry about the fraction being a half integer.

So, choose any integers $a$ and $b$. Then choose a (non-negative) integer $M$ with the same parity as $a$ and for which at least one of $a\pm M =2N\geq 0$. Then $c=\frac{a^2-M^2}{4}+b$. (Which is an integer since $a$ and $M$ have the same parity.)

• silly question, what is "parity" here ? Jul 11 '17 at 14:41
• Parity is even vs odd. Equivalently, reduction modulo 2.
Jul 11 '17 at 15:07
• Thank you, this is the sort of thing I was hoping for (I didn't think it'd be anything too serious; at least, I'd hoped not!). I was focused on the equation $x^2 + (2c - a^2)x + (c^2 - a^2b) = 0$ and its discriminant, which was not at all enlightening. It never occurred to me to let $N = \sqrt{\text{whatever}}$ (which of course has to be an integer!) etc. The whole thing is very nice, cheers! Jul 11 '17 at 17:50

Begin with factored quadratic $(u-r_1)(u-r_2)=0$ so $u^2-(r_1+r_2)u+r_1r_2=0$. Choose one root positive, say $r_1>0$ whereas $r_2<0$ then we solve for $u$ using positive root, $$u = \sqrt{(r_1+r_2)u-r_1r_2}$$ Let $u=x-C$ thus, $$x-C = \sqrt{(r_1+r_2)(x-C)-r_1r_2}$$ thus, $$x = C+\sqrt{(r_1+r_2)x-C(r_1+r_2)-r_1r_2}$$ whose solution $u=r_1$ means $x-C=r_1$ or $x=C+r_1$.

Let me try it out. Let $r_1=3$ and $r_2=-2$ then $$x = C+\sqrt{x-C+6}$$ Set $C=2$ to find $x=2+\sqrt{x+4}$. Now, if my reverse engineering worked, we should find $x=3+2$ and $x=-2+2=0$ as solutions of which $x=0$ is extraneous. Isolate the radical, $$x-2 = \sqrt{x+4} \ \ \Rightarrow \ \ (x-2)^2= x+4 \ \ \Rightarrow \ \ x^2-4x+4 =x+4$$ thus $x(x-5)=0$ so we find $x=0$ or $x=5$. However, $0=2+\sqrt{0+4}$ suggests that $2+\sqrt{4}=0$ which is absurd whereas $x=5$ will check as a genuine solution to the constructed problem.

Now, basically, I give a template to set-up problems of the form $x = C+\sqrt{x+B}$. Notice I am missing the desired $A$-factor. It's easy to multiply my set-up by a constant to get problems of the form $mx =mC+ m\sqrt{x+B}$. For example, no one should be surprised that $3x = 6+3\sqrt{x+4}$ has solution $x=5$. To make it more exciting, pull the $3$ inside the root, $3x=6+\sqrt{9x+36}$.

I tried to set-up a nice revered engineered version for your stated problem, but, getting the $A$ to appear there without fractions requires certain conspiracies between the constants which are difficult to arrange.

Incidentally, I think this is a great question. The problem of constructing nice problems is a hard problem. I would not be surprised if someone could improve on my bruteforce answer here.

• "The problem of constructing nice problems is a hard problem." It really is, especially when you add the requirement that the student should not accidentally be able to get a correct answer by doing something wrong.
• Ah, this is a good approach! I couldn't figure out how to start from the solutions/quadratic I wanted, and get the right kind of radical equation out of it. My mind jumped to, "Well, I have to find a way to write a factorable quadratic as a difference of a perfect square, and a multiple of a linear polynomial... yikes!" Now that I've had some time to soak it in a bit, I'm really appreciating the $u = \sqrt{(r_1 + r_2)u - r_1r_2}$ part. It's ironic because you'll get students who "solve" $x^2 - 5x + 3 = 0$, say, as $x = \sqrt{5x + 3}$. But in the right context, it turns out to be useful! Jul 11 '17 at 17:50