Two methods lead to different answers Question: 

Evaluate limit
  $$\lim_{x\to 0}\frac{10^x-2^x-5^x+1}{x\tan x}$$

My attempt:
$$\lim_{x\to 0}\frac{10^x-2^x-5^x+1}{x\tan x}$$
$$= \lim_{x\to 0}\frac{(10^x-1)-(2^x-1)-(5^x-1)}{x\tan x}$$
$$= \lim_{x\to 0}\frac{(10^x-1)/x-(2^x-1)/x-(5^x-1)/x}{\tan x}$$
Now using identity $\lim_{x\to 0} \frac{a^x-1}{x}=\ln a$, we get:
$$= \lim_{x\to 0}\frac{\ln 10-\ln5-\ln2}{\tan x}= \lim_{x\to 0}\frac{\ln 1}{\tan x}= \lim_{x\to 0}\frac{0}{\tan x}= 0$$

The answer however is obviously wrong. I have the correct solution in my school book. But I wish to know why my solution is wrong. I have consulted my classmates but none of them can see the problem here either.
 A: This may be solved with Taylor approximations.  Recall that
$$e^x=1+x+\frac12x^2+\mathcal O(x^3)$$
It thus follows that
$$\frac{a^x-1}x=\ln(a)+\frac{\ln^2(a)}2x+\mathcal O(x^2)$$
And
$$\frac{10^x-1}x-\frac{2^x-1}x-\frac{5^x-1}x=\left[\frac{\ln^2(10)-\ln^2(2)-\ln^2(5)}2\right]x+\mathcal O(x^2)$$
Now recall that $\lim_{x\to0}\frac{\tan(x)}x=1$, so
$$\begin{align}\frac{10^x-2^x-5^x+1}{x\tan(x)}&=\frac{\frac{10^x-1}x-\frac{2^x-1}x-\frac{5^x-1}x}{\tan(x)}\\&=\frac{\left[\frac{\ln^2(10)-\ln^2(2)-\ln^2(5)}2\right]x+\mathcal O(x^2)}{\tan(x)}\\&=\frac{\frac{\ln^2(10)-\ln^2(2)-\ln^2(5)}2+\mathcal O(x)}{\frac{\tan(x)}x}\\&\to\frac{\frac{\ln^2(10)-\ln^2(2)-\ln^2(5)}2+0}1\end{align}$$

$$L=\frac{\ln^2(10)-\ln^2(2)-\ln^2(5)}2$$
  $$=\ln5\ln2$$

A: Be careful with the identity replacement; there are certain conditions under which it is legitimate. 
Suppose $f(x) \sim g(x)$ in the sense that
$$
\lim f(x) = \lim g(x)
$$
or 
$$
\lim \frac{f(x)}{g(x)}  = 1
$$
You cannot always substitute an equivalent $g$ for $f$, which tends to be wrong, even in simple cases. You may absolutely not use the identity, when $f$ is an addend. 
For example, 
$\lim_{x\rightarrow 0}\frac{\tan x-\sin x}{x^3} = \frac{1}{2}$ (verify!). But if you replace $\tan x$ and $\sin x$ with $x$, which are equivalent when x tends to zero, you get a wrong answer. 
Now suppose $f\sim g, u\sim v$. You may substitute equivalents in the following cases:
$$\lim \frac{f}{g} = \lim\frac{u}{v}$$
$$\lim f^g = \lim u^v$$
Of course, you may verify, that 
$$ \lim (\frac{1}{f})^g = \lim (\frac{1}{u})^v$$
and 
$$ \lim (1+f)^{\frac{1}{g}} = \lim (1 + u)^{\frac{1}{v}} $$
are all legitimate replacements. 
You have to be careful. 
