We say a function $y=f(x)$ is defined for $x=a$ when $f(a)$ is a real number. [We will talk about (6)–(11) in more detail in Chapter 3. If you have no prior knowledge about them, you may skip them.]

1.$f(x)=x^{m}$ where $m$ is any positive integer is defined for every value of $x$.

2. $f(x)=\dfrac{1}{x}$ is defined for every value of $x$ except $x=0$, since $\frac{1}{0}$ cannot be calculated.

3.$f(x)=\sqrt{x}$ is defined for $x\geq0$ [because for $x<0$, $\sqrt{x}$  is imaginary].

4. $f(x)=\sqrt[n]{x}$ where $n$ is an even integer is defined for $x\geq0$ [because $\sqrt[n]{x}$ for $x<0$ is imaginary].

5.$f(x)=\sqrt[m]{x}$ where $m$ is an odd integer is defined for every value of $x$.

6. $f(x)=\log_{a}x$ where $a>0$ is defined only for $x>0$. For negative values of $x$, this function does not exist [in fact, it becomes imaginary].

7. $f(x)=a^{x}$ where $a>0$; that is, the exponent is a variable and the number $a$ being a constant. This function is defined for every value of $x$.

8.$f(x)=\sin x$ or $f(x)=\cos x$ is defined for every value of $x$.

9. $f(x)=\tan x$ is defined for every value of $x$ except $x=(2n+1)\frac{\pi}{2}$ where $n$ is any integer.Recall that $\tan x=\frac{\sin x}{\cos x}$. Because $\cos\left((2n+1)\frac{\pi}{2}\right)=0$, and division by zero is not allowed, these values must be excluded here.

10. $f(x)=\arcsin x$ or $f(x)=\arccos x$ is defined only for $-1\leq x\leq1$.Because sines and cosines cannot exceed +1 or become less than –1, it follows that these functions are defined for all values of $x$ ranging from –1 to +1 inclusive, but not for other values.

11.$f(x)=\arctan x$ or $f(x)=\text{arccot }x$ is defined for every value of $x$.

When we talk about “the function $y=f(x)$” and the domain of the function is not specified, the domain is then assumed to be the set of all real numbers for which $f(x)$ is defined; that is, $f(x)$ is real. This set is sometimes called the natural domain of $f$ and is denoted by $Dom(f)$.

The set of all real numbers for which $f(x)$ is real is called the natural domain or simply the domain of the function.
• If we want to restrict the domain of a function, we must specify so. For example, we must write “$f(x)=x^{2},x>0$”, to restrict the domain of $f$ to positive numbers. If we do not add “$x>0$”, the domain of $f$ is understood to be the entire set of real numbers.
Example 1
Determine the natural domains of the following functions:

(a)$f(x)=x^{2}-4x$
(b)$g(x)=\sqrt{x-1}$
(c)$h(x)=\sqrt{2-x}$
(d)$F(x)=\sqrt{x^{2}-6x}$
(e)$G(x)=\sqrt{4-x^{2}}$
(f)$H(x)=\sqrt{x-1}+\sqrt{2-x}$
(g)$u(x)=\dfrac{1}{x^{2}-3x}$
(h)$v(x)=\log(x-2)$

Solution
(a) For all $x$, $f(x)=x^{2}-4x$ is a real number. Thus $Dom(f)=(-\infty,\infty)=\mathbb{R}$.

(b)We recall that $\sqrt{a}$ is real when $a\geq0$. Thus $g(x)$ is defined when $x-1\geq0$ or $x\geq1$. That is, $Dom(g)=\{x|\ x\geq1\}=[1,\infty).$

(c)$h(x)$ is defined when $2-x\geq0$ or $x\leq2$. Thus $Dom(h)=\{x|\ x\leq2\}=(-\infty,2]$.

(d) Since $x^{2}-6x$ or $x(x-6)$ must not be negative, $x$ and $x-6$ must always have the same signs (see the following sign table). $F(x)$ is defined for every value of $x$ except those between 0 and 6; that is $Dom(F)=\{x|\ x\leq0,x\geq6\}.$ We can rewrite the domain of $F$ as $(-\infty,0]\cup[6,\infty)$. (e) Since $4-x^{2}=(2-x)(2+x)$ must not be negative, $G(x)$ is defined where $2-x$ and $2+x$ have the same signs (see the following sign table). Therefore, $G(x)$ is defined for $-2\leq x\leq2$, or $Dom(G)=\{x|\ -2\leq x\leq2\}=[-2,2]$. (f) For $\sqrt{x-1}$ to be real, we must have $x-1\geq0$ or $x\geq1$. For $\sqrt{2-x}$ to be real, we must have $2-x\geq0$ or $x\leq2$. Thus, $H(x)$ is real, if we have both $x\geq1$ and $x\leq2$; that is, the domain of $H$ is $Dom(H)=\{x|\ 1\leq x\leq2\}=[1,2]$.

(g) Because $u(x)=\dfrac{1}{x^{2}-3x}=\dfrac{1}{x(x-3)}$, $u(x)$ is defined for all values of $x$ except $x=0$ and $x=3$. When $x=0$ or $x=3$, the divisor becomes zero and division by zero is not allowed. Thus $Dom(u)=\{x|\ x\neq0,\ x\neq3\}$. The domain of $u$ can also be represented by $\mathbb{R}-\{0,3\}$ or $(-\infty,0)\cup(0,3)\cup(3,\infty)$.

(h) Because the logarithm of a nonpositive number is not real, we must have $x-2>0$ or $x>2$. Thus $Dom(v)=\{x|\ x>2\}=(2,\infty)$.

Another important set that is associated with every function is the range of a function. The range of a function $f$ is the set of all values taken by the function (or equivalently by the dependent variable) when the independent variable varies over the domain. In other words, all possible outputs of a function make up its range. The range of $f$ is denoted by $Rng(f)$.

If $f:A\to B$, the range of $f$ is
$Rng(f)=\{f(x)|\ x\in A\}.$
• Note that the range of $f$ is a subset of its co-domain $B$
$Rng(f)\subset B.$
• The difference between domain, codomain and the range of a function is depicted in Figure 3. Figure 3. Domain, co-domain and range of a function $f$
Example 2
Let $f:\mathbb{R\to\mathbb{R}}$ and $f(x)=x^{2}$. Find the range of $f$.
Solution

The range of $f$ consists of all possible outputs of $f$. Any $y\geq0$ is a possible output of $f$, because we can find a value of $x$ such that $y=x^{2}$ (we just need to set $x=\sqrt{y}$ or $x=-\sqrt{x}$). Thus, the range of $f$ is $\{y|\ y\geq0\}=[0,\infty)$.

In elementary calculus, we will learn more powerful methods for determining the ranges of functions.