Algebraic solution to natural logarithm equations like $1-x+x\ln(-x)=0$

If you are after a solution in terms of known functions, though not necessarily elementary functions, your equation can be solved in terms of the Lambert W function.

In order to do this we need to rewrite your equation so that it is exactly in the form for the defining equation of the Lambert W function, namely $$\text{W}(x) e^{\text{W}(x)} = x.$$ Here $\text{W}(x)$ denotes the Lambert W function.

From $$1 - x + x \ln (-x) = 0, \quad x < 0,$$ rearranging gives $$\ln (-x) = 1 - \frac{1}{x}.$$ After taking the exponential of both sides and rearranging we are left with $$-\frac{1}{x} \exp \left (-\frac{1}{x} \right ) = \frac{1}{e}.$$ Solving in terms of $x$ yields $$x = -\frac{1}{\text{W}_0 (1/e)}.$$ Note only the principal branch for the Lambert W function is selected since its argument is positive.

Numerically, as $\text{W}_0 (1/e) = 0.278\,464\,542\ldots$ we have $$x = -3.591\,121\,476\ldots$$


If you cannot use Lambert function and do not want numerical methods, you can use function approximation to get a "reasonable" estimate of the solution.

Since $x=-e$ seems to be interesting because of the logarithm, let us use Padé approximants built around this value. To make life simple, let us use degree $1$ for the numerator and degree $n$ for the denominator. This means that, by the end, we just need to solve $$a^{(n)}_0+a^{(n)}_1 (x_{(n)}-e)=0$$

I produced below the expressions for a few values of $n$ and their numerical approximations $$\left( \begin{array}{ccc} n & x_{(n)} & x_{(n)}\approx \\ 1 & \frac{-3 e-2 e^2}{1+2 e} & -3.56292 \\ 2 & \frac{-4 e-24 e^2-12 e^3}{-2+12 e+12 e^2} & -3.59832 \\ 3 & \frac{6 e-66 e^2-180 e^3-72 e^4}{6-6 e+108 e^2+72 e^3} & -3.58922 \\ 4 & \frac{-24 e+60 e^2-1260 e^3-2160 e^4-720 e^5}{-36+180 e^2+1440 e^3+720 e^4} & -3.59164 \\ 5 & \frac{360 e-240 e^2-2700 e^3-61200 e^4-75600 e^5-21600 e^6}{720+240 e-2700 e^2+18000 e^3+54000 e^4+21600 e^5} & -3.59098 \end{array} \right)$$


To solve the equation $$1 - x + x \ln(-x) = 0, \tag1$$

for $x < 0,$ you can set $z = -\frac 1x,$ so $x = -\frac 1z$ and $\ln(-x) = \ln\left(\frac 1z\right) = -\ln(z).$ Then Equation $(1)$ is equivalent to $$1 + \frac 1z + \frac 1z \ln(z) = 0,$$ and since $z > 0$ this is equivalent to $$z + 1 + \ln(z) = 0,$$ that is, $$ \ln(z) = -1 - z. \tag2$$

Note that the Lambert $W$ function is defined such that $\ln(W(u)) = \ln(u) - W(u)$ for $u > 0;$ if we set $u = e^{-1}$ we have $$\ln\left(W\left(e^{-1}\right)\right) = \ln\left(e^{-1}\right) - W\left(e^{-1}\right) = -1 - W\left(e^{-1}\right),$$ so $z = W\left(e^{-1}\right)$ is a solution of Equation $(2),$ and $x = -\frac{1}{W\left(e^{-1}\right)}$ is a solution of Equation $(1).$

The Lambert $W$ function is not usually considered "elementary," and a more general formula involving logarithms and polynomials would not necessarily be solvable in terms of the Lambert $W$ function and elementary functions. The answer to your question in general is to use numeric methods.

Tags:

Logarithms