I always like to prove these sorts of things with Bézout's identity.
In general, if $d\mid e$ then $d^n\mid e^n$.
Letting $d=(a,b)$ and $e=a$ means that $(a,b)^n\mid a^n.$ Likewise, $(a,b)^n\mid b^n,$ so $(a,b)^n\mid (a^n,b^n).$
Now, we prove by induction that we can solve $a^nX+b^nY=(a,b)^n$ for any $n\geq 1.$
We can solve it for $n=1$ by Bézout's identity.
Assume we have $a^nX+b^nY=(a,b)^n.$ Cubing, we get:
$$\begin{align}(a,b)^{3n}&=(a^nX+b^nY)^3\\
&=a^{n+1}\left(a^{2n-1}X^{3}+3a^{n-1}b^nX^2Y\right)+b^{n+1}\left(3a^nb^{n-1}XY^2+b^{2n-1}Y^3\right)\\&=a^{n+1}U+b^{n+1}V
\end{align}$$
Now notice that both $U$ and $V$ are both divisible by $(a,b)^{2n-1}.$ (This is because $a^{2n-1},a^{n-1}b^n,a^nb^{n-1},$ and $b^{2n-1}$ are.)
So letting $X'=\frac{U}{(a,b)^{2n-1}}, Y'=\frac{V}{(a,b)^{2n-1}},$ we get:
$$a^{n+1}X'+b^{n+1}Y'=(a,b)^{n+1}$$
From these two we conclude that $(a,b)^n\mid(a^n,b^n)$ and $(a^n,b^n)\mid (a,b)^n.$