Don't understand how powers of logarithm work. I found this example and I'm struggling to derive it so that the left hand side is equal to right hand side. Why is this so?
$$5^{\log_2(x)} = x^{\log_2(5)}$$
 A: The numbers $2$ and $5$ are irrelevant here. If $a,b>0$, then$$a^b=e^{b\log a}$$and therefore, if $c>0$\begin{align}a^{\log_cb}&=e^{\log_c(b)\log(a)}\\&=e^{\frac{\log b}{\log c}\log a}\\&=e^{\log b\frac{\log a}{\log c}}\\&=b^{\log_ca}.\end{align}
A: To prove $5^{\log_2 x}=x^{\log_2 5}$, apply $\log_2$ to $5^{\log_2 x}$:
$\log_2 5^{\log_2 x} = \log_2 x\log_2 5 = \log_2 5 \log_2 x = \log_2 x^{\log_2 5}.$
You just need one property of the logarithm ($\log a^b = b\log a$) and commutativity ($ab=ba$) in the 2nd equation.
Then exponentiate both sides (which are equal) by 2:
$2^{\log_2 5^{\log_2 x}} = 5^{\log_2 x}$ and $2^{\log_2 x^{\log_2 5}} = x^{\log_2 5}$.
Here you just need that $2^{\log_2 y} = y$, i.e., exponentiation by 2 and taking $\log_2$ are inverse operations.
A: $$
5^{\log_2(x)}
= 5^{\color{red}{1} \cdot \log_2(x)}
= 5^{\color{red}{\tfrac{\log_2(5)}{\log_2(5)}} \cdot \log_2(x)}
= 5^{\color{blue}{\tfrac{\log_2(x)}{\log_2(5)}} \cdot \log_2(5)}
= 5^{\color{blue}{\log_5(x)} \cdot \log_2(5)}
= x^{\log_2(5)}
$$
