7

Consider the set of all Algebraic numbers that can be written in the form

$$ x = \frac 1q \cdot \sum_{i=1}^{n}(-1)^{k_i} \sqrt{a_i} $$

with $q, n, k_i, a_i \in \mathbb{N}^+$

Is this set closed under inversion, i.e, can every $\frac 1x$ be written in the same form?

Own research:

This looks simple for $n=1$ and $n=2$ as $\frac 1{\sqrt a} = \frac 1a {\sqrt a}$ and $\frac 1{\sqrt a + \sqrt b} = \frac 1{a-b}(\sqrt a - \sqrt b)$.

But even for $n=3$ is is not immediately clear for me. In specific cases, WolframAlpha can find an inversion for me, for example $\frac 1{\sqrt 2+\sqrt 3 - \sqrt 7} = \frac 1{10} (4 \sqrt 2 + 3 \sqrt 3 + \sqrt 7 + \sqrt{42})$. But I am unsure if this is possible in any cases, and if not, how to construct a counter-example and prove it.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
mihi
  • 295
  • 1
    For any set of square root terms in a denominator, you can separate those from any rationals also in the denominator and do a difference of squares completion. You can repeat this process as needed until all square root terms in the denominator have become rational. The numerator might be a bit messy after that... – abiessu Jun 24 '25 at 21:06
  • I could imagine a solution using linear algebra – J. W. Tanner Jun 24 '25 at 22:05
  • Mathematical induction should do the work, I suppose. – Bumblebee Jun 25 '25 at 02:47

4 Answers4

10

Yes, this set is closed under inversion.

In more familiar terminology, your set is the ring $R=\mathbb{Q}[\{\sqrt{d}\mid d>0\}]$. (The condition you impose about all the coefficients being $\pm 1/q$ for some fixed $q$ is not really any condition at all: given any element $x = \sum_{i=1}^n q_i\sqrt{a_i}\in R$, you can always let $q$ be the lcm of the denominators of the $q_i$ and then increase $n$ to add multiple copies of each $\sqrt{a_i}$ as needed to take care of the numerators.) You are asking whether this ring is a field.

The point is that if $x\in R$, then $x = \sum_{i=1}^n q_i \sqrt{a_i}$ for some $q_i\in\mathbb{Q}$ and $a_i\in \mathbb{Z}_{>0}$. So $x$ lies in the subring $\mathbb{Q}[\{\sqrt{a_i}\mid 1\leq i\leq n\}]$. And this ring is a field precisely because the $\sqrt{a_i}$ are algebraic over $\mathbb{Q}$: see Adjoining a number to a field. In particular, $1/x$ also lies in this ring, so $1/x$ lies in $R$.

3

It’s not too messy by hand; you don’t need Wolfram Alpha:

$$\frac1{\sqrt2+\sqrt3-\sqrt7}\cdot\dfrac{\sqrt2+\sqrt3+\sqrt7} {\sqrt2+\sqrt3+\sqrt7}$$

$$=\dfrac{\sqrt2+\sqrt3+\sqrt7}{2+2\sqrt6+3-7}$$

$$=\dfrac{\sqrt2+\sqrt3+\sqrt7}{2\sqrt6-2}\cdot\dfrac{2\sqrt6+2}{2\sqrt6+2}$$

$$=\dfrac{4\sqrt3+2\sqrt2+6\sqrt2+2\sqrt3+2\sqrt{42}+2\sqrt7}{20}$$

$$=\dfrac{4\sqrt2+3\sqrt3+\sqrt7+\sqrt{42}}{10}$$

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
3

As you know:

$$\frac{N}{X+\sqrt{Y}} = \frac{N}{X+\sqrt{Y}} \frac{X-\sqrt{Y}}{X-\sqrt{Y}} = \frac{N(X-\sqrt{Y})}{X^2 - Y}$$

each step eliminates one $\sqrt{Y}$ radical from the denominator (turning it into a rational number), and squares the rest of the demoninator, then uses the difference as the resulting denominator.

The idea is to repeat this procedure until the denominator is rational.

But, what guarantee do we have that the squaring doesn't produce an endless source of new radicals?

Well, if you start with X = $\sum_{i=0}^{k} q_i \sqrt{x_i}$, powers of X in reduced form can only contain $\sqrt{ \prod_{i=0}^{k} x_i^{a_i} }$. If we reduce these to lowest terms, $a_i$ cannot exceed 1, as you can pull powers of 2 out of the radical.

This means that the size of the radicals in this standard form $\prod{x_i^{a_i}}$ you can produce from raising $X$ or a sub-sum or a sub-sum with rationals added to it to a power is bounded. Shave off the lowest (above 1) radical in that form, and repeat. When you are done, what you have left is $\sqrt{\prod{x_i^0}}$, a rational denominator.

Yakk
  • 1,581
  • In case I wanted to implement it as an algorithm, is it a better straegy to shave off the lowest (>1) or the highest reduced redical first? Or the one with most or least prime factors? – mihi Jun 25 '25 at 20:25
  • @mihi I mean, you can express it in terms of prime factors. 1/X+Ysqrt(P). Have X and Y have radicals that contain no factors of P, have P be a prime, then get (X-Ysqrt(P))/(X^2-Y^2 P). That gets you O(# prime factors in radicals) reductions, which seems reasonable. (If everything with a P also has another prime Q, you can do both at once). – Yakk Jun 25 '25 at 20:42
1

Here is a simple, general procedure to represent $1/x$ as sum of rational numbers times square roots of natural numbers, assuming $x$ has been written in the same form.

Suppose that $$x=q_1\sqrt{a_1}+\dots+q_n\sqrt{a_n},$$ where $n\in \mathbb N$, each $q_i\in \mathbb Q$, and each $a_i\in \mathbb N^+$. There are $n-1$ plus signs in the above expression for $x$. If you replace each $+$ with $\pm$, then there are $2^{n-1}$ numbers you can get by choosing each $\pm$ to be $+$ or $-$. If you multiply all $2^{n-1}$ of those numbers together, the result will always be rational. This allows you to rationalize the denominator in $1/x$, by multiplying the numerator and denominator by the remaining $2^{n-1}-1$ factors.

For example, if $x=\sqrt2 +\sqrt 3+\sqrt 5$, then $$ \begin{align} \frac1x&=\frac{1}{\sqrt2 +\sqrt 3+\sqrt 5}\\ &=\frac{\hspace{2.5cm}1\cdot (\sqrt2 -\sqrt 3+\sqrt 5)(\sqrt2 +\sqrt 3-\sqrt 5)(\sqrt2 -\sqrt 3-\sqrt 5)}{(\sqrt2 +\sqrt 3+\sqrt 5)(\sqrt2 -\sqrt 3+\sqrt 5)(\sqrt2 +\sqrt 3-\sqrt 5)(\sqrt2 -\sqrt 3-\sqrt 5)}\\ &=\frac{-6\sqrt 2-4\sqrt 3+2\sqrt{30}}{-24}\\ &= \frac14\sqrt 2+\frac16\sqrt3-\frac1{12}\sqrt{30}. \end{align} $$

Mike Earnest
  • 84,902
  • you'll still need to special-case $n=1$ though - your algorithm would not multiply anything – mihi Jun 26 '25 at 22:01