Hint $\rm\ n,m>0,\,$ prime $\rm\,p\mid a^n,b^m\Rightarrow\:p\mid a,b\:$ by prime $\rm\:p\mid d_1\cdots d_k\Rightarrow p\mid d_1\, $ or $\rm\,\ldots\,$ or $\rm \,p\mid d_k,\,$ by Euclid's Lemma ($k$-ary inductive extension), or by existence & uniqueness of prime factorizations.
Or more generally, see my post here on the "Freshmans Dream" for gcds or ideals.
Or Gauss's Lemma (GL) yields a quick proof. Let $\rm\:{\cal C}(f)\:$ denote the content of a polynomial, i.e. the gcd of its coefficients. GL states $\rm\: {\cal C}(f\,g)\ =\ {\cal C}(f)\ {\cal C}(g)\ $ hence
$\rm\qquad\qquad\qquad\ \ 1\ =\ (a,b)\ =\ {\cal C}\:(a\ x + b)\ =\ {\cal C}\:(a\ x - b)$
$\rm\qquad\qquad \Rightarrow\ \ 1\ =\ {\cal C}\:((a\ x + b)\:(a\ x - b))\ =\ {\cal C}\:(a^2\: x^2 - b^2)\: =\: (a^2,b^2)$
Iterating shows that $\rm\,(a^n,b^n) = 1\,$ for $\rm\:n = 2^k,\,$ hence for all $\rm\:n,\:$ by $\rm\,m\le n\,\Rightarrow\,(a^m,b^m)\:|\:(a^n,b^n),\,$ another example of the "up then down" (or interval) induction.
Corollary $\,\ (A^n,B^n) = (A,B)^n$
Proof $ $ Cancelling $\, c^n := (A,B)^n $ reduces it to the above, by $\,(A/c,B/c) = (A,B)/c = 1,$ by the GCD Distributive Law.