# Solve a logarithmic equation by NSolve

I'm trying to solve:

$$1 - |x| Log(\frac{|1+x|}{|x|}) = 0.84$$

by using NSolve:

NSolve[1 - Abs[x] Log[Abs[(1 + x)/x]] == 0.84, x]


Mathematica doesn't return anything. However other procedures, like FindRoot, gives the desired result:

FindRoot[1 - Abs[x] Log[Abs[(1 + x)/x]] - 0.84, {x, 0.01}]

{x -> 0.0537759}


How can I solve this equation by NSolve?

If you want real solutions, try adding the domain Reals:

NSolve[1 - Abs[x] Log[Abs[(1 + x)/x]] == 0.84, x, Reals]
(*  {{x -> -0.401725}, {x -> -0.0570327}, {x -> 0.0537759}}  *)


Over the Complexes, there are dimension-1 components, which may be why NSolve balks. It probably ought to give an error message, so consider reporting it to WRI.

ContourPlot[
1 - Abs[x] Log[Abs[(1 + x)/x]] == 0.84 /. x -> a + I b //
Evaluate, {a, -1, 1}, {b, -1, 1}]


• Changing Abs to RealAbs also gets the real roots (RealAbs was introduced in V11.1): NSolve[1 - RealAbs[x] Log[RealAbs[(1 + x)/x]] == 0.84, x] Commented Aug 21, 2019 at 13:58

You should give Mathematica a hint, "what" you are looking for:

NSolve[1 - Abs[x] Log[Abs[(1 + x)/x]] == 0.84, x, Reals]
(*{{x -> -0.401725}, {x -> -0.0570327}, {x -> 0.0537759}}*)