Rational numbers $a, b$ are such that $a+b$ and $a^2+b^2$ are integers. Prove that $a, b$ are integers.
Problem
Source: Czech-Polish-Slovak Match Junior 2019, team p1 CPSJ
Tags: number theory, rational, Integers
20.01.2020 20:39
Note that $(a+b)^2-(a^2+b^2)=2ab$ is also an integer. Then the polynomial $2x^2-2(a+b)x+2ab$ has integer coefficients and roots $a,b,$ so by RRT (see here for a proof of RRT if you need it), $a,b$ are of the form $m/2,n/2$ for some $m,n\in\mathbb{Z}.$ Then \begin{align*}a^2+b^2\in\mathbb{Z} &\implies \frac{m^2+n^2}{4}\in\mathbb{Z} \\ &\implies m^2+n^2\equiv0\pmod{4} \\ &\implies m,n\equiv0\pmod{2}\end{align*}so $m/2,n/2$ are integers, i.e. $a,b$ are integers.
02.03.2021 23:04
$(a+b)^2-a^2-b^2=2ab$, that should be an integer. Let $a=\dfrac{x}{y}$, $b=\dfrac{w}{z}$, with $gcd(x,y)=gcd(w,z) =1$ $(1)$. We'll prove that $y=z$: For that, note that if $a+b=n$, then $xyn=xz+yw$, and that tells us that $z$ divides $y$. But if $a^2+b^2=m$, then $(yz)^2.m=(xz)^2+(yw)^2$, and that tells us that $y$ divides $z$. Thus $y=z=L$. Since $2ab=2xw/yz=2xw/(L^2)$, but since $(1)$, $L$ has to be 1, because $L^2=2$ don't give us solutions on the integers. So we finish, because $a=x$ and $b=w$. $Q.E.D$
03.03.2021 00:09
$a+b\in\mathbb Z \implies (a+b)^2 = a^2+2ab+b^2\in\mathbb Z$, and since $a^2+b^2\in\mathbb Z$, we have that $2ab\in\mathbb Z$. This means that $a^2-2ab+b^2 = (a-b)^2\in\mathbb Z$. Since $a,b\in\mathbb Q \implies a-b\in\mathbb Q$, this must mean that $a-b\in\mathbb Z$. Adding $a+b$ and $a-b$ gets $2a\in\mathbb Z$, so $a$ is either an integer or has fractional part $\tfrac1 2$. If the latter were the case, since $a+b\in\mathbb Z$, $b$ would also have fractional part $\tfrac1 2$, but then $a^2$ and $b^2$ would have fractional part $\tfrac1 4$ (since $(n+\tfrac1 2)^2 = n^2+n+\tfrac1 4$) and $a^2+b^2$ would not be an integer, a contradiction. Thus, $a$ must be an integer, and since $a+b\in\mathbb Z$, $b$ is also an integer, and we are done.