Proof. Let h(x) = \tan(x) = \frac{\sin(x)}{\cos(x)} = \frac{f(x)}{g(x)}. Then
\begin{align*} h'(x) = \frac{d}{dx} \bigg(\frac{f(x)}{g(x)}\bigg) = \frac{g(x)f'(x)-f(x)g'(x)}{(g(x))^2}. \end{align*}
\begin{align*} f'(x) = \cos(x) \quad \text{and} \quad g'(x) = -\sin(x). \end{align*}
\begin{align*} h'(x) &= \frac{d}{dx} \bigg(\frac{f(x)}{g(x)}\bigg) \\ &= \frac{g(x)f'(x)-f(x)g'(x)}{(g(x))^2} \\ &= \frac{\cos(x)\cos(x)-\sin(x)(-\sin(x))}{\cos^2(x)} \\ &= \frac{\cos^2(x) + \sin^2(x)}{\cos^2(x)} \\ &= \frac{1}{\cos^2(x)} \\ &= \sec^2(x) \end{align*}