# Trying to show that an equation in two variables implies that the variables are the same

Let $$a ,b$$ be non-zero integers such that $$\frac{a^2 + \sqrt{2}}{a} = \frac{b^2 + \sqrt{2}}{b}$$. Prove that $$a=b$$.

My proof:

1. Assume that $$a \neq b$$. Then, $$a - b \neq 0$$, implying that one can divide by $$a-b$$.
2. The given expression simplifies like so

$$a^2b +b\sqrt2=ab^2+a\sqrt2 \\ ab(a-b) = \sqrt2(a-b) \\ ab = \sqrt2$$

In the third step here, we have divided by $$a-b$$.

1. The conclusion $$ab = \sqrt2$$ is absurd. The product of two non-zero integers cannot be $$\sqrt2$$.

$$\implies$$ the initial assumption is false. $$a = b \text{ QED.}$$

I think something is wrong with my proof.

1. Have I taken into account during the assumption that $$a$$ and $$b$$ are integers?
• Your proof is absolutely fine. Jan 22, 2021 at 7:26
• Yes, you did in step 3. -- You might have gone along with a more direct proof (i..e, without first assuming $a-b\ne0$) if you could use that $m\sqrt 2=n$ with integers $m.n$ implies $m=n=0$ Jan 22, 2021 at 7:27
• I would rather use the word suppose instead of assume here. Everything else looks fine. Jan 22, 2021 at 7:30

Indeed, as the comments indicated, you actually did use the fact that $$a, b$$ are integers in your proof, since the product of two integers cannot equal $$\sqrt{2}$$.
To illustrate, note that if $$a = \sqrt{2}$$ and $$b = 1$$, the equality should hold, and in fact it does, since $$\frac{(\sqrt{2})^2 + \sqrt{2}}{\sqrt{2}} = \frac{\sqrt{2}(\sqrt{2} + 1)}{\sqrt{2}} = 1 + \sqrt{2} = \frac{1^2 + \sqrt{2}}{1}.$$ So if the condition that $$a, b$$ are integers is relaxed, it is possible for $$a \ne b$$.
Let $$f(x) = x + \frac{\sqrt2}{x}$$ which is an odd function, it is positive when $$x$$ is positive and negative when $$x$$ is negative.
$$f'(x) =1-\frac{\sqrt2}{x^2}$$, it increases on $$(\sqrt{2}, \infty)$$.
We just have to check that $$f(1) \le f(\sqrt{2})$$ which is true since $$f(1)=f(\sqrt2)=1+\sqrt2$$