How do you solve for $x$ in the following equation:
$$ \frac{x}{y^\frac{x}{y}} = 1 $$
By graphing it, I know there are two real solutions. I tried doing it in the following way:
$$ x = y^\frac{x}{y} \\ \ln x = \ln y^\frac{x}{y} \\ \ln x = \frac{x}{y} \ln y \\ \frac{\ln x}{x} = \frac{\ln y}{y} \\ \int \frac{\ln x}{x} dx = \int \frac{\ln y}{y} dy \\ \frac{\ln^2 x}{2} = \frac{\ln^2 y}{2} \\ \ln^2 x = \ln^2 y \\ \ln x = \pm \sqrt{\ln^2 y} \\ x = e^{\pm \sqrt{\ln^2 y}} $$
But this is only half correct, with the positive sign, where we obtain $x = y$. The negative sign is incorrect. Where did I go wrong? I do realize I left out the $+ C$ when taking the integral, but is that why? I put this into Wolfram Alpha and the other solution is in terms of the Lambert W function. I must admit I have never worked with the Lambert W function before. I've been doing a bit of research on it and trying to understand it. Can anyone explain it to me? As in, how do you get the Lambert W function from the equation above? Also, I read on Wikipedia that the Lambert W function cannot be expressed in terms of elementary functions. So, how do you compute its actual value? Is there a table somewhere? What I'm more interested in is the difference between the two solutions for $x$ for a fixed $y$. Any feedback would greatly be appreciated!
Recall the definition of Lambert W ... $ue^u = v \Longleftrightarrow u=W(v)$. In this case: \begin{align} \frac{x}{y^{x/y}} &= 1 \\ x &= y^{x/y} \\ x &= \exp \left(\frac{x}{y}\ln y\right) \\ -\frac{x}{y}\ln y &= \exp \left(\frac{x}{y}\ln y\right)\frac{-\ln y}{y} \\ -\frac{x}{y}\ln y \exp \left(-\frac{x}{y}\ln y\right)&= \frac{-\ln y}{y} \\ -\frac{x}{y}\ln y &= W\left(\frac{-\ln y}{y}\right) \\ x &= -\frac{y}{\ln y}W\left(\frac{-\ln y}{y}\right) \end{align}
Here are the real graphs: $W_0$ (blue) and $W_{-1}$ (red)
Example: For $y=2$, we have $$ x = -\frac{2}{\ln 2}W_0\left(\frac{-\ln 2}{2}\right) = 2 $$ or $$ x = -\frac{2}{\ln 2}W_{-1}\left(\frac{-\ln 2}{2}\right) = 4 $$ I got these numerically from Maple. But the two real values $u=W(v)$ are the two solutions of $ue^u = v$. So write $$ x=-\frac{2}{\ln 2}W\left(\frac{-\ln 2}{2}\right) \\ \Longleftrightarrow\quad x\exp\left(-\frac{x \ln 2}{2}\right)=1 $$ Two solutions of this are $x=2$ and $x=4$, easily checked.