<s>[INST] Limit of a function tending to a finite number If 
$$\lim_{x\to 0} \frac{ae^x - b\cos x +ce^{-x}}{x\sin x} = 2$$
then find the value of $a+b+c$.
My book has given the following solution to the above problem :- 
We observe that as $x$ tends to zero , numerator tends to $a-b+c$ whereas the denominator tends to zero. Therefore for the limit to exist , we must have ,$a-b+c=0$
Now I am really confused at this point. Why would we want the numerator to attain the value of $0$ . Wouldn’t that give us an indeterminate answer? But actually it’s suposed to be two . Can you please explain ? Thank you for your help. 
 [/INST] If $a - b + c \ne 0$ then
$$\frac{ae^x-b\cos x+ce^{-x}}{x\sin x} \xrightarrow{x\to 0} \frac{a-b+c}{0} = \operatorname{sgn}(a-b+c) \cdot \infty \ne 2$$
Therefore $a - b + c = 0$. The limit is now an indeterminate form $\frac00$ so we can apply L'Hopital once. Differentiating gives
$$\frac{ae^x+b\sin x-ce^{-x}}{x\cos x+\sin x}$$
Again, if $a+b-c \ne 0$ then we would have:
$$\frac{ae^x+b\sin x-ce^{-x}}{x\cos x+\sin x} \xrightarrow{x\to 0} \frac{a+b-c}{0} = \operatorname{sgn}(a+b-c) \cdot \infty \ne 2$$
Therefore $a+b-c = 0$. The limit is now an indeterminate form $\frac00$ so we can again apply L'Hopital. Differentiating gives
$$\frac{ae^x+b\cos x+ce^{-x}}{-x\sin x+2\cos x}$$
Now the denominator is $\ne 0$ when $x\to 0$ so:
$$\frac{ae^x+b\cos x+ce^{-x}}{-x\sin x+2\cos x}\xrightarrow{x\to 0} \frac{a+b+c}{2}$$
This limit has to be $2$ so $$a+b+c = 4$$
$$a-b+c = 0$$
$$a+b-c = 0$$
The only solution is $a = 0, b = 2, c = 2$.
</s>