# If the square of an integer number $x$ is even, then $x$ has to be even.

My math textbook had the following statement but did not mention how it got there, so I tried to find a proof. Can someone please verify if it is correct.

Statement: If the square of an integer number $x$ is even, then $x$ has to be even.

Proof:

We know that $x^2$ is even, so we can write it in the form of an even number

$$x^2 = 2n$$

$$x = \sqrt2 \sqrt n$$

We know that $x$ is an integer and hence a rational number

$$x=(\sqrt2 \sqrt n) \times\frac{\sqrt2}{\sqrt2}$$

$$x=2(\sqrt\frac{n}{2})$$

Since $n$ is a natural number and $\sqrt(\frac{n}{2})$ is rational (because 2 and x are rational and the quotient of two rational numbers is rational). $n$ can only assume those values which allow $\sqrt(\frac{n}{2})$ to come out rational. In other words, $\frac{n}{2}$ has to be a perfect square.

Now $x=2p$ where $p$ is an integer and hence $x$ is even.

• odd x odd = odd, so it must be even x even = even. – Andrew Li Mar 26 '18 at 11:51
• "since $x$ is an integer $\sqrt{\frac n2}$ also has to be an integer" Why then? – drhab Mar 26 '18 at 11:51
• @drhab Thanks for pointing that out. I have changed that last part. – Abhishek Mhatre Mar 26 '18 at 12:08

If a prime number (or a prime) is defined as a natural number greater than $1$ that cannot be formed by multiplying two smaller natural numbers then with unique prime decomposition it can be shown that for integers $a,b$ and prime $p$:$$p\mid ab\iff p\mid a\text{ or }p\mid b$$

Applying that on $p=2$ and $a=b=x\in\mathbb Z$ we find:$$2\mid x^2\iff 2\mid x$$

I would prove the contrapositive: if $x$ is odd, then so is $x^2$.

$$x = 2\sqrt{\frac{n}{2}}$$ Since $x$ is an integer, $\sqrt{\frac{n}{2}}$ also has to be an integer.

This is only true if $x$ is even, the fact that you're trying to prove.

It's also worth pointing out that this proposition is typically used in the standard proof that $\sqrt{2}$ is irrational. There's nothing necessarily wrong with using irrationality of $\sqrt{2}$ to prove it, so long as you have another proof that $\sqrt{2}$ is irrational to hand.

• Thanks for pointing that out. I have made a change to the last part and yes, if I had to, I would probably use that proof by contradiction to show that root 2 is irrational since I haven't let studied the lower bound concepts yet. – Abhishek Mhatre Mar 26 '18 at 16:14

Yes, your proof looks alright to me. However, more conventionally, you could use contradiction proofs for these types of questions.

Theorem: $x^2$ is even $\implies$ $x$ is even

Proof: Assume for a contradiction that $x^2$ is even and $x$ is odd. Then

\begin{align} x & = 2k+1 \\ x^2& = (2k+1)^2 \\ & = 4k^2 + 4k+1 \\ & = 2(2k^2+2k)+1 \\ \end{align}

Which is in the form $2n+1$, so $x^2$ is odd. However, we assumed $x^2$ is even. Hence a contradiction is found and $x$ cannot be odd.

$\therefore x^2$ is even $\implies$ $x$ is even.