I need an equation where I receive a number that when raised to itself equals the input.
Formally: in $x=y^y$ solve for $y$.
Intro to Calculus level knowledge. If the Lambert function is necessary, please explain it to me.
I need an equation where I receive a number that when raised to itself equals the input.
Formally: in $x=y^y$ solve for $y$.
Intro to Calculus level knowledge. If the Lambert function is necessary, please explain it to me.
For sure, the most elegant way corresponds to the use of Lambert function and get $$y=e^{W(\log x)}$$ But, let us suppose that you cannot access this function. The Wikipedia page gives approximation $$W(a)\approx L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}+\frac{L_2(2L_2^2-9L_2+6)}{6L_1^3}+\cdots$$ where $L_1=\log(a)$ and $L_2=\log(L_1)$. This would provide a very good estimate $y_0$. Let us try with $x=10^6$; the above formula would give $W\big(\log(10^6)\big)=1.9483$ and then $y=7.01678$ while the exact value is $y=7.0658$.
Having such an estimate, Newton method could be used. For better conditionning, I suggest to write the equation as $$f(y)=y \log(y)-\log(x)=0$$ $$f'(y)=1+\log(y)$$ and the iterative scheme write $$y_{n+1}=\frac{\log (x)+y_n}{\log (y_n)+1}$$ Starting from $y_0=7.0658$, the successive iterates would be $7.0657967282998769173$, $7.0657967282996206111$, which is the solution for $20$ significant digits
Yes, the Lambert W function will do what you want. Its defining relation is $z = W(z)e^{W(z)}$.
Here is one of many places it is discussed:
http://en.wikipedia.org/wiki/Lambert_W_function
In particular, to solve $x^x = z$, set $x = e^{W(\ln z)}$ or equivalently, $x =\dfrac{\ln z}{W(\ln z)} $.
This is example 2 in the previous link.
$W(x)$ is defined as the inverse of $xe^x$. Therefore, we have to do some manupulations in order to reach the form to apply theW function. $$x=y^y$$ $$\log x=y\log y$$ $$\log x=\log y\cdot e^{\log y}$$ $$W(\log x)=W(\log y \cdot e^{\log y})=\log y$$ $$\log y=W(\log x)$$ $$y=e^{W(\log x)}$$