How do you solve an equation with the variable as the base and as the exponent, such as $x^{2x}=10$?I tried working it out using logarithms,roots and calculus and nothing worked.Or more general $x^{nx}= y$?
4 Answers
The solution can't be found in terms of elementary functions. The solution of the equation $$x^{nx}=y$$ can be written as: $$x=\dfrac{1}{n}\dfrac{\ln(y)}{LambertW\left(\dfrac{\ln(y)}{n}\right)}$$ The function $LambertW(z)$ or better $W(z)$ has the following expansion: $$W(z)=\sum_{k=1}^\infty\dfrac{(-k)^{k-1}}{k!}z^k$$
- 10,746
-
This is correct; $x \approx 1.85816$. The amazing thing is that Mathematica does find this answer (although it calls LambertW ProductLog). – Mark Fischler Jul 07 '16 at 16:06
There isn't really a nice solution except if you accept lambert W as one.
$$x^{nx}=y$$
And for $y > 0$:
$$\ln(x^{nx})=\ln (y)$$
$$nx \ln (x)=\ln (y)$$
$$x \ln (x)=\frac{\ln (y)}{n}$$
$$e^{\ln (x)} \ln (x)=\frac{\ln (y)}{n}$$
$$\ln (x)=W(\frac{\ln (y)}{n})$$
$$x=e^{W(\frac{\ln (y)}{n})}$$
But $W(x)e^{W(x)}=x$ means $e^{W(x)}=\frac{x}{W(x)}$ so:
$$x=\frac{\frac{\ln (y)}{n}}{W(\frac{\ln (y)}{n})}$$
Numerical approximations can be found by newtons method.
- 19,199
-
1+1 In this answer, Newton's method for computing Lambert W is detailed for both principal and non-principal real branches. – robjohn Jul 07 '16 at 16:29
It is not possible to solve the equation algrbraically. That means that you cannot solve the equation with using only using "common" relations and functions (square root, cosine, etc).
First option:
You can apply an approximation method to solve the equation, for instance the Newton-Raphson method. If you use this method you need the derivative. The derivative of $y(x)=x^{nx}$ is
$y'(x)=nx\cdot x^{nx}\cdot (log x+1)$
Second option:
You can use an the Lambert $W$ function.
The solution for $x^{nx}=\left(x^x\right)^n=y$ is
$\Large{x=e^{{W\left(\frac{ln(y)}{n}\right)}}}$
- 31,012
If you cannot use Lambert function, as already said in answers and comments, only numerical methods could be used.
Supposing that you look for the zero of $$f(x)=x^{ax}-b$$ I thing that solving the problem for $$g(x)=ax\log(x)-\log(b)$$ could be better since function $g(x)$ increases more slowly than $f(x)$. In such a case, Newton iterates would just be $$x_{n+1}=\frac{a x_n+\log (b)}{a (1+\log (x_n))}$$ For illustration purposes, let us use $a=\pi$ and $b=123456789$ and let us start iterating at $x_0=1$; the successive iterates will then be $$\left( \begin{array}{cc} n & x_n \\ 1 & 6.93055937563341832 \\ 2 & 4.38057877158002436 \\ 3 & 4.16244866627278281 \\ 4 & 4.16017204007969000 \\ 5 & 4.16017178335219682 \\ 6 & 4.16017178335219356 \end{array} \right)$$ which seems to be quite fast.
For sure, we could have generated a much better starting point using, as an approximation, $$W(z)=L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}+\cdots$$ given in the Wikipedia page; this uses $L_1=\log(z)$ and $ L_2=\log(L_1)$.
Applied to the example, this would give $x_0\approx 4.24253$ and very few iterations would be required.
- 289,558