I stumbled on the following limit in a calculus textbook today:
\begin{equation*} \lim_{x\rightarrow 0}\frac{\ln(x)}{\cot(x)} \end{equation*}
According to the book's solutions and Mathematica, this limit exists and is equal to 0. I can see why $0$ is obtained using l'Hôpital's rule twice:
\begin{equation*} ...=\lim_{x\rightarrow0}\frac{\left(\frac{1}{x}\right)}{-\csc^2(x)}=-\lim_{x\rightarrow0}\frac{\sin^2(x)}{x}=-\lim_{x\rightarrow0}\frac{2\sin(x)\cos(x)}{1}=2\sin(0)\cos(0)=0 \end{equation*}
If I recall correctly, l'Hôpital's rule is applicable when we have: \begin{equation*} \lim_{x\rightarrow a}\frac{f(x)}{g(x)} \end{equation*} even if $f$ and $g$ are not derivable at precisely $a$, so there should be no issue in using it on the above limit.
However, I can't reconcile the fact that $\ln(x)$ is defined over $]0,+\infty[$ (and usually, only $\lim_{x\rightarrow0^+}\ln(x)$ exists) with the fact that the above limit exists (both as $x\rightarrow0^+$ and as $x\rightarrow0^{-}$).
It seems to me that only
\begin{equation*} \lim_{x\rightarrow 0^+}\frac{\ln(x)}{\cot(x)} \end{equation*}
should exist and thus the "bilateral limit" (with $x\rightarrow 0$) does not exist since the limit with $x\rightarrow0^-$ doesn't.
Is there something I am missing?
Yes you are right, since $\ln x$ is defined for $x>0$ the limit for $x\to 0^-$ is meaningless and only
$$\begin{equation*} \lim_{x\rightarrow 0^+}\frac{\ln x }{\cot x } \end{equation*}$$
can be considered.
Note that this doesn't mean in general that the limit considered exists.
For example
\begin{equation*} \lim_{x\rightarrow 0^+}\frac{\ln x }{\sin \frac1x} \end{equation*}
can be considered but does not exist.