@Masoud The rule $(a^m)^n = a^{mn}$ is not true for all $a$, $m$, $n$. Generally when that rule is taught, these variables are assumed to be positive.
– Greg HurstDec 09 '14 at 21:29
A closer post (instead of the linked one) is https://math.stackexchange.com/questions/547181
– Anne BauvalDec 31 '24 at 16:44
Orderof evaluation matters. – Chen Stats Yu Dec 09 '14 at 20:50