# Why is the $\tan$ function differentiable even though it is not continuous?

If only continuous functions can be differentiable, then how can the tangent function $$\tan$$ be differentiated, even though $$\tan$$ is not a continuous function?

• $\tan x$ is not differentiable on $\Bbb R$. – Ruben Jul 2 at 9:39
• $\tan$ is continuous. All elementary functions are continuous everywhere. – Alexey Jul 2 at 9:48
• @Ruben, $\tan$ is not defined on $\mathbb{R}$. "$\tan$ is not differentiable on $\mathbb{R}$" is a bit like saying that the square root function is not differentiable on $\mathbb{Z}[X, Y]$. – Alexey Jul 2 at 9:53
• @alexey It's more like the square root function is not differentiable on $\Bbb R$, which is true. – Ruben Jul 2 at 9:58
• @Alexey Ok sure, of course the statement is kind of silly. I was just trying to stimulate the person asking the question into thinking carefully about the domain of the function and its points of discontinuity. – Ruben Jul 2 at 10:06

The tangent function is continuous. I suppose that you are confused by the fact that it has singularities at $$k\pi+\frac{\pi}{2}$$, $$k\in\Bbb Z$$, but these points are simply not in the domain of the function.
$$\tan\colon \Bbb R \setminus \{k\pi+\frac{\pi}{2}: k\in\Bbb Z\} \to \Bbb R$$
Actually, $$\tan$$ is a continuous (and differentiable) function. Keep in mind that its domain is $$\mathbb R\setminus\left\{\frac\pi2+k\pi\,\middle|\,k\in\mathbb Z\right\}$$. Since it is the quotient of two differentiable functions, it is differentiable.