# Using L'Hopital Rule on a limit that does not exist

I was trying to solve an improper integral and had to evaluate the expression below with the upper limit as infinity (limit is 0) and lower limit as 0 (the limit I'm asking about here)

Here's the limit:
$$\lim_{x \to 0} [x\ln (e^{x}-1) -x^{2}]$$

I punched the expression into an online limit solver.

The L'Hopital rule can be used when the limit is in an indeterminate form, and when the limit on the numerator and limit on the denominator exist. The limit of $$\frac{1}{x}$$
Does not exist when x approaches 0. (And I think the limit of the logarithm in the numerator does not exist as it approaches 0, unless only from the right? Someone confirm this for me please)

Is it safe to assume that the limit solver assumes that x approaches 0 from the right?
Does this mean that the limit only exists when x is approached from the right?

And if this limit doesn't exist unless it is from the right, is it safe to change the limit above to make it approach from the right in order to solve this integral?

• The limit can only be from the right since the function isn't defined when $x < 0$. By the way, you're missing an $x^2$. – Oliver Jones Nov 11 '19 at 2:33

Taylor expansion is the way to go here: $$e^x = 1 + x + x^2/2 + o(x^2)$$, thus $$\ln[e^x - 1] \sim \ln x$$ and $$x\ln x \to 0$$. As @Olivier points out this is only defined for $$x > 0$$.
To evaluate the limiting value of $$x\log(e^x-1)-x^2$$ as $$x$$ approaches $$0,$$ there's no problem with approaching $$0$$ from below too since then also the function is defined properly and real. Thus as $$x$$ vanishes, we get $$0\cdot \log(1-1)-0=0\cdot(-\infty)=0.$$ The first summand also vanishes since we may write this as $$\frac{x}{1/\log (e^x-1)},$$ to which you may apply L'hopital.
I love l'Hôpital's rule, it always stimulates creativity. Here you can do $$$$x \log(e^x - 1) = x\log(\frac{e^x - 1}{x}) + x \log(x)$$$$ but l'Hôpital's rule tells you that $$\lim_{x\to 0} \frac{e^x-1}{x} = 1$$ and you know that $$\lim_{x\to 0^+} x\log(x) = 0$$. It follows that the limit is $$0$$.
Note that the $$\lim_{x\to 0^+} x\log(x) = 0$$ can also be obtained by l'Hôpital's rule by using $$$$\lim_{x\to 0^+} x\log(x) = \lim_{x\to 0^+} \frac{\log(x)}{1/x} = \lim_{x\to 0^+} \frac{1/x}{-1/x^2} = \lim_{x\to 0^+} -x = 0$$$$