# if $a^{2}\mid b^{2}$ then $a|b$ [duplicate]

Proof or disproof that if $a$ and $b$ are integrers such that $a^{2}\mid b^{2}$ then $a\mid b$. I know that the original proposition is with $a$ and $b$ primes, but I can't find a counterexample to prove that this statement is false.

## marked as duplicate by Bill Dubuque divisibility StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Mar 16 at 15:53

• If $a$ does not divide $b$ where do divisors come from such that $a^2$ divides $b^2$? – Raffaele Oct 31 '17 at 11:58

$a^2$ divides $b^2$, so the quotient $b^2/a^2=(b/a)^2$ is integer. Its square root, $b/a$, is rational.

By $\sqrt a$ is either an integer or an irrational number., it must be integer.

So $a$ divides $b$.

Note that the question I linked to is essentially equivalent to yours: if $\sqrt n=a/b$ is rational, then $n=b^2/a^2$, so $a^2$ divides $b^2$, and because $a$ divides $b$, $\sqrt n$ is an integer.

So every proof given there (there are tons!) can be used here and vice versa.

deleted Apr 1 at 13:24
• thanks, fixed.${}$ – rabota Oct 31 '17 at 9:31

Hint: if $a = \pm p_1^{\alpha_1} \cdot \ldots \cdot p_n^{\alpha_n}$ and $b = \pm p_1^{\beta_1} \cdot \ldots \cdot p_n^{\beta_n}$ are factorizations of $a$ and $b$, then

$$a \mid b \iff \bigwedge_{i=1}^n \alpha_i \leqslant \beta_i.$$

deleted Apr 1 at 13:24

We just use the Bézout's identity to solve this problem.

$\textbf{Lemma 1}$ $\gcd( x, y ) = 1 \Leftrightarrow \gcd( x^2, y^2 ) = 1$

Proof. On the one hand, if $\gcd( x^2, y^2 ) = 1$, $\exists s,t \in \mathbb{Z}$ such that $sx^2 + t y^2 =1$. Let $u = sx$ and $v =ty$, then $ux + vy =1$. Thus $\gcd( x, y ) = 1$.

One the other hand, if $\gcd( x, y ) = 1$, $\exists u,v \in \mathbb{Z}$ such that $ux + vy =1$. \begin{aligned} 1 &= ux + vy \\ &= (ux + vy)^2 \\ &= u^2x^2 + 2uvxy +v^2y^2 \\ &= u^2x^2 + 2uvxy(ux + vy) +v^2y^2 \\ &= (1+2vy)u^2x^2 + (1 + 2ux)v^2y^2 \\ \end{aligned} Let $s = (1 + 2vy)u^2$ and $t = (1 + 2ux)v^2$, then $sx^2 + ty^2 = 1$, Thus $\gcd( x^2, y^2 ) = 1$.

$\Box$

$\textbf{Theorem 1}$ $a|b \Leftrightarrow a^2|b^2$

Proof. Let $\gcd (a , b) =d$. Then $a = xd$, $b = yd$ and $\gcd( x, y ) = 1$. Since $\gcd (x, y) =1 \Leftrightarrow \gcd (x^2, y^2) =1$ by lemma 1, $$a^2 | b^2 \Leftrightarrow x^{2} | y^{2} \Leftrightarrow x^2 = 1 \Leftrightarrow x = \pm 1 \Leftrightarrow a = \pm d \Leftrightarrow a|b$$

$\Box$

deleted Apr 1 at 13:24

Lemma: If $m$ is an integer and $\sqrt m$ is rational, then $\sqrt m$ is an integer.

The proof proceeds by first taking any square factors of $m$ outside the square root sign, so that inside the square root sign you're left with a square-free number. Then if that square-free number is not $1$, you can more or less follow the proof of the irrationality of $\sqrt 2$ step by step, using for instance the smallest prime that divides the square-free number in place of $2$.

I am assuming $a, b \neq 0$. Using the definition of divisibility, we have that $a^2\mid b^2$ means that there is some $m$ such that $ma^2 = b^2$. Taking the square root, we get $a\sqrt m = b$. Now, since the right-hand side is an integer, the left-hand side must be too. That means that $\sqrt m$ must be rational, and by the lemma above, an integer. Thus $a\sqrt m = b$ proves $a\mid b$.

deleted by owner Oct 31 '17 at 9:25