# Why is $\tan x$ not a continuous function?

My textbook defines a continuous function as follows:

The function $f(x)$ is continuous if, for all $a$ in its domain, $\lim_{x\rightarrow a} f(x)$ exists and is equal to $f(a)$.

However, when I apply this to $f(x)=\tan x$, it seems to show that $\tan x$ is continuous, because:

For all $a$ in the domain of $\tan x$ (i.e. all real numbers except $\frac{(2k+1)\pi}{2}, n\in \mathbb{Z}$), we have that $\lim_{x\rightarrow a} \tan x$ exists and is equal to $\tan a$ (this can be easily seen from the graph of $\tan x$).

So it appears that $\tan x$ is continuous. However, I already know that it isn't continuous at $x=\frac{(2k+1)\pi}{2}$. Does this still mean it is continuous because it agrees with the definition? I'm not sure what to do now.

Edit: Really what I meant to ask is the following:

Here is the wording in the book: "A function $f(x)$ is continuous at $x=a$, if $f(a)$ is defined and $\lim_{x\rightarrow a} f(x)$ is defined and is equal to $f(a)$. A continuous function satisfies this condition for all values of $a$ in its domain, so the graph of a continuous function is unbroken."

Question: I'm assuming the book's definition is wrong? Because the last sentence seems to imply that $\tan x$ is continuous (which is what had me confused).

• The tangent function is continuous on its domain; it isn’t a continuous function on $\Bbb R$ simply because it isn’t defined on all of $\Bbb R$ (and moreover, the discontinuities aren’t even removable). – Brian M. Scott Dec 24 '16 at 22:08
• @BrianM.Scott: I see, that makes perfect sense and seems to answer my question. Why did you only put it as a comment? – john castro Dec 24 '16 at 22:10
• Probably because he was not able to answer the question as stated in the title ("Why is $\tan x$ not a continuous function?", when it is continuous in its domain). You might wan't to change the title to "Why is $\tan x$ not defined in the entire domain $\mathbb{R}$?". – barak manos Dec 24 '16 at 22:16
• @john: I was rushing off to do something else and wasn’t sure that it would completely answer your question or when I’d be back. – Brian M. Scott Dec 24 '16 at 22:17
• @BrianM.Scott: Here is the wording in the book: "A function $f(x)$ is continuous at $x=a$, if $f(a)$ is defined and $\lim_{x\rightarrow a} f(x)$ is defined and is equal to $f(a)$. A continuous function satisfies this condition for all values of $a$ in its domain, so the graph of a continuous function is unbroken." So I'm assuming the book's definition is wrong? Because the last sentence seems to imply that $\tan x$ is continuous (which is what had me confused). Thanks by the way. – john castro Dec 24 '16 at 22:19

The following is a copy-paste of @Brian M. Scott's comment:

The tangent function is continuous on its domain; it isn’t a continuous function on $\Bbb R$ simply because it isn’t defined on all of $\Bbb R$ (and moreover, the discontinuities aren’t even removable)

• I just duplicated the answer @TripleARaz posted because I'm tired of the edit war. – Tanner Swett Dec 24 '16 at 22:49

If you dont mind a short answer. $\tan.. = \sin../\cos..$. Sin is continuous but $\cos$ is in the denominator, creating infinities periodically as quotients.

The domain of tangent function is the set $$\operatorname{im}^{-1} \tan = \bigcup_{j=-\infty}^\infty \left]\pi j - \frac\pi 2,\pi j + \frac\pi 2\right[$$ Evidently $\tan$ is continuous on this set.

Discussing about the continuity of $\tan$ at the points $\pi/2 + \pi j$ is absurd, since $\tan$ is not defined on these points. (It is not defined as $\infty$ either!)

$\tan$ can be continuously extended to $\mathbb{R}$ by enlarging its image to the one-point compactification $\mathbb{R}^*$ of $\mathbb{R}$, and define $$\tan \left( \pi j + \frac{\pi}{2} \right) = \infty, \qquad j \in \mathbb{Z}$$ Then $\tan:\mathbb{R} \to \mathbb{R}^*$ is continuous.

In complex analysis, tangent function can be expressed as an infinite sum of partial fractions about the poles:

$$\tan z= \sum_{k=0}^{\infty} \frac{2z}{\left( k+\frac{1}{2} \right)^2 \pi^2-z^2}$$

which is continuous for any region without the poles.