One needs to exercise a bit more care in finding the derivative of \(\asec(x)\) as its domain, unlike that of \(\arctan(x)\text{,}\) is not a interval but a disconnected union of two intervals \((-\infty,-1]\) and \([1,\infty)\text{.}\) Let \(y = \asec(x)\) and proceed as usual, we find that
\begin{align*}
\frac{dy}{dx} & = \frac{1}{dx/dy}=\frac{1}{d\sec(y)/dy}
\frac{1}{\sec(y)\tan(y)}= \frac{1}{x\tan(y)}.
\end{align*}
The trickier part is to express \(\tan(y)\) in terms of \(x=\sec(y)\text{.}\) Certainly, \(\tan^2(y) \equiv \sec^2(y)-1=x^2 -1\) but note that in the domain of \(\asec(x)\text{,}\) \(0 \le y \lt \pi/2\) when \(x \ge 1\) and \(\pi/2 \le y \lt
\pi\) when \(x \le -1\text{.}\) And so,
\begin{equation*}
\tan(y) =
\begin{cases}
\phantom{-}\sqrt{x^2-1} & x \ge 1; \\
-\sqrt{x^2-1} & x \le -1.
\end{cases}
\end{equation*}
Therefore,
\begin{equation*}
\frac{d}{dx}\asec(x) =
\begin{cases}
\dfrac{1}{x\sqrt{x^2-1}} & x \ge 1; \\
\dfrac{-1}{x\sqrt{x^2-1}} & x \le -1.
\end{cases}
\end{equation*}
or \((\asec(x))' = \dfrac{1}{|x|\sqrt{x^2-1}}\) as some may prefer to write it more succinctly. We should also point out that by examining the graph of \(\asec(x)\text{,}\) it is clear that the derivative of \(\asec(x)\) is an even function hence one can deduce its expression on \(x \lt -1\) from its expression on \(x \ge 1\text{.}\)