How to find a square root

85 Views Asked by At

Let $m$ be a positive square-free integer, and a number $z\in Q(\sqrt{m})$ is given. How to find a square root of $z$, if it exists in $Q(\sqrt{m})$?

Here $Q$ is the field of rational numbers.

I am asking for a reference or an explanation of an algorithm. Of course, I can look for a square root in the form $x+y\sqrt{m}$, square this, and obtain a system of quadratic equations. But solving this system leads again to a question of the same kind. Namely, if $z=a+b\sqrt{m}$ I obtain: $$x^2+my^2=a,$$ $$2xy=b.$$ This is equivalent to a biquadratic equation $4x^4-4ax^2+mb^2=0$, and $x^2=(4a\pm\sqrt{16a^2-mb^2})/8$, so I am back to a problem of the same kind.

For example, for the $\sqrt{15/2+(5/2)\sqrt{5}}$. I can guess the answer, but I want to have an algorithm.

1

There are 1 best solutions below

0
On BEST ANSWER

You have:

$$x^2+my^2=a \\ 2xy = b$$

If instead you solve for $y$, you get:

$$4my^4 - 4ay^2+b^2 = 0$$

This distinction may not be important, but it is a bit easier to solve. Solving for $y^2$ gives:

$$y^2 = \dfrac{4a \pm \sqrt{16a^2-16mb^2}}{8m} = \dfrac{a \pm \sqrt{a^2-mb^2}}{2m}$$

But, you must have $y \in \mathbb{Q}$, so it must be that $\sqrt{a^2-mb^2} \in \mathbb{Q}$.

In the example you gave with $z = \dfrac{15}{2}+\dfrac{5}{2}\sqrt{5}$, you have:

$$y^2 = \dfrac{\tfrac{15}{2}\pm \sqrt{\tfrac{225}{4}-\tfrac{125}{4}}}{10} = \dfrac{\tfrac{15}{2}\pm \tfrac{10}{2}}{10}$$

$$y^2 = \dfrac{1}{4}\text{ or }y^2 = \dfrac{5}{4}$$

Next, you must have $y \in \mathbb{Q}$, so it must be that $y = \pm \dfrac{1}{2}$.

Now, we have

$$x = \dfrac{5}{4y} = \pm \dfrac{5}{2}$$

And this gives us our two answers:

$$\sqrt{\dfrac{15}{2}+\dfrac{5}{2}\sqrt{5}} = \pm\left( \dfrac{5}{2}+\dfrac{1}{2}\sqrt{5}\right)$$

And the requirement that $x,y \in \mathbb{Q}$ will always limit your answers so that you are no longer "guessing".