$$ \begin{aligned} f(x) &= tan x\\ \rArr f'(x) &= \lim_{h \to 0}\frac{f(x+h) - f(x)}{h}\\ &=\lim_{h \to 0}\frac{tan (x+h) - tan x}{h}\\ &=\lim_{h \to 0} \frac { \frac{sin (x+h)}{cos(x+h)} - \frac{sin x}{cos x}} {h}\\ &=\lim_{h \to 0} \frac { \frac{sin (x+h)cos x - sin x cos(x + h)}{cos(x+h) cos x}} {h}\\ &=\lim_{h \to 0} \frac { \frac{\overbrace{sin (x+h -x)}^{sin (a) cos (b) - sin (b) cos (a) = sin(a - b)}}{cos(x+h) cos x}} {h}\\ &=\lim_{h \to 0}{ \frac{sin h}{h.cos(x+h) cos x}}\\ &=\lim_{h \to 0}{ \frac{sin h}{h .cos(x+h) cos x}}\\ &={\lim_{h \to 0}{ \frac{sin h}{h}}} . \lim_{h \to 0}{\frac{1}{cos(x+h) cos x}}\\ &=1.\frac{1}{cos(x+0) . cos x}\\ &= \frac{1}{cos^2{x}} \end{aligned} $$