The limit as $x$ goes to zero of $(1/x) -(1/\tan x)$ using L'Hôpital's rule I'm having trouble finding
$$
\lim_{x\to0}\biggl(\frac{1}{x}-\frac{1}{\tan x}\biggr)
$$
As $x$ approaches zero, the function is in indeterminate form, so I used L'Hôpital's rule and took the derivative: 
$$-\frac{1}{x^2}-\frac{\sec^2x}{\tan^2x}
$$
This is still in indeterminate form and I still can't take the limit as x approaches zero, so I took the derivative again and still got it in indeterminate form. Is there something that I'm doing wrong either algebraically or with respect to differentiation? 
 A: As mentioned by @onamoonlessnight in the comments, L'Hopitals works for a ratio of functions both tending to $0$ or $\pm\infty$. First combine:
$$\dfrac{1}{x}-\dfrac{1}{\tan x} = \dfrac{\tan x - x}{x\tan x} \to \ \dfrac{0}{0}$$
Now use L'Hopital's Rule.
$$\lim_{x\to 0} \dfrac{\tan x - x}{x\tan x} =_{L'H} \lim_{x\to 0} \dfrac{\overbrace{\sec^2x-1}^{\tan^2 x}}{x\sec^2x + \tan x} =  \lim_{x\to 0} \dfrac{\sin x}{\dfrac{x}{\sin x} + \cos x} $$
A: This is a typical case where  Taylor's formula is much simpler than L'Hospital's rule: $\tan  x=x+\dfrac{x^3}3+o(x^3)$, whence 


*

*$\tan x-x\sim_0\dfrac{x^3}3$,

*$x\tan x\sim_0 x^2$.
Thus 
$$\frac1x-\frac1{\tan x}=\frac{\tan x-x}{x\tan x}\sim_0\frac{x^3}{3x^2}=\frac x3\to 0. $$

A: L'Hôpital's theorem doesn't apply as you did: if you have an indeterminate form $\infty-\infty$, but you cannot compute the limit of the difference of the derivatives.
L'Hôpital's theorem only applies to forms $0/0$ or $\infty/\infty$ (well, also to some other case, but that's not really important). Only then you can try computing the limit of the ratio of the derivatives.
So you have to transform the $\infty-\infty$ form into something that's manageable as a ratio:
$$
\frac{1}{x}-\frac{1}{\tan x}=\frac{\tan x-x}{x\tan x}
$$
is one of them. Before using l'Hôpital, you can observe your limit can be written as
$$
\lim_{x\to0}\frac{x}{\tan x}\frac{\tan x-x}{x^2}
=
\lim_{x\to0}\frac{x\cos x}{\sin x}\frac{\tan x-x}{x^2}
$$
where the first factor has limit $1$, so you just need to compute
$$
\lim_{x\to0}\frac{\tan x-x}{x^2}
\overset{\mathrm{(H)}}{=}
\lim_{x\to0}\frac{1+\tan^2 x-1}{2x}=
\lim_{x\to0}\frac{\tan x}{x}\frac{\tan x}{2}=0
$$
Recall that
$$
\tan'x=\frac{1}{\cos^2x}=\sec^2x=1+\tan^2x
$$
