TITLE: If $\tan x$ is not a differentiable function then why does its differentiation $\sec^2(x)$ exists?
QUESTION [5 upvotes]: $\tan x$ is not differentiable at $(2n + 1)90$ points, which means function itself is not differentiable. So, why does its differentiation $\sec^2(x)$ exists?

REPLY [6 votes]: You derive $\tan(x)$ on its domain, not on any point of $\mathbb{R}$!
Also, note that $\sec^2(x) = \frac{1}{\cos^2 x}$ is not defined at $x= \frac{\pi}{2} + k\pi$, which is coherent with the fact that $\tan(x)$ isn't too.