Doubt on limits evaluation. Can anyone tell me what am I doing wrong here.

The limit provided is$$\lim_{x \to 0}\dfrac{xe^x-\ln(1+x)}{x²}$$

Method 1 (using standard limits)

$$= \ \ \ \  \dfrac{\displaystyle \lim_{x \to 0}\dfrac{xe^x}{x}-\lim_{x \to 0}\dfrac{\ln(1+x)}{x}}{\displaystyle \lim_{x \to 0}x}$$

$$= \ \ \ \  \dfrac{\displaystyle \lim_{x \to 0}e^x-\lim_{x \to 0} 1}{\displaystyle \lim_{x \to 0}x}$$

$$= \ \ \ \  \lim_{x \to 0} \dfrac{e^x-1}{x}$$

$$= \ \ \ \ 1$$



Method 2 (using  Maclaurin series )

$$\lim_{x \to 0}\dfrac{xe^x-\ln(1+x)}{x²}$$

$$= \ \ \ \ \dfrac{3}{2}$$

Even with L'Hopital rule I get $\dfrac{3}{2}$. Then what's wrong with method 1.

Some limit's properties
The error is quite simply described.


  Theorem. If $\lim_{x\to a}f(x)=l$ and $\lim_{x\to a}g(x)=m$ and $m\ne0$, then
  $$
\lim_{x\to a}\frac{f(x)}{g(x)}=\frac{l}{m}
$$


This is a correct statement. But you cannot apply it when not all the hypotheses are satisfied.

In your case, $\lim_{x\to0}x=0$, so the theorem cannot be applied.

Why can't it? Because division by $0$ is not allowed.
$$\lim_{x \to 0}\frac{xe^x-\ln(1+x)}{x^2}=\lim_{x \to 0}\frac{xe^x}{x^2}-\lim_{x \to 0}\frac{\ln(1+x)}{x^2}=\lim_{x \to 0}\frac{e^x}{x}-\lim_{x \to 0}\frac{\frac{1}{1+x}}{2x}=\lim_{x \to 0}e^x-\lim_{x \to 0}\frac{1}{2x+2x^2}=1-\lim_{x \to 0}\frac{1}{2x+2x^2}$$

this final limit appears to approach infinity so the answer is $+\infty$ or $-\infty$ depending on whether we use $0^+$ or $0^-$