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. 

If $a-b+c \neq 0$, the limit would be either $+\infty$ or $-\infty$. 
Note, as written as Robert Z, that
$$
\frac{ae^x-b\cos x+cx^{-x}}{x\sin x}=\frac{(a-b+c)+x(a-c)+x^2(\frac{a}{2}+\frac{b}{2}+\frac{c}{2}))+O(x^3)}{x^2+O(x^3)}
$$
as $x\to 0$. Since the limit exists, you need $a-b+c=0$, $a=c$ and $\frac{a}{2}+\frac{b}{2}+\frac{c}{2}=2$. Therefore $$a+b+c=4$$ (and you also know that $a=1, b=2, c=1$).
