TITLE: Does the limit $\lim_{x\to a^+}\frac{\cos{x}\ln(x-a)}{\ln(e^x-e^a)} $ exist?
QUESTION [5 upvotes]: I am very confused about the limit of the expression below:
$$\lim_{x\to a^+}\frac{\cos{x}\ln(x-a)}{\ln(e^x-e^a)} $$
By using L'Hospital's rule, I was managed to find the result which was $\cos a$
, same as other answers that I could possibly find on the Internet.
However, when I used GeoGebra to sketch the graph, the value of $f(x)$ tends to jump to infinity, both negative and positive.
I wonder if my result was wrong, or the limit does not exist at all? (In the picture below, I chose $a=15$ for easy re-check). Thanks in advance!

REPLY [2 votes]: The limit is indeed $\cos(a)$
The problem with your graph is that the function goes to infinity when the denominator is zero, that is, it has a vertical asymptote at $x_0$ where
$$ \ln(\exp(x_0) - \exp(a)) = 0 \implies x_0 = \ln(1+ e^a)= a + \ln(1+e^{-a})$$
When $a$ is large enough, so that $e^a \gg 1$ that is approximately
$$ x_0 \approx a + e^{-a} \approx a$$
In particular, for $a=15$ , $x_0= 15.0000003$
So, you either need to take an extremely narrow range to graph the function, or better, take $a$ near or below $1$
Here are the ranges for several values of $a$:
$$
\begin{array}{c|c}
 a  &   x_0 \\
\hline 
 1  &  1.3132616 \\
 2 &  2.1269280 \\
 3 &  3.0485873 \\
 4 &  4.0181499 \\
 5 &  5.0067153 \\
 6 &  6.0024756 \\
 7 &  7.0009114 \\
 8 &  8.0003354 \\
 9 &  9.0001234 \\
10 & 10.0000453 \\
11 & 11.0000167 \\
12 & 12.0000061 \\
13 & 13.0000022 \\
14 & 14.0000008 \\
15 & 15.0000003 
\end{array}
$$