2
$\begingroup$

I'm interested in deriving the solution for $y$ in terms of $x$ given $x^y = y^x$ using the Lambert $W$ function. Wolfram Alpha states:

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

So far I have done the following:

\begin{align*} x^y & = y^x\\ y \log(x) & = x \log(y)\\ \log(y)/y & = \log(x)/x\\ \log(y)/y & = \alpha && (\alpha=\log(x)/x) \end{align*}

The rest of it is proving the solution for $y$ in the last equation is $y = - W(-\alpha)/\alpha$. I can easily verify the solution but I'm unsure how to derive it.

Thanks in advance.

$\endgroup$
4
$\begingroup$

Starting from $$ \frac{\ln x}{x}=\frac{\ln y}{y} $$ let $y =\mathrm{e}^{-u}$ we find $$ u\mathrm{e}^{u} = -\frac{\ln x}{x} $$ taking the lambert we find $$ u = W\left(-\frac{\ln x}{x}\right) $$ remember $u=-\ln y = -\frac{y}{x}\ln x$ so we get $$ -\frac{y}{x}\ln x = W\left(-\frac{\ln x}{x}\right) \implies y = \frac{-xW\left(-\frac{\ln x}{x}\right)}{\ln x} $$

$\endgroup$
  • $\begingroup$ This is awesome. Exactly what I was looking for. Thanks. $\endgroup$ – David Etler May 21 '15 at 15:28
  • $\begingroup$ How can I get $y=-4$ from $x=-2$ here? $\endgroup$ – user286485 Apr 13 '18 at 16:38
  • $\begingroup$ @user286485 You can't, because this solution is only about positive numbers $\endgroup$ – Юрій Ярош Jul 24 '18 at 20:07
4
$\begingroup$

You do not need to apply logarythm on both sides. $$ x^y=y^x\\ e^{y\ln x}y^{-x}=1\\ e^{\frac{y\ln x}{-x}}y=1\\ e^{\frac{y\ln x}{-x}}\frac{y\ln x}{-x}=\frac{\ln x}{-x}\\ \frac{y\ln x}{-x}=W\left({\frac{\ln x}{-x}}\right)\\ y=\frac{-xW\left({\frac{\ln x}{-x}}\right)}{\ln x} $$

$\endgroup$
  • $\begingroup$ like buses none and then 3 or in 2 in this case ..kudos +1 $\endgroup$ – Chinny84 May 21 '15 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.