L'Hôpital's rule and existence of limit $\lim_{x\to1} \frac{\ln(1-x)}{\tan\left(\frac{\pi x}{2}\right)}$ A very quick question. I was looking at the limit $$\lim_{x\to1} \frac{\ln(1-x)}{\tan\left(\frac{\pi x}{2}\right)}$$ and started to think about how this limit exists. I know by using L'Hôpital's rule the answer is $0$.
But how does the limit exist when $\tan\left(\frac{\pi x}{2}\right)$ change sign at $1$?
$$\lim_{x\to1} \tan\left(\frac{\pi x}{2}\right)$$ does not exist.
I know there is something there, but can someone explain me why?
Thank you!

For the sign-shifting, as an analogy, consider $\lim_{x\to 0}x^2 \csc(x)$. Now $\csc(x)$ changes sign at $0$, but the limit still exists and is zero because $\sin(x)/x\to 1$ as $x\to 0$, and then the extra $x$ will take care of it.
We must approach $x\to 1$ from the left, since otherwise $\ln(1-x)$ is not a real number. Substitute $z=1-x$:
$$
\lim_{x\to 1^-}\frac{\ln(1-x)}{\tan(\frac{\pi}{2} x)} = \lim_{z\to 0^+}\frac{\ln(z)}{\tan(\frac{\pi}{2} (1-z))}
$$Now change tangent to cotangent:
$$
 = \lim_{z\to 0^+}\frac{\ln(z)}{\cot(\frac{\pi}{2} z)}
$$
$$
 = \lim_{z\to 0^+}{\ln(z)}{\tan(\frac{\pi}{2} z)}
$$
$$
 = \lim_{z\to 0^+}{z\ln(z)}\cdot \frac{\tan(\frac{\pi}{2} z)}{z}
$$If you buy $\lim_{\theta\to 0}\sin(\theta)/\theta=1$, you can buy that we can split these terms up:
$$
 = \lim_{z\to 0^+}{z\ln(z)}\cdot\lim_{z\to 0^+} \frac{\tan(\frac{\pi}{2} z)}{z}
$$
$$
 = \frac{\pi}{2}\lim_{z\to 0^+}z{\ln(z)}
$$Plaigiarizing myself (https://math.stackexchange.com/q/3658596), make the substitution $z=e^{-u}$:
$$
\lim\limits_{z\to 0^+}{z\ln(z)} = \lim\limits_{u\to\infty}{e^{-u}\ln(e^{-u})}=-\lim\limits_{u\to\infty}{ue^{-u}} 
$$Now we make two observations:

*

*For $u>0,$ $u e^{-u}>0$

*For $u>1,$ $e^u > u^2$ (this follows by convexity)

Then by the Squeeze Theorem we have
$$
-\lim\limits_{u\to\infty}{u\cdot u^{-2}} \leq -\lim\limits_{u\to\infty}{ue^{-u}} \leq 0
$$
$$
0 \leq -\lim\limits_{u\to\infty}{ue^{-u}} \leq 0
$$So the limit exists and is $0$.
