If $\gcd(a,b)=9,$ then what is $\gcd(a^2,b^3)\,?$ I know that by the euclidean algorithm, I can obtain the following equations.
I tried some algebraic manipulation but I can't seem to determine, if $$\text{if }\;\gcd(a,b)=9,\text{ then what is }\gcd(a^2,b^3)\;?$$

$\gcd(a,b) = 9$.  So $a = 9k$ and $b=9j$ and $k$ and $j$ have no factors in common.
$\gcd(a^2,b^3) = \gcd(9^2k^2, 9^3j^3)$.  $9^2k^2$ and $9j^3$ have $9^2$ in common.
So $\gcd(a^2,b^3) = \gcd(9^2k^2, 9^3j^3) = 9^2*\gcd(k^2, 9j^3)$.  $k, j$ have no factors in common with each other but $9$ and $k^2$ may have factors is common.  If they do then that prime factor in common is $3$ and $9|k^2$.
So
CASE 1:  $a = 9k$ and $b=9j$ and $3|k$. so $k= 3l$ for some $l$ and $a = 27l$.  If so then $3 \not \mid j$ (as $j,k$ have no factors in common).  
So $\gcd(a^2, b^3) = \gcd(27^2l^2, 9^3j^3)$.  These have $9^3$ in common but $l$ and $j$ have no factors in common and no power of $3$ divides $j^3$.  
So $\gcd (a^2,b^3) = 9^3$.
CASE 2: $a = 9k$ and $b = 9j$ and $3 \not \mid k$.  Then $\gcd(a^2,b^3) = \gcd(9^2k^2, 9^3j^3)$.  These have $9^2$ in common.  $j$ and $k$ have nothing in common and no power of $3$ divides $k^2$.  
So $\gcd(a^2,b^3) = 9^2$.
So the $\gcd(a^2,b^3) = 9^3$ if $27|a$ but $\gcd(a^2,b^3) = 9^2$ if $27 \not \mid a$.
