# Prove that if $a$ divides $b^2$ then $a$ divides $b$

I'm generalizing this, but in my proof I just need to explain why if $2$ divides $b^2$, then $2$ divides $b$.

I could find the answer for if $a^2$ divides $b^2$ then $a$ divides $b$, but not for this question. I appreciate any help!

• Does 9 divide 9? Does 9 divide 3? – Mees de Vries Dec 13 '17 at 15:14
• Can you see why this is true when $a$ is prime but not necessarily otherwise? – Ethan Bolker Dec 13 '17 at 15:16

In general, it is not true that if $$a$$ divides $$b^2$$, then $$a$$ divides $$b$$. For example, $$4$$ divides $$2^2$$, but $$4$$ does not divide $$2$$.

However, in your case, when $$a=2$$, it is true.

If $$b$$ is odd, then $$b^2$$ is odd so $$2$$ does not divide $$b^2$$ - this is not true. Therefore, $$b$$ is not odd, so $$b$$ is even. Therefore, $$b$$ is divisible by $$2$$.

It is true even more in general, since, if $$a$$ is prime and $$a$$ divides $$b^2$$, then $$a$$ divides $$b$$. This is most simply shown using the fundamental theorem of arithmetic.

More generally, this is true if and only if $$a$$ is not divisible by any square of a prime number. For example, it is true for $$a=6$$, but it is not true for $$a=4$$.

Outline of proof:

Part 1:: If $$a$$ is divisible by a square of a prime number, then we cannot conclude from $$a|b^2$$ that $$a|b$$.

Any time $$a$$ is divisible by a square of a prime number, $$a=k\cdot p^n$$ where $$n\geq 2$$ and $$p$$ does not divide $$k$$, you can see that $$a$$ divides $$(k\cdot p^{n-1})^2$$, but $$a$$ does not divide $$k\cdot p^{n-1}$$.

Part 2: If $$a$$ is not divisible by a square of a prime number, then we can conclude from $$a|b^2$$ that $$a|b$$.

On the other hand, if $$a$$ is not divisible by a square of a prime number, then $$a=p_1p_2\cdots p_n$$ where $$p_i$$ is prime for all $$p$$. Then, assuming $$a$$ divides $$b^2$$, you can conclude that $$p_i$$ divides $$b^2$$, and therefore $$p_i$$ divides $$b$$ (from prime factorization) for all $$i$$. From this, you can conclude that $$a$$ divides $$b$$.

• Thanks a lot! This really helped – Van Dec 16 '17 at 12:34

The general claim you have made that $$a|b^2\implies a|b$$ is not true

As mentioned in the comments, taking the simple counterexample $a=9$, $b=3$

The statement $$2|b^2\implies 2|b$$

is true

Consider the cases:

Suppose $b$ is even. Then we can write $b=2k\implies b^2=4k^2=2(2k^2)\implies b^2\quad\text{is even}$

Suppose $b$ is odd. Then we can write $b=2k+1\implies b^2 =(2k+1)^2=4k^2+4k+1=2(k^2+2k)+1\implies b^2\quad\text{is odd}$

Then by 'exhaustion' of the possible cases, we have shown that $2|b^2\implies 2|b$

• That is very clear. Thanks! – Van Dec 16 '17 at 12:35

$2$ is a prime number. The idea at play is that if $p$ is prime and if $p$ divides $b^2$ for some integer $b$ then $p$ divides $b$.

If $p$ divides $b^2 = b \cdot b$ then either $p$ divides $b$ or $p$ divides $b$ (Euclid’s Lemma). So, it follows that $p$ divides $b$.

This doesn’t generalize to all composite integers (see the comments).

• I didn't see that it could be done by Eulid's Lemma. Thanks! – Van Dec 16 '17 at 12:34