I was playing around with $$(x-1)^x = x^{(x-1)}$$ Which is equivalent to $$x^x = (x-1)^x.x$$
And, it seems this has one solution $x \approx 3.29317$
What is this number and how would one go about solving this?
I was playing around with $$(x-1)^x = x^{(x-1)}$$ Which is equivalent to $$x^x = (x-1)^x.x$$
And, it seems this has one solution $x \approx 3.29317$
What is this number and how would one go about solving this?
On
Consider that you look for the zero of function $$f(x)=(x-1)^x - x^{(x-1)}$$ Since I suppose that you did plot it, it is quite poorly conditioned : it varies very fast, shows a local maximum and a local minimum. All of that is not very good for numerical solvers which require a reasonable starting guess.
Consider instead the function $$g(x)=x\log(x-1)-(x-1)\log(x)$$ which is very smooth (plot it); its first derivative is always positive and its second derivative always negative. Notice that $$g(e)=1-e+e \log (e-1) <0 \qquad \text{and} \qquad g(e+1)=1+e-e \log (e+1)>0$$ So, the solution is bracketed $e < x <e+1$.
Now, if we do not want to have a more narrow interval, by Darboux theorem, starting iterations at $x=e$ ensures no overshoot of the solution if we use Newton method. $$\left( \begin{array}{cc} n & x_n \\ 0 & 2.718282 \\ 1 & 3.220761 \\ 2 & 3.292114 \\ 3 & 3.293166 \end{array} \right)$$
$$(x-1)^x = x^{x-1}$$
$$\implies x \ln(x-1) = (x-1)\ln(x)$$ $$\implies -\frac{\ln(x-1)}{x-1} = -\frac{\ln(x)}{x}$$
$$\implies \frac{\ln(\frac{1}{x-1})}{x-1} = \frac{\ln(\frac{1}{x})}{x}$$
$$\implies \ln(\frac{1}{x-1})e^{\ln(\frac{1}{x-1})} = \ln(\frac{1}{x})e^{\ln(\frac{1}{x})}$$
Now, in theory, applying the Lambert-W function to both sides would give you that $\frac{1}{x} = \frac{1}{x-1}$. Now, this is obviously untrue. So how do we reconcile this?
Well, if $x$ and $x-1$ are greater than zero, then each of $\ln(\frac{1}{x})$ and $\ln(\frac{1}{x-1})$ are both less than zero. FURTHER, looking at the numerical value for the intersection of the graphs, it seems clear that $x > e \implies \ln(\frac{1}{x}) < -1$ and $x-1 < e \implies \ln(\frac{1}{x-1}) > -1$, which means that trying to get $\ln(\frac{1}{x-1}) = \ln(\frac{1}{x})$ would necessitate applying two different branches of the Lambert-W function (ie it wouldn't do the same thing to both sides).
Now, there IS a way to calculate this to arbitrary precision, and it isn't even THAT painful:
$$\ln(\frac{1}{x-1}) = W_0\left(\ln(\frac{1}{x})e^{\ln(\frac{1}{x})}\right)$$
$$ 0 = e^{-W_0\left(\ln(\frac{1}{x})e^{\ln(\frac{1}{x})}\right)}+1-x$$
Now, "all" you have to do is to do Newton's method on this. It should converge if you start close enough to the solution. It's NOT fun and should definitely be done by a computer, but it's technically possible!
(You probably don't want to do this)
EDIT: This setup also helps explain the narrow range in which you can find solutions. If $x > e + 1$ or $x < e$, then the above equation would simplify to $\frac{1}{x} = \frac{1}{x-1}$, because then both $\ln(\frac{1}{x})$ and $\ln(\frac{1}{x-1})$ would end up on the same branch of the Lambert-W function, and so there wouldn't be a solution.