Can you please show me the method to solving natural logarithm ($\ln$) equations of this type (this is just an example):


(such that $x<0$?)

I mean by this type "natural logarithm with polynomials". I can't seem to solve these no matter what I do. I thought there has to be an "algebraic" method rather than a numerical one.

  • $\begingroup$ Generally, logs do not play nice with polynomials and you have to solve the equation numerically. Some of them can be solved by the Lambert W function. You can search the site for examples. $\endgroup$ – Ross Millikan Dec 23 '17 at 20:55
  • $\begingroup$ Define "this type", please! In this specific example, the solution is $-W(1/e)=-0.278464542761073795109358739022980155439477488619745765453\ldots$, where $W$ is Lambert's function. $\endgroup$ – Professor Vector Dec 23 '17 at 20:59
  • $\begingroup$ I forgot the $.x$ . Does this make it any easier to solve ? $\endgroup$ – Abbkey Dec 23 '17 at 21:08
  • $\begingroup$ Nope. Not really. I'm just trying to find the where this function (which is the equation) is positive and where it's negative, and I needed where it equals 0 to do that. $\endgroup$ – Abbkey Dec 23 '17 at 21:23
  • 2
    $\begingroup$ The question was edited after putting it on hold. Could you please open it again? It is a valuable question for others. $\endgroup$ – IV_ Dec 25 '17 at 12:34

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.



Solution for the first version: $ 1 -x + \ln -x=0 $

Let $y=-x$

$$ 1 -x + \ln -x=0 \implies 1 +y + \ln y =0 \implies \ln y=-1-y$$

that has exactly one solution

$$y ≈ 0.278464542761074...$$

which you can find by numerical method

enter image description here

  • $\begingroup$ Isn't there another way to it ? $\endgroup$ – Abbkey Dec 23 '17 at 20:59
  • $\begingroup$ @Abbkey not in term of elementary functions $\endgroup$ – user Dec 23 '17 at 21:01

An equation $F(x)=c$ ($c$ constant) is related to a function $F$. A function whose function term is composed only of polynomials and logarithms is an elementary function. The elementary functions according to Liouville and Ritt are are those functions which are obtained in a finite number of steps by performing only algebraic operations and/or taking exponentials and/or logarithms (Wikipedia: Elementary function).

To solve a given equation $F(x)=c$ only by transforming it by applying only elementary operations/functions means to apply the compositional inverse $F^{-1}$ of $F$. Ritt, J. F.: Elementary functions and their inverses. Trans. Amer. Math. Soc. 27 (1925) (1) 68-90 says which kinds of elementary functions can have an elementary inverse and which not.

It follows from Ritt's article, because $x$ and $\ln(x)$ are algebraically independent, an algebraic function in dependence of only $x$ and $\ln(x)$ that cannot be reduced to an algebraic function of only one complex argument cannot have an elementary inverse.

But you can try to use Lambert W or one of its generalizations. Lambert W is the multivalued inverse of the elementary function $f$ with $f\colon x\mapsto xe^{x}$. For applying only Lambert W and elementary functions, your equation should be in the form

$$f_1(f_2(x)e^{f_2(x)})=c,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1)$$

where $c$ is a constant and $f_1$ and $f_2$ are elementary functions with a suitable elementary local inverse, or equivalently in the form


Your equation in the question can be brought to that form.

If you have an equation

$$f(g(x)e^{h(x)})=c_1\ \ (c_1\ constant),$$

you can try





where $a,b,d$ are constants. $d$ is the degree of $h(x)$ divided by the degree of $g(x)$. You get an equation system which contains the equations for all powers of $x$. By solving this equation system, you get equation (1) and so $f_{1}(x)$ and $f_{2}(x)$. In equation (1), you set further:

$$f_{2}(x)=W(f_{1}^{-1}(c)),$$ $$x=f_{2}^{-1}(W(f_{1}^{-1}(c))).$$

  • $\begingroup$ Someone should ask in MathStackexchange if there are other very general methods for equation solving with applying Lambert W. Which algorithms are used in the computer algebra systems? $\endgroup$ – IV_ Dec 23 '17 at 23:56
  • $\begingroup$ In fact this method is meaningful in the case of $g$ and $h$ first degree polymomials (with $d=1$). Or maybe, in the case $g(x)=\lambda x^\delta$ and $g(x)=\mu x^\epsilon$ (with $b=0$ and $d=\epsilon/\delta$). Otherwise, in general, one cannot hope to find $a,b,d$ such that ${b\over a}+{d\over a} h$ is the $d$-power of $g$. The corresponding linear system would be overdetermined. $\endgroup$ – Pietro Majer Jun 1 '19 at 17:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.