How would I go about solving equations of this form:

$$ x^x = n $$

for values of n that do not have obvious solutions through factoring, such as $27$ ($3^3$) or $256$ ($4^4$).

For instance, how would I solve for x in this equation: $$x^x = 7$$

I am a high school student, and I haven't exactly ventured into "higher mathematics." My first thought to approaching this equation was to convert it into a logarithmic form and go from there, but this didn't yield anything useful in the end.

My apologies if this question has been asked and answered already; I haven't been able to find a concrete answer on the matter.

  • $\begingroup$ In general, there won't be a nice closed form solution. Would you settle for a numerical approximation? $\endgroup$ – Oliver Oct 19 '13 at 17:48
  • $\begingroup$ What do you mean by "nice closed form solution?" Also, how would one arrive at a numerical approximation? $\endgroup$ – John Oct 19 '13 at 17:52
  • $\begingroup$ I presume you are looking after integer solutions; otherwise the task is trivial (up to numerical computations). $\endgroup$ – Michael Hoppe Oct 19 '13 at 17:55

Equations like $x^x=7$ often don't have ''nice'' solutions. Whenever you see something like $x^x$, something that you should think about is the Lambert W function. This is the function $W(x)$, implicitly defined by $z=W(z)e^{W(z)}$.

In your case, taking natural logs gives $x \log x=\log 7$. So $e^{\log x} \log x=\log 7$, so $\log x=W(\log 7)$, and finally $x=e^{W(\log 7)}$. The Lambert W function has many different branches, which is something sort of akin to the fact that when you take a square root you can choose either the positive or negative square root. This means that there isn't a unique solution to your equation. You can get some families of solutions using Wolfram Alpha: http://www.wolframalpha.com/input/?i=x%5Ex%3D7.


you can solve it using newton's method

$$ f(x) = x^x - 7 = 0 \Rightarrow f'(x) = x^x(\ln x+ 1) $$

now choose $ x_0 $ and let it be $ x_0 = 2 $

and use the formula $$ x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} = x_n - \frac{x_n^{x_n} - 7}{x_n^{x_n}(\ln x_n + 1) }$$

now just evaluate $ x_1 $ by using $ x_0 $ then $ x_2 $ then $x_3 \cdots $ by a calculator and you'll find an approximation

$$ x_1 \approx 2.442962082 $$

$$ x_2 \approx 2.331852211 $$

$$ x_3 \approx 2.316698614 $$

$$ x_4 \approx 2.31645502 $$

$$ x_5 \approx 2.316454959 $$

$$ x_6 \approx x_5 $$

$$ x_7 \approx x_6 $$

$$ x \approx 2.316454959 $$



  • $\begingroup$ thanks upvoter i'm now 1,007 !! $\endgroup$ – what'sup Oct 19 '13 at 18:03
  • 1
    $\begingroup$ Thank you for providing an answer on getting an approximation. Although an approximation, this seems really intuitive. $\endgroup$ – John Oct 19 '13 at 18:05
  • $\begingroup$ you're very welcome @John . $\endgroup$ – what'sup Oct 19 '13 at 18:06

You cannot express the solution of this equation in elementary functions. However, you can express the solution in terms of the Lambert $W$ function: http://en.wikipedia.org/wiki/Lambert_W_function . The $W$-function is defined by: $x = W(x)\cdot e^{W(x)}$.

Let $y = \ln x$. Write your equation as $e^{x \ln x} = n$, or equivalently $x \ln x = \ln n$, or $y e^y = \ln n$. Then $y = W(\ln n)$ and $x = e^y = e^{W(\ln n)}$.


The solution involves a function called Lambert's W-function. There is a Wikipedia page on it.
As Oliver says, it is not a nice neat form. It is an entirely new function. Its definition is $$ye^y=z, W(z)=y$$
Can you use logs to turn $x^x=n$ into $ye^y=f(n)$, for $y$ equal to some function of $x$?


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.