Solution Verification – Simple Proof that $x^{\log y} = y^{\log x}$

logarithmssolution-verification

While trying to prove in another thread that $\ln x/ \ln y$ is transcendental when $x$ and $y$ are rational numbers, I noticed this interesting relationship. Starting with

$$ \frac{\log_b y}{\log_b x} \cdot \log_b x = \log_b y$$

which is hopefully self-evidently true when $x,y \neq 0$ and $b \neq 1$ and $b \neq 0$ is any base including the exponential number. (From here I will simply use $\log$ to mean a logarithm to any valid base.) Using the logarithm power rule from this list of logarithm rules

$$ \log\left(x^{\frac{\log y}{\log x}}\right) = \log y$$

$$ \Rightarrow x^{\frac{\log y}{\log x}} = y$$

(The equation above can form a nice little identity in itself). This easily rearranges to

$$ x^{\log y} = y^{\log x} $$

This 'rule' does not appear to be listed in any lists of logarithm rules that I can find. Maybe there are too many already, or to mathematicians, it is blindingly obvious and goes without saying. Anyway, I think it can come in handy when simplifying some equations by hand. The main question is "Is this 'proof' OK and does it apply to any logarithm of any base $b \neq 0$ and for any $x,y \neq 0, x \neq 1$ where $x,y$ are real numbers, whether algebraic or transcendental?". Does it extend to complex numbers?

As a side note, notice that if we take the intermediate result:

$$ \Rightarrow x^{\frac{\log y}{\log x}} = y$$

and using natural logarithms, so that

$$ \Rightarrow x^{\frac{\ln y}{\ln x}} = y$$

and set $\ln y = z$

$$ \Rightarrow x^{\frac{z}{\ln x}} = \exp z$$

then we can find the result of $\exp z$ using an equation that only requires knowing the natural logarithm of $x$, where $x$ can be any number you like as long as $x \neq $0,1. Handy if the [exp] button on your calculator is broken 🙂

P.S. As Mark Bennet mentions in the comments, a perhaps simpler proof is:

$$ \log x \log y = \log y \log x $$

$$ \Rightarrow \log x^{\log y} = \log y^{\log x} $$

$$ \Rightarrow x^{\log y} = y^{\log x} $$

Best Answer

Because MSE would prefer not to have questions answered solely in the comments, it is recommended to transfer the most helpful comments to a bona-fide answer. I can make this answer CW (community-wiki) upon request.


A comment by [@Travis Willse] suggested to write $e^{\log x \log y} = (e^{\log x})^{\log y} = x^{\log y}$ and observe that doing the same process ("symmetry") with $e^{\log y\log x}$ instead produces the desired result.

A comment by [@Henry] remarked that the above proof works for any sensible base $b$ in place of $e$: $$x^{\log_b y}=(b^{\log_b x})^{\log_b y} = b^{\log_b x\cdot \log_b y} = b^{\log_b y\cdot \log_b x} = (b^{\log_b y})^{\log_b x} = y^{\log_b x}.$$

A comment by [@MarkBennet] suggested using the "plog rule" (power rule for logs --- nicknamed "plog" because $\log(x^p)=p\log x$ reads like "plog"$(x)$): applying $\log$ to both sides, the LHS and RHS respectively become $(\log y) (\log x)$ and $(\log x)(\log y)$, which are equal by commutativity of multiplication. But because $\log x$ is (strictly) monotone (it is increasing), it is injective, and hence the original LHS and RHS must have been equal, proving the desired result.


I see now that the OP has edited the original post with more questions (considered bad practice...), but here is my answer to those: in the general setting of complex numbers, the logarithm becomes quite subtle to define https://en.wikipedia.org/wiki/Complex_logarithm. The principal branch of the logarithm function $\text{Log}(z):=\text{Log}^{[0]}(z): \mathbb C \smallsetminus \mathbb R_{\leq 0} \to \mathbb C$ is defined as $\text{Log}(z):=\ln|z|+ i \text{Arg}(z)$, where $\text{Arg}(z):=\text{Arg}^{[0]}(z):\mathbb C\smallsetminus \{0\} \to (-\pi,\pi]$ is the principal argument function that returns the unique angle $\theta_z\in (-\pi,\pi]$ so that $z\in \mathbb C\smallsetminus \{0\}$ has that angle, as measured from the positive real axis (e.g. $z=|z|e^{i\theta_z})$.

More generally, we have the branch of the argument function $\text{Arg}^{[\theta_0]}(z):\mathbb C\smallsetminus \{0\} \to (-\pi+\theta_0,\theta_0+\pi]$ is the function that returns the unique angle $\theta_z\in (-\pi+\theta_0,\theta_0+\pi]$ so that $z\in \mathbb C\smallsetminus \{0\}$ has that angle, as measured from the positive real axis (e.g. $z=|z|e^{i\theta_z})$. And that has the corresponding branch of the logarithm $\text{Log}^{[\theta_0]}(z): \mathbb C \smallsetminus e^{i\theta_0}\mathbb R_{\leq 0} \to \mathbb C$ is defined as $\text{Log}^{[\theta_0]}(z):=\ln|z|+ i \text{Arg}^{[\theta_0]}(z)$.

The principal branch of the exponential map with an arbitrary base $b\in \mathbb C \smallsetminus \mathbb R_{\leq 0}$ is defined as $b^z:= e^{\text{Log} (b) \cdot z}:\mathbb C \to \mathbb C$. One can define exponentiation with base $b$ using other branches of the logarithm mentioned above (thus allowing for any base $b$ other than $b=0$), but these different branches do not necessarily agree with each other.

Because of these subtleties, for complex numbers $b,z,w$, it is not generally true that $b^{zw} = (b^z)^w = (b^w)^z$ (so the above proofs don't work anymore). Exponent laws/logarithm laws/formulas become much more subtle when working with complex numbers, to the point where trying to work out exactly what the new correct formula should be is just not useful. See also this answer https://math.stackexchange.com/a/1602274/405572 which discusses similar things, regarding a question about how exponent laws lead to paradoxes for complex numbers.

If you find this curious/interesting, a course in complex analysis (see e.g. Gamelin's textbook on the subject) is the right place to go to explore this further.