# Evaluate $\lim_{x\rightarrow1}{\frac{1+\log{x}-e^{x-1}}{(x-1)^2}}$ using use L'Hospital's rule

I want to evaluate the following limit

$$\lim_{x\rightarrow1}{\frac{1+\log{x}-e^{x-1}}{(x-1)^2}}$$

I use L'Hospital's rule:

$$\lim_{x\rightarrow1}{\frac{\frac{1}{x}-e^{x-1}}{2(x-1)}}$$

Now, here my textbook applies the L'Hospital's rule again. What I instead did was proceeding this way:

$$\lim_{x\rightarrow1}{\frac{\frac{1-xe^{x-1}}{x}}{2(x-1)}}=\lim_{x\rightarrow1}{\frac{1-xe^{x-1}}{2x(x-1)}}=\lim_{x\rightarrow1}{h(x)}$$

Now,

$$h(x)\sim \frac{1-e^{x-1}}{2(x-1)}=\frac{-(e^{x-1}-1)}{2(x-1)}\sim\frac{-(x-1)}{2(x-1)}=-\frac 1 2$$

I think I did something wrong with the asymptotics because the solution is actually $-1$. Any hints?

You replaced $-xe^{x-1}$ by $-e^{x-1}$. The difference, $(1-x)e^{x-1}$ has the property that $\frac{(1-x)e^{x-1}}{2(x-1)}=-\frac{e^{x-1}}{2}\to -\frac12$ as $x\to 1$, which makes up for the shortfall in your solution.

As an alternative let $x-1=t \to 0$

$$\lim_{x\rightarrow1}{\frac{1+\log{x}-e^{x-1}}{(x-1)^2}}=\lim_{t\rightarrow0}{\frac{1+\log{(1+t)}-e^{t}}{t^2}}$$

then use the results indicated here to obtain

$$\frac{1+\log{(1+t)}-e^{t}}{t^2}=\frac{\log{(1+t)}-t}{t^2}-\frac{e^{t}-t-1}{t^2}\to -\frac12-\frac12=-1$$

Following your way from here we have

$$\lim_{x\rightarrow1}{\frac{\frac{1}{x}-e^{x-1}}{2(x-1)}}=\lim_{t\rightarrow0} {\frac{\frac{1}{1+t}-e^{t}}{2t}}$$

that is

$$\frac{\frac{1}{1+t}-e^{t}}{2t}=\frac{\frac{1}{1+t}-1+1-e^{t}}{2t}=-\frac1{2(1+t)}-\frac12\frac{e^t-1}{t} \to -\frac12-\frac12=-1$$