Background: I was trying to estimate the size of $21^{21}$ for some problem and decided to use $20^{22}$ as hopefully a rough approximate ($20^{22} = 2^{22} \cdot 10^{22} \approx 10^{28}$). But then I wanted to see if that was over or underestimate and got into this rabbithole of when they are equal.
Anyways, I was doing some thinking and wanted to get an analytical solution to when $x^x = (x-1)^{x+1}$. My original question was which was bigger for $x=21$, but transitioned when I noticed that the $x^x > (x-1)^{x+1}$ for small $x$, and then it flips when I go from $x=4$ to $x=5$. I threw it in Desmos and got an approximate value of 4.141 (and I went woahhh that's $\pi +1$ but unfortunately that's only true to a couple decimal places :( ). Can anyone help me find an analytical or algebraic (as opposed to numerical/approximate) way of finding the value for x when these two expressions are equal?
I was trying to approach it in a similar way to when $a^b$ grows faster than $b^a$ using logarithms but was struggling and would love some help if anyone has any suggestions. There is also this post which is similar but only talks about the inequality whereas I am more concerned about the equality.
EDIT
I found this paper which connects the $x$ value of the solution to the original equation to be equal to $\alpha_0$ where $1+\frac{1}{(1+\frac{1}{(1+\frac{1}{...})^{\alpha}})^{\alpha}}$ converges for all $0 < \alpha < \alpha_0$ and diverges for all $\alpha > \alpha_0$. Very interesting stuff.
PS: I have an interesting follow up for $x^x$ vs $(x-n)^{x+n}$ that I would like to ask about but maybe some insight on this question will allow me to explore the following on my own :) Thanks!

