I'm unsure how $3a3b$ equals $9ab$ and not $3ab$? I get here by doing:
$(a + a + a) \cdot (b + b + b)$
which becomes
$(ab + ab + ab)$
which is
$3ab$?
The only way I can get $3a3b$ to $9ab$ is by doing $33ab$ as $3 * 3 * a * b$ which is $9ab$?
But I see that more as a "trick" not a rule moving the 3? Is this the case or not?
$(a+a+a)\cdot (b+b+b)=a\cdot (b+b+b)+a\cdot (b+b+b)+a\cdot (b+b+b)$