16

It's not too difficult to figure out that $x$ and $y$ can both be 1, and also $x$ can be 2 and $y$ can be 4 (and vice versa). But I can't rule out if there are other solutions. Does it have anything to do with inverse functions? Is there a way to see the solutions by graphing, or algebraically?

yroc
  • 1,075

5 Answers5

36

Here's a good way to look at this: $$ x^y = y^x \implies \\ y \ln x = x \ln y \implies\\ \frac{\ln x}x = \frac{\ln y}y $$ So one way of solving this is looking at the graph of $y = \frac{\ln x}{x}$ and seeing where it hits a particular value twice.

However, I'm going to go a step further. I will say that I want my solution $(x,y)$ of $x^y = y^x$ to be of the form $(x,ax)$ so that $y = ax$ for some value $a$. Furthermore, I'll assume that $x \neq y$ so that $a \neq 1$ (of course, $x = y$ is always a solution if $x^x$ is defined). With that, we have $$ \frac{\ln x}x = \frac{\ln (ax)}{ax} \implies (\text{assume } x\neq 0)\\ \ln x = \frac{\ln (ax)}{a} \implies\\ \ln x = \frac{\ln (a)}{a} + \frac{\ln x}{a} \implies\\ \frac{a-1}{a}\ln x = \frac {\ln(a)}{a} \implies (\text{we assumed }a \neq 1)\\ \ln x = \frac{\ln(a)}{a-1} \implies\\ x = a^{\frac{1}{a-1}} $$ So, for any value $a \neq 1$, the pair $x = a^{1/(a-1)},$ $y = a \cdot a^{1/(a-1)} = a^{a/(a-1)}$ will give you a solution to the original equation.

For example, plugging in $a = 2$ gives you $x=2$ and $y = 4$. Try some other values.

Ben Grossmann
  • 225,327
  • Hm, parametrics, didn't think of that one! – Simply Beautiful Art Dec 19 '16 at 01:32
  • Hehehe, since you did parametrics, I did polar. ;D – Simply Beautiful Art Dec 22 '16 at 13:55
  • 2
    I should mention that the solution I gave is one I had seen here a long while back. Even used the same letter $a$. – Ben Grossmann Apr 25 '17 at 12:21
  • @Omnomnomnom There exists a question in your solution. When you let $y=ax$, you have assumed that $y$ is a linear function with respect of $x$. But how you know this? Why the function, or the relation between $y$ and $x$ can't be of another case? – mengdie1982 Jun 07 '18 at 03:31
  • @mengdie1982 It's been a while since you asked, but here's an answer. I am not assuming that "$y$ is a linear function with respect of $x$"; indeed, the relation $y = ax$ that I use here is not linear since $a$ depends on $x$ (and/or on $y$, depending on your perspective). The more accurate way to describe what I've done is to say that I've made a "change of variables". That is, instead of describing the curve as a relation on $x,y$, I'm describing it as a relation on $a,b$ where $$ \begin{cases} a = y/x,\ b = x. \end{cases} $$ This is similar to changing to polar coordinates. – Ben Grossmann May 27 '20 at 16:38
8

There is an explicit solution to this equation given by $$y = -\dfrac{x \operatorname{W}\left(-\dfrac{\log(x)}{x}\right)}{\log(x)}$$

where $\operatorname{W}(x)$ is the Lambert W-function.

Consider: $$x^y = y^x$$

Take the logarithm of both sides

$$y\log(x) = x\log(y)$$

$$\dfrac{y\log(x)}{x} = \log(y)$$

Multiply by $-1$ and exponentiate

$$\exp\left(-\dfrac{y\log(x)}{x}\right) = \dfrac{1}{y}$$

Multiply each side by $-\dfrac{y\log(x)}{x}.$

$$-\dfrac{y\log(x)}{x}\exp\left(-\dfrac{y\log(x)}{x}\right) = -\dfrac{\log(x)}{x}$$

Solve using the properties of the $\operatorname{W}$ function.

$$-\dfrac{y\log(x)}{x} = \operatorname{W}\left(-\dfrac{\log(x)}{x}\right)$$

$$y = -\dfrac{x \operatorname{W}\left(-\dfrac{\log(x)}{x}\right)}{\log(x)}$$

DMcMor
  • 9,407
Brad
  • 5,156
  • 2
  • 19
  • 50
  • 2
    Wow good answer but a little beyond high school level$\ldots$ Is there a way by graphing? – yroc May 13 '14 at 22:16
  • Are you looking for solutions by way of a graphing calculator? – Brad May 13 '14 at 22:27
  • Well, graphing in general, but yes would be graphing with trusty TI-84 or Mathematica – yroc May 13 '14 at 22:29
  • 2
    An iterative method comes to mind quicker than anything that has to do with graphing. The best way to find solutions graphically is to pick a value of $y$ that you want a solution for and then plot $x^y - y^x$ looking for when the graph hits the $x$-axis. There is no way (that I know of) to graphically find all of the solutions at once on a Ti-84. – Brad May 13 '14 at 22:40
  • That's a good idea! Thanks! – yroc May 13 '14 at 22:42
  • 2
    I feel like saying the W Lambert function solves it is almost a tautology. I've never been satisfied with such solutions. It's almost like saying "the solution is the solution!" from my perspective. – Cameron Williams May 13 '14 at 23:03
  • I feel similarly about graphical solutions. In my mind, the best way to solve this equation would be to implement the W function on the Ti-84 and write a program to solve it. That or any other iterative method. – Brad May 13 '14 at 23:22
  • 2
    @CameronWilliams If your area of expertise led you to use and understand the Lambert W-function regularly, you would probably be quite satisfied with it. Same goes for much of mathematics: if you're an algebraist, then a topological solution to your problem will probably feel unsatisfactory, whereas if you're a topologist it's great. – zibadawa timmy Jul 04 '15 at 02:25
  • @zibadawatimmy I understand it well enough but a common theme on this site is people presenting special functions as solutions to equations without being a bit more honest about their genesis. It is a bit tautological but the Lambert W function has really nice properties and it is quite interesting. – Cameron Williams Jul 04 '15 at 03:11
7

If we convert everything to polar form, we end up with

$$(r\cos\theta)^{r\sin\theta}=(r\sin\theta)^{r\cos\theta}$$

Take the $r$th root of both sides and you'll get

$$(r\cos\theta)^{\sin\theta}=(r\sin\theta)^{\cos\theta}$$

$$r^{\sin\theta}(\cos\theta)^{\sin\theta}=r^{\cos\theta}(\sin\theta)^{\cos\theta}$$

$$r^{\sin\theta-\cos\theta}=\frac{(\sin\theta)^{\cos\theta}}{(\cos\theta)^{\sin\theta}}$$

$$r=\left(\frac{(\sin\theta)^{\cos\theta}}{(\cos\theta)^{\sin\theta}}\right)^{1/(\sin\theta-\cos\theta)}$$

which is the curve you are interested in. A graph may be found here.

Plugging in $\theta=\arctan(0.5)$ will yield the rectangular coordinate $(4,2)$.

1

Hint:

Algebra says that after taking $\ln$ both sides,

$$y\ln(x) =x\ln(y) $$

This implies $\ln(x) /x=\ln(y) /y$

What can you say about the function $x\to \ln(x)/x $?

Gabriel Romon
  • 35,428
  • 5
  • 65
  • 157
1

For finding solutions by graphing, take the logarithm of both sides of the equation to get $y\cdot\log(x)=x\cdot\log(y)$. Assuming $x$ and $y$ are not zero, divide by them and get $\frac{\log(x)}{x}=\frac{\log(y)}{y}$ and consider the map $f:(0,\infty)\rightarrow \mathbb{R}, x\mapsto \frac{\log(x)}{x}$. Now your question is equivalent to finding values $x,y$ with $f(x)=f(y)$.