The derivative of $\tan x$ is $\boxed{\sec^2 x}$. We will use our knowledge of the derivatives of $\sin x$ and $\cos x$ to prove this result. Recall that
\begin{align*} \dfrac d{dx} \sin x = \cos x\end{align*}
and
\begin{align*} \dfrac d{dx} \cos x = -\sin x\end{align*}
For a detailed discussion and proof of the derivative of $\cos x$, click here. For a proof of the derivative of $\sin x$, click here. Since
\begin{align*} \tan x = \frac{\sin x}{\cos x}\end{align*}
it makes sense to use the quotient rule, which states that for two functions $f(x)$ and $g(x)$
\begin{align*} \frac d{dx}\bigg(\frac{f(x)}{g(x)}\bigg) = \frac{f'(x) g(x) – g'(x) f(x)}{g^2(x)}\end{align*}
In this case, will let $f(x) = \sin x$ and $g(x) = \cos x$. Then $f'(x) = \cos x$ and $g'(x) = -\sin x$. We will now substitute these values into the quotient rule to get
\begin{align*} \frac d{dx}(\tan x) = \frac d{dx}\bigg(\frac{\sin x}{\cos x}\bigg) = \frac{\cos x \cos x – (-\sin x)\sin x}{\cos^2 x} = \frac{\cos^2x +\sin^2 x}{\cos^2 x}\end{align*}
At this point, we will recall the Pythagorean Identity:
\begin{align*} \cos^2 x + \sin^2 x= 1\end{align*}
Applying this identity yields
\begin{align*} \frac d{dx}(\tan x) = \frac 1{\cos^2 x} = \bigg(\frac 1{\cos x}\bigg)^2 = \sec ^2 x.\end{align*}
Similarly, we may use this technique to find the derivative of other trigonometric functions, like $\sec x$, $\csc x$, and $\cot x$. You can find the detailed steps for finding the derivative of $\sec x$ here. Similarly, the steps for finding the derivative of $\cot x$ are here and for $\csc x$ are here.