<s>[INST] Find the limit of $\frac{e^{\tan x} - e^x + \ln(\sec x + \tan x) -x }{\tan x - x}$ as $x \to 0$ $$\lim_{x \to 0} \frac{e^{\tan x} - e^x + \ln(\sec x + \tan x) -x }{\tan x - x}$$
I tried to solve this using L'Hopital rule but the resulting differential got too messy
$$=\lim_{x \to 0} \frac{e^{\tan x}\sec^2x - e^x + \sec x - 1 }{\tan^2x}$$
$$=\lim_{x \to 0} \frac{e^{\tan x}(\sec^4x+2\sec^2x\tan x) - e^x + \sec x\tan x }{2\tan x \sec^2x}$$
What should I do from here? Differentiate again or use a different strategy?
 [/INST] This can also be accomplished with power series. First, the denominator because it's easier:
\begin{multline}
\tan(x) - x =\left[x +  \frac{x^3}{3} + O(x^4)\right] -x = \frac{x^3}{3} + O(x^4).
\end{multline}
Thus, we need to expand the numerator out to third order to determine the limit:
\begin{multline}
e^{\tan{x}}-e^x = 1+\tan(x)+\frac{\tan^2(x)}{2}+\frac{\tan^3(x)}{6} + O(x^4) - \left[1+x+\frac{x^2}{2}+\frac{x^3}{6} + O(x^4)\right] 
\\ = 1+x + \frac{x^3}{3}+\frac{x^2}{2}+\frac{x^3}{6}  - \left[1+x+\frac{x^2}{2}+\frac{x^3}{6} \right] + O(x^4)= \frac{x^3}{3} + O(x^4)
\end{multline}
\begin{multline}
\ln[\tan(x)+\sec(x)] -x =\int\left[\sec(x) - 1\right]dx = \int\left[\frac{x^2}{2} + O(x^4)\right]dx = \frac{x^3}{6}+O(x^4)
\end{multline}
So we have
\begin{multline}
\lim_{x\rightarrow 0} \frac{e^{\tan{x}}-e^x+\ln[\tan(x)+\sec(x)] -x}{ \tan(x) - x} \\
= \lim_{x\rightarrow 0}\frac{\frac{x^3}{3} + O(x^4) +\frac{x^3}{6} + O(x^4)}{\frac{x^3}{3} + O(x^4)} = \lim_{x\rightarrow 0}\frac{\frac{3}{2} + O(x)}{1+O(x)} = \frac{3}{2}
\end{multline}
The fact we had to expand to third order also means we needed three applications of L'Hospital's rule to get rid of the indeterminate form. Applying it once more to the expression you found gives
\begin{multline}
\lim_{x \to 0} \frac{e^{\tan(x)}\left[\sec^4(x)+2\sec^2(x)\tan^2(x)\right] - e^x + \sec x\tan x }{2\tan x \sec^2x} 
\\ = \lim_{x \to 0} \frac{e^{\tan(x)}\sec^4(x)\left[2+2\sin^2(x)+\tan^2(x)+5\tan(x)\right]- e^x + \sec(x)\left[1+2\tan^2(x)\right] }{2\sec^2(x)\left[1+3\tan(x)^2\right]}
\end{multline}
And sure enough, the numerator and denominator are no longer zero at $x=0$, so the limit is easily evaluated as $3/2$.
</s>