# Number of solutions of $x+\log\vert x\vert =a$ for $a\in\mathbb{R}$

Let $$a\in\mathbb{R}$$. I'm trying to study the number of solutions of the equation $$x+\log\vert x\vert =a.$$ Plotting the function $$x+\log\vert x\vert$$ I can immediately see (graphically) that if $$a>-1$$ then we have a unique solution, whereas if $$a<-1$$ we have 3 solutions. The case $$a=-1$$ has exactly two solutions. However I've not been able to write this mathematically rigorous. I've been thinking if there is an “easy” way / intuitive way of proving these properties without relying in using wolfram to plot the function. First I thought splitting the cases $$x\geq 0$$ and $$x<0$$ (since we have an absolute value), but I am a little bit lost to be honest. It seems to me that the best option is trying to analyze the image of the function $$f(x):(-\infty,0)\to \mathbb{R}$$ where $$f(x):=x+\log\vert x\vert$$. Then, I would combine this with the fact that the image of the same function defined on $$(0,+\infty)$$ is the whole $$\mathbb{R}$$ and that $$f(x)$$ is strictly increasing there (so for any $$a\in\mathbb{R}$$ there is exactly one solution $$x\in(0,+\infty)$$ in this interval). Does this make sense right? However, I don't know how to exactly calculate what is the image of $$f(x)$$ on $$(-\infty,0)$$. Does anyone has any hint for this?

• If $x>0$ then your function increases monotonically. If $x<0$ then your function goes to $-\infty$ with $x$, reaches a max at $(-1,-1)$ with no other critical points and goes to $-\infty$ as $x\to 0$ from either side. That's enough.
– lulu
Commented Jan 24, 2022 at 15:47

## 1 Answer

For each $$x\ne0$$ let$$f(x)=x+\log|x|=\begin{cases}x+\log x&\text{ if }x>0\\x-\log x&\text{ if }x<0.\end{cases}$$Then $$f$$ is differentiable and$$(\forall x\in\Bbb R\setminus\{0\}):f'(x)=1+\frac1x.$$So, $$f$$ is strictly increasing on $$(-\infty,-1]$$ and on $$(0,\infty)$$ and strictly decreasing on $$[-1,0)$$. Besides, $$f(-1)=-1$$ and, since$$\lim_{x\to0^+}f(x)=-\infty\quad\text{and}\quad\lim_{x\to\infty}f(x)=\infty,$$you have that, for each $$y\in\Bbb R$$, the equation $$f(x)=y$$ has one and only one solution in $$(0,\infty)$$. Since$$\lim_{x\to-\infty}f(x)=\lim_{x\to0^-}f(x)=-\infty$$ and since the maximum of $$f|_{(-\infty,0)}$$ is $$-1$$, attained at $$-1$$, then, for each $$y\in\Bbb R$$, the equation $$f(x)=y$$ has

• no roots in $$(-\infty,0)$$ if $$y>-1$$;
• exactly one root in $$(-\infty,0)$$ if $$y=-1$$;
• exactly two roots in $$(-\infty,0)$$ if $$y<-1$$.