Find $\lim_{x \rightarrow 0} (\frac{\tan x}{x})^{x^{-2}}$ I see that this is in the $1^ \infty$ form, so I've taken log to get: 
$\lim_{x \rightarrow 0} \log( \frac{\tan x}{x})^{\frac{1}{x^2}}$
which is equivalent to 
$\lim_{x \rightarrow 0} \frac{\log ( \frac{\tan x}{x} )}{x^2}$
Using L-Hospital's rule for the $0/0$ form, I get:
$\frac {x\sec^2x-\tan x}{2\tan x}$
Using L-Hospital's rule for the $0/0$ form again, I get:
$\frac {2x \sec^2x\tan x}{2\sec^2x}$
Putting the limits, I'm getting this value as $0$ and so taking antilog my result is coming as $e^0=1$
However, the answer is $e^ {1/3}$ which I verified at Wolframalpha.
Can someone please point out my mistake and help me out? thank you
 A: $$\lim_{x\to0}\frac{1}{x^2}\ln\left(\frac{\tan x}{x}\right)=\lim_{x\to0}\frac{1}{x^2}\ln\left(1+\frac{\tan x}{x}-1\right)=$$
$$\lim_{x\to0}\frac{\frac{\tan x}{x}-1}{x^2}=\lim_{x\to0}\frac{\tan x-x}{x^3}=\lim_{x\to0}\frac{x+\frac{x^3}{3}+o(x^3)-x}{x^3}=\frac{1}{3}$$
then:
$$\lim_{x\to0}\left(\frac{\tan x}{x}\right)^{\frac{1}{x^2}}=\lim_{x\to0} e^{\frac{1}{x^2}\ln\left(\frac{\tan x}{x}\right)}=e^{\frac{1}{3}}$$
A: we will use the two facts $\tan x = x + \frac{1}{3}x^3 + \cdots$ and $e^x = 1 + x + \cdots$ in the form $\lim_{x \to 0}(1+x)^{k/x} = e^k$ to show that the $\lim_{x \to 0}{\frac{\tan x}{x}}^{1/x^2} = e^{1/3}.$
here goes, $\frac{\tan(x)}{x} = 1 + \frac{1}{3}x^2+\cdots$ and now raise this expression to  $\frac{1}{x^2}$ to get the claimed result.
A: Your first use of L'Hopital's rule is wrong. The derivative of $\frac{log ( \frac{tanx}{x} )}{x^2}$ is not $\frac {x \sec^2x-\tan x}{2\tan x}$ but is
$$(\cot x) \left(\frac{\sec^2x}x-\frac{\tan x}{x^2}\right)-\frac{\log \left(\frac{\tan x}x \right)}{x^2}$$
