The sum of square roots of non-perfect squares is never integer

This question already has an answer here:

  • Can $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m$ are perfect squares?

    3 answers

Solutions Collecting From Web of "The sum of square roots of non-perfect squares is never integer"

Assume that $a, b \in \mathbb N $ are not perfect squares and
$ \sqrt a + \sqrt b = n \in \mathbb N$. Then
$$
a = (n – \sqrt b)^2 = n^2 – 2 n \sqrt b + b
$$
which means that $\sqrt b$ is a rational number. This contradicts the fact
that the square root of an integer is either an integer or a irrational number.

More generally, for $n\in\mathbb N$ let $a_1,\ldots,a_n\in\mathbb N$ be distinct and square-free and let $c_1,\ldots,c_n\in\mathbb Q$. Then the number
$s=\sum_{k=1}^nc_k\sqrt{a_k} $ is rational if and only if $c_1=\ldots=c_n=0$.

In other words, even something like $\sqrt n+\sqrt m-\sqrt k\in\mathbb Q$ has only “trivial” solutions such as $\sqrt 2+\sqrt 8-\sqrt{18}=0$, which is derived from $\sqrt 2\cdot(1+2-3)=0$.

Proof: The “if” part is trivial, so we only need to show the “only if” part. Let $\alpha_k=\sqrt{a_k}$.
Then $\alpha_k$ is irrational.
If $n=1$, we immediately get that $s=c_1\alpha_1\notin \mathbb Q$ unless $c_1=0$. Therefore, we may assume $n\ge 2$.
For a proof by induction assume that the claim is true when $n$ is replaced by any smaller natural number.
Let $\beta={\alpha_1}{\alpha_2}=\sqrt{a_1a_2}$. Since $a_1\ne a_2$ and $a_1,a_2$ are squarefree, $a_1a_2$ is not a perfect square. Thus $\beta^2\in\mathbb Q$, but $\beta\notin \mathbb Q$.
Consider the fields $K:=\mathbb Q[\beta]$ and $L:=\mathbb Q[\alpha_1,\ldots,\alpha_n]$. Then $\mathbb Q\subseteq K\subseteq L$ and the extensions $L/K$ and $K/\mathbb Q$ are Galois (the only conjugates of $\alpha_k$ and $\beta$ are $-\alpha_k$ and $-\beta$ and are also $\in L$ and $\in K$, respectively).
Therefore, the automorphism of $K$ that is induced by $\beta\mapsto-\beta$ can be extended to an automorphism $\phi$ of $L$. Then $\phi(\alpha_k)\in\{\alpha_k,\alpha_k\}$ for each $k$. Let
$$ A_+=\{k\mid 1\le k\le n,\phi(\alpha_k)=\alpha_k\},\qquad A_-=\{k\mid 1\le k\le n,\phi(\alpha_k)=-\alpha_k\}.$$
Then
$$ \phi(s)=\sum_{k=1}^ nc_k\phi(\alpha_k)=\sum_{k\in A_+}c_k\alpha_k-\sum_{k\in A_-}c_k\alpha_k.$$
From $\phi(\beta)=-\phi(\beta)$ we conclude: if $1\in A_+$ then $2\in A_-$, and if $1\in A_-$ then $2\in A_+$.
Hence neither $A_+$ nor $A_-$ are empty and we have $1\le |A_+|<n$ and $1\le |A_-|<n$.
If we assume $s\in\mathbb Q$, then $s=\phi(s)$ and hence
$$ \sum_{k\in A_+}2c_k\sqrt{a_k}=s+\phi(s)=2s \in\mathbb Q,$$
$$ \sum_{k\in A_-}2c_k\sqrt{a_k}=s-\phi(s)=0 \in\mathbb Q.$$
By induction hypothesis, we conclude that $c_k=0$ for all $k\in A_+$ and also $c_k=0$ for all $k\in A_-$, that is $c_k=0$ for all $k$ as was to be shown.

Remark: The essential step here is that there is an automorphism $\phi$ of $L$ with $\phi(\beta)\ne\beta$. This may not require the full sledgehammer of Galois theory.

Suppose $\sqrt{x}+\sqrt{y}=n\in\mathbb{N}$, then $x+y+2\sqrt{xy}=n^2$ i.e. $\sqrt{xy}=m\in\mathbb{N}$. Thus $xy=m^2$, $y=\frac{m^2}{x}$ and hence $x+m=n\sqrt{x}$. This proves that $x$ is a perfect square and thus $y$ has to be one as well.