# Why is $\tan(x)$ a function?

A function $f:X\rightarrow Y$ maps each $x\in X$ to some $y \in Y$. So consider $\tan{\frac{\pi}{2}}$ for which $\tan(x)$ is undefined, so in this case, $\tan(x)$ does not map to an element of its range. This conflicts with my understanding of what a function is. Why do we still consider $\tan(x)$ a function?

• By the way, $\tan(x)$ is a scalar, $x\mapsto \tan(x)$ and $\tan$ are functions. As a student I thought being so meticulous was useless. I changed my mind when I started to teach... Commented Oct 27, 2014 at 18:23

The set $X$ in your definition is the domain of the function. The domain of $\tan(x)$ is typically taken to be

$$X=\bigcup_{k\in\Bbb{Z}} \left(-\frac{\pi}{2}+k\pi,\frac{\pi}{2}+k\pi\right)$$

Thus $\pi/2\notin X$, and so don't need to assign a value to $\tan(\pi/2)$ (or for any $\pi/2+k\pi,k\in\Bbb{Z}$ for that matter).

• I see. I thought the domain of $\tan(x)$ would be $\mathbb{R}$, conveniently expressed in Radians.
– Newb
Commented Oct 18, 2013 at 15:00
• Not typically. For the same reason that the domain of $1/x$ is taken to be $(-\infty,0)\cup(0,\infty)$. Most functions you're probably familiar with have domains that are actually subsets of $\Bbb{R}$. Commented Oct 18, 2013 at 15:03
• Failure to specify domain is failure to specify a function. Commented Oct 18, 2013 at 15:30
• @ncmathsadist if you are right about the domain up to a null set, then it's probably good enough. Commented Oct 18, 2013 at 18:35

When you say $f$ is a function, you should specify its domain (and codomain, but that's not really the issue here). If the domain is not specified, we take it to be the largest set on which the expression is defined. As you've pointed out $\tan$ is not defined at $\frac{\pi}{2}$ (so you should not even write $\tan\frac{\pi}{2}$ as this means the value of the function $\tan$ at the point $\frac{\pi}{2}$). Furthermore, $\tan$ is undefined at $\frac{\pi}{2} + k\pi$ for every integer $k$. Therefore, the largest set on which $\tan$ is defined is $\mathbb{R}\setminus\{\frac{\pi}{2}+k\pi\mid k \in \mathbb{Z}\}$; this is the domain of $\tan$ if the domain is unspecified.

• Good to know - specifically the definition of the domain as $\mathbb{R} \backslash \{ \frac{\pi}{2} + k\pi | k \in \mathbb{Z} \}$ strikes me as pleasantly precise.
– Newb
Commented Oct 18, 2013 at 15:09
• As I said, this is the domain if it is not specified. The behaviour of the function changes if we use a different domain. For example, $\tan$ on $(-\frac{\pi}{2}, \frac{\pi}{2})$ is injective (one-to-one) and surjective (onto), and therefore has an inverse $\arctan : \mathbb{R} \to (-\frac{\pi}{2}, \frac{\pi}{2})$. Commented Oct 18, 2013 at 15:15

Actually that is the definition of a continuous function. The definition for a function is that for all inputs there is exactly one output. In a non-continuous function, when the input doesn't map to anything, it is not in the domain. So if f(pi/2) is undefined, pi/2 is not in the domain and therefore not an input.

• Nothing in the question, or in your answer, relates to continuity. Why are you bringing it up? You write "that is the definition of a continuous function", but no one has written anything remotely similar to the definition of a continuous function. Commented Jan 23, 2014 at 7:40
• I think you may be thinking (in a fuzzy fashion) about the distinction between a function and a partial function. In any case, I suggest you delete this answer. Commented Jan 24, 2014 at 6:09