Solving $m^{(m/2)} = 2^n$ for $m$

51 Views Asked by At

I'm trying to solve $m^{m/2}=2^n$ for $m$. Solving for $n$ is straightforward, but I want to get $m$ as a function of $n$.

I was pretty surprised that I couldn't figure that out. Tried to solve by taking $log$ on both sides, but I always get into a loop with a $log$ with either $m$ as a basis or the value.

Thanks!

4

There are 4 best solutions below

0
On BEST ANSWER

We have

$$m^{\frac m 2}=2^n\iff m^m=2^{2n}$$

but $m$ can't be obtained by elementary functions but by Lambert W function

$$m = \frac{\operatorname{ln} (2^{2n})}{\mathrm W \bigl(\operatorname{ln} (2^{2n})\bigr)}$$

0
On

Nope - you can't do it.

To solve this kind of problem, the Lambert-W function was created. This solves $y = xe^x$ for $x$.

See here.

0
On

Square the equation and then take logarithms \begin{eqnarray*} m^m=2^{2n} \\ m \ln m =2n \ln 2 \end{eqnarray*} Substitute $m=e^M$ \begin{eqnarray*} M e^M =2n \ln 2 \\ \end{eqnarray*} Now use the Lambert $W$ function \begin{eqnarray*} M =W(2n \ln 2) \\ m =e^{W(2n \ln 2)}. \\ \end{eqnarray*}

0
On

If you cannot use Lambert function, only numerical methods could be used.

Take logarithms and consider that you look for the zero of function $$f(m)=m\log(m)-2n \log(2)$$ $$f'(m)=1+\log(m)\qquad \text{and} \qquad f''(m)=\frac 1m$$ For $m \geq 1$, we have an increasing function and there is only one root to the equation.

The simplest would be to use Newton method which, starting from an estimate $m_0$, will give the iterates $$m_{k+1}=\frac{m_k+2n \log (2)}{\log (m_k)+1}$$ If $n$ is large, a "reasonable" guess could be $m_0=\frac {2n \log(2)}{\log(2n\log(2))}$. Let us try for $n=1234$ and get the following iterates $$\left( \begin{array}{cc} k & m_k \\ 0 & 229.7874494 \\ 1 & 301.4491288 \\ 2 & 299.9338145 \\ 3 & 299.9332454 \end{array} \right)$$ which is the solution for ten significant figures.