# Solving the exponential equation $x^2 = e^{-mx}\cdot k$

I just had this problem come up at work, as part of a simulation where I had to solve the equation mentioned above (where $m$ and $k$ are constants). I googled solving exponential equations and I got so far as realizing that I need to log both sides of the equation resulting in:

$$2\ln x = -mx + \ln k$$

The above form of the equation seems more intractable than the first and am at a loss regarding how to proceed. Can someone please give me a hint as to the way forward?

When you have exponential and linear or quadratic function in same equation, you must use Lambert-$\operatorname{W}$ function which is defined as inverse function of $f(x)=e^xx$. $$2\ln x=-mx+\ln k$$ $$x^2=e^{-mx}k$$ $$e^{-mx}k=x^2$$ $$e^{-mx}x^{-2}=\dfrac1k$$ $$e^{\dfrac{mx}2}x=\sqrt k$$ $$e^{\dfrac{mx}2}\dfrac{mx}2=\dfrac{m\sqrt k}2$$ $$\dfrac{mx}2=\operatorname{W}_k\left(\dfrac{m\sqrt k}2\right),k\in\mathbb{Z}$$ $$x=\dfrac{2\operatorname{W}_k\left(\dfrac{m\sqrt k}2\right)}{m}$$

• Why the subscript on the Lambert W function? (And you may want to add a link to explain the function more than you did.) – Rory Daulton Dec 29 '14 at 18:46

You can assume $k>0$ as the equation, for $k<0$, has no solution and it is trivial for $k=0$.

Set $x=t\sqrt{k}$ and $q=m\sqrt{k}$. Then the equation becomes $$t^2=e^{-qt}$$ We may also assume $q>0$ (that is, $m>0$), because otherwise just changing $t$ into $-t$ would bring us into the same form. The case $m=0$ is again trivial.

Taking logarithms, the equation becomes $2\log|t|=-qt$, so we can consider the function $$f(t)=2\log|t|+qt.$$ Note that $t=0$ is not a solution of the equation $t^2=e^{-qt}$, so discarding it from the domain of $f$ is not a problem.

We have: $$\lim_{t\to-\infty}f(t)=-\infty, \qquad \lim_{t\to0}f(t)=-\infty, \qquad \lim_{t\to\infty}f(t)=\infty.$$ Let's consider $$f'(t)=\frac{2}{t}+q=\frac{2+qt}{t}$$ that is positive for $t<-q/2$ or $t>0$. Because of the limits computed above, we see that a solution always exist in the interval $(0,\infty)$.

In order to find possible negative solutions, we need to see whether the maximum of $f$ in the interval $(-\infty,0)$, which is attained at $-2/q$, is positive. Now $$f(-2/q)=2\log\frac{2}{q}-2=2\log\frac{2}{qe}$$ which is positive for $2>qe$, that is, $0<q<2/e$.

Thus the equation has

• three solutions for $0<q<2/e$ (two negative, one positive),
• two solutions for $q=2/e$ (one negative, $-2/q$, one positive)
• one solution for $q>2/e$ (positive).