TITLE: Can someone explain why $x^{\log(a)} = a^{\log(x)}$?
QUESTION [5 upvotes]: I'm trying to see why the below is true.
$$
x^{\log(a)} = a^{\log(x)}
$$
Anyone here know why this is?
Thank you.

REPLY [5 votes]: take the $\log$ for both sides to get
$$\log (x^{log(a)})=\log (a^{\log(x)})$$
$$\log (a){log(x)}=\log( a){\log(x)}$$
It is clear that the $a$,$x$ should be positive

REPLY [3 votes]: This is essentially another way of saying what sanjab has already said, but in a way that gives it a bit more intellectual context. Its sort of the "deeper reason" why it works. So why does $p^{\log(q)} = q^{\log(p)}$? Well, because there's this commutative operation $$\otimes : \mathbb{R}_{>0} \times \mathbb{R}_{>0} \longrightarrow \mathbb{R}_{>0}$$ that I'm about to define, and as it turns out, we have the following.
$$p^{\log(q)} = p \otimes q$$
$$q^{\log(p)} = q \otimes p$$
So let me go ahead and explain the notation. Define $\otimes$ as follows. 
$$p \otimes q = \exp(\log(p)\log(q))$$
Then $\otimes$ is associative and commutative, and it has an identity element, namely $e$, by which I mean that the following identity holds, for all $p \in \mathbb{R}_{>0}$.
$$e \otimes p = p \otimes e = p$$
Now define that $p^* = \exp(1/\log(p))$. This makes sense whenever $p \in \mathbb{R}_{>0}$ is distinct from $1$, in which case:
$$p^* \otimes p = p \otimes p^* = e$$
Furthermore, $\otimes$ distributives over multiplication:
$$p \otimes (qr) = (p \otimes q)(p \otimes r)$$
If this all seems like magic, don't worry, I'm about the take the magic away. There is a homomorphism of abelian groups
$$\exp : (\mathbb{R},+,0) \rightarrow (\mathbb{R}_{>0},\times,1).$$
In fact, this function is bijective, so we can push operations on $\mathbb{R}$ across $\exp$ to obtain operations on $\mathbb{R}_{>0}.$ Multiplication on $\mathbb{R}_{>0}$ is what we get for pushing $+_\mathbb{R}$ across $\exp$, and $\otimes$ is what we get for pushing $\times_\mathbb{R}$. So in fact, $\mathbb{R}_{>0}$ is completely isomorphic to $\mathbb{R}$.
Now given $p \in \mathbb{R}_{>0}$ and $x \in \mathbb{R}$, we can define $p^x \in \mathbb{R}_{>0}$ as follows:
$$p^x = p \otimes \exp x$$
Getting back to your question, we have:
$$p^{\log(q)} = p \otimes \exp (\log q) = p \otimes q$$
$$q^{\log(p)} = q \otimes \exp (\log p) = q \otimes p$$