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. 

Hint. By using Taylor expansions at $0$,
$$\frac{ae^x - b\cos x +ce^{-x}}{x\sin x} =\frac{a(1+x+\frac{x^2}{2}) - b(1-\frac{x^2}{2}) +c(1-x+\frac{x^2}{2})+o(x^2)}{x(x+o(x))}\\
=\frac{(a-b+c)+(a-c)x+\frac{(a+b+c)}{2}x^2+o(x^2)}{x^2+o(x^2)}.$$
In order to have the final limit $2$ we need that
$$(a-b+c)=0,\quad(a-c)=0,\quad \frac{(a+b+c)}{2}=2.$$
Can you take it from here?
P.S. If you prefer to use L'Hopital begin with your initial observation
$$\lim_{x\to 0}ae^x - b\cos x +ce^{-x}=a-b+c.$$
If $a-b+c=0$ then, by L'Hopital,
$$\lim_{x\to 0}\frac{ae^x - b\cos x +ce^{-x}}{x}=\lim_{x\to 0}\frac{ae^x + b\sin x -ce^{-x}}{1}=a-c.$$
If $a-b+c=0$ AND $a-c=0$ then, by L'Hopital (twice),
$$\begin{align}
\lim_{x\to 0}\frac{ae^x - b\cos x +ce^{-x}}{x^2}
&=\lim_{x\to 0}\frac{ae^x + b\sin x -ce^{-x}}{2x}
\\&=\lim_{x\to 0}\frac{ae^x + b\cos x +ce^{-x}}{2}=\frac{a+b+c}{2}.
\end{align}$$
