I have been trying to derive the derivative of the arcsecant function, but I can't quite get the right answer (the correct answer is the absolute value of what I get). I first get $\frac{d}{dy}\sec(y)=\frac{\cos^2(y)}{\sin(y)}=\frac{\cos^2(\sec^{-1}(x))}{\sin(\sec^{-1}(x))}$. Then, by examining the appropriate right triangle with angle $\theta$, hypotenuse $x$, adjacent side length $1$ and opposite side length $\sqrt{x^2-1}$, we see that $\sin(\sec^{-1}(x))=\sin(\theta)=\frac{\sqrt{x^2-1}}{x}$ and $\cos(\sec^{-1}(x))=\cos(\theta)=\frac{1}{x}$. Substituting these identities into the formula for the derivative, we get $\frac{1}{x\sqrt{x^2-1}}$. However, the actual answer is the absolute value of that. I can't figure out where I am assuming $x$ is positive. It has been a while since I have mucked about with this kind of thing, so my apologies if this is a silly question. Wikipedia wasn't helpful on the matter.