When is the absolute value of logarithm equal to the input?

44 Views Asked by At

So does the following equation have any closed form solution(s), or if not, can the solution(s) be expressed as functions of well known math constants (e.g., $\pi,e$)? Also, what is the relevance of the logarithm base $b$.

$$|log_b(x)|=x$$

Motivation: In probabilistic computing frameworks, it is common to use negative log probabilities instead of probabilities due to them having better numerical stability and cause less numerical overflows.

1

There are 1 best solutions below

0
On BEST ANSWER

Useful well-know facts:

  • For any two logarithms $\log$ and $\log_b$, we have: $\log_b(x) = \frac{\log(x)}{\log(b)}$;
  • The equation "$| A| = B$" is equivalent to "$A = B \text{ or } -A = B$";
  • For any logarithm, for all real $x > 0$, we have $\log(x) \leq x - 1$, with equality iff x = 1.

From the first bullet point, you can see that the logarithm's basis is never very relevant. All logarithms are proportional.

From the second bullet point, we see that the absolute values are not much of an obstacle. We'll just have to solve two equations, $\log_b(x) = x$ and $-\log_b(x) = x$. The solutions to your absolute value equation will be exactly all the solutions to any of these two equations.

Solving $\log_b(x) = x$

We know that for all real $x>0$, $\log_b(x) \leq x-1 < x$. Thus there is no real solution.

Solving $-\log_b(x) = x$

If you have a pen and paper, you can easily see that this equation has exactly one real solution, somewhere in the interval $[0, 1]$. Just draw the two graphs $y = -\log(x)$ and $y=x$ and notice that they intersect once.

Alternatively to the drawing, you can prove it with the intermediate value theorem: since $x+\log(x)$ approaches $-\infty$ as $x$ approaches 0, and $x+\log(x)$ is 1 when $x$ is 1, then there must be a point somewhere inbetween where $x+\log(x)=0$; and since $x+\log(x)$ is strictly increasing, this point must be unique.

Now let's work on the equation a bit, and rewrite it with exponentials instead of logarithms: \begin{align*} -\log_b(x) & = x \\ b^{- \log_b(x)} & = b^x \\ (b^{\log_b(x)})^{-1} & = b^x \\ x^{-1} & = b^x \\ 1 & = xb^x \\ \end{align*}

And I'm going to stop there. This equation has garnished sufficiently interest that at least for $b=e$, the solution has a name. There is no closed-form solution but the solution is written $W(1) \approx 0.5671$, and $W$ is called the Lambert W function or the product log function.