$\lim \limits_{x \to 0}\left(\frac{e^x-e^{-x}-2\ln(1+x)}{x\sin(x)}\right)$ : $1$ or $-1$?

I'm self-studying and attempted the following limit question. I do not have access to a worked solution.

$$\lim \limits_{x \to 0}\left(\frac{e^x-e^{-x}-2\ln(1+x)}{x\sin(x)}\right)$$

OK, no problem, applying the limit this is $\frac{0}{0}$ so I applied L'Hôpital's rule.

Differentiating the numerator, I got:

$$e^x+e^{-x}-\frac{2}{x+1}$$

And denominator:

$$\sin(x) + x\cos(x)$$

Now of course we have:

$$\lim \limits_{x \to 0}\left(\frac{e^x+e^{-x}-\frac{2}{x+1}}{\sin(x) + x\cos(x)}\right) = \frac{1+1-2}{0+0}=0/0$$

OK. Apply L'Hôpital again.

For the top I have:

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

And the bottom:

$$2\cos(x)-x\sin(x)$$

Now the limit:

$$\lim \limits_{x \to 0}\left(\frac{e^x-e^{-x}-\frac{2}{(x+1)^2}}{2\cos(x)-x\sin(x)}\right)=\frac{1-1-2}{2-0}=-1$$

So I thought I would check my answer. Both SymPy and WolframAlpha both return the value $1$. Whilst the graph provided by Wolfram does indeed show the real part pass through $1$ from both sides, I have no understanding of what is going on here.

So my questions are:

1) How is this limit taken by hand?

2) Why am I wrong in just the sign?

2) Where have I gone wrong and how can I recognise such a situation again in the future?

• The derivative of $2/(1 + x)$ is $-2/(1 + x)^2$, flipping the sign to a positive. – user296602 Aug 8 '17 at 17:30
• Your second derivative is wrong. It should be $$e^x-e^{-x}+ \frac{2}{(1+x)^2}$$ – Crostul Aug 8 '17 at 17:31
• Gosh. That was silly. Thanks both. – Bangkockney Aug 8 '17 at 17:34

The simplest is using Taylor's expansion of the numerator to obtain an equivalent near $0$. We'll rewrite the numerator as $2\sinh x-2\ln(1+x)$ and expand it at order $2$: $$2\bigl(\sinh x-\ln(1+x)\bigr)=2\biggl(x+o\bigl(x^2\bigr)-\Bigl(x-\frac{x^2}2+o\bigl(x^2\bigr)\Bigr)\biggr)=x^2+o\bigl(x^2\bigr),$$ so the numerator is equivalent to $x^2$ near $0$.

On the other hand, $x\sin x\sim_0 x^2$, so $$\frac{2\bigl(\sinh x-\ln(1+x)\bigr)}{x\sin x}\sim_0 \frac{x^2}{x^2}=1.$$

• It would be very nice if this answered the questions OP asked, such as where they went wrong in the computation. Just adding another technique (that likely uses series that the OP has not seen yet) doesn't really answer the question, IMHO. – user296602 Aug 8 '17 at 17:51
• Yes it doesn't answers directly the question. I wanted to show there were simpler ways tha repeating L'Hospital's rule ad nauseam. This method doesn't requires a knowledge of series, only the basic Taylor's expansions, which any first year student should have seen. – Bernard Aug 8 '17 at 18:07
• @user296602 I disagree with the implied thesis that presenting an alternative approach that doesnt directly address the question in an OP is a "bad thing." While you didn't say that explicitly, your writing the comment carries that connotation. Bernard has posted a very useful way forward that should become part of a practitioners arsenal. So (q1) from me. – Mark Viola Aug 8 '17 at 18:56
• @MarkViola I didn't say it was a bad thing, but that it would be nice to include. After all, although the question has been answered in the (purposely ephemeral) comments, it still has not been included in either of the answers. And to an asker who may or may not have any idea what a series is, that is less than perfectly helpful. – user296602 Aug 8 '17 at 18:59
• @user296602 I didn't write that you stated that "it was a bad thing." Read again the concession. I wrote that the comment carries that connotation, which is different. Here, it is only my inference. – Mark Viola Aug 8 '17 at 19:12

other approach

$$e^x-e^{-x}=2\sinh (x)=2x+x^2\epsilon (x)$$

$$\ln (1+x)=x-\frac {x^2}{2}+x^2\epsilon (x)$$

$$x\sin (x)\sim x^2 \;\;(x\to 0)$$

the limit is $$\lim_0\frac {2x-2x+x^2+x^2\epsilon(x)}{x^2}=1$$

• It would be very nice if this answered the questions OP asked, such as where they went wrong in the computation. Just adding another technique (that likely uses series that the OP has not seen yet) doesn't really answer the question, IMHO. – user296602 Aug 8 '17 at 17:37