1.1 Functions, domain and range

Defn: A function \(f\) is a correspondence between two sets \(D\) (called the domain) and \(C\) (called the codomain), that assigns to each element of \(D\) one and only one element of \(C\). The notation to indicate the domain and codomain is \(f:D\mapsto C\).

For \(x\in D\) we write \(f(x)\) to denote the assigned element in \(C\), and call this the value of \(f\) at \(x,\) or the image of \(x\) under \(f,\) where \(x\) is called the argument of the function. Extending the above notation we write \[f:D\mapsto C:x\mapsto f(x)\] ie. ‘‘\(f\) is a function from \(D\) to \(C\) that associates \(x\) in \(D\) to \(f(x)\) in \(C\)’’.

The set of all images is called the range of \(f\) and our notation for the domain and range is \[\mbox{Dom}\, f \quad\quad \mbox{and} \quad\quad \mbox{Ran}\,f=\{f(x):x\in \mbox{Dom}\,f\}.\]

Illustration of the domain, codomain and range of a function.

In (almost all of) this term of the module we shall only deal with real-valued functions of a real variable, meaning that our functions assign real numbers to real numbers ie. both the domain and codomain are subsets of \(\mathbb{R}.\)

There are various ways of representing a function, but perhaps the most familiar is through an explicit expression.

Eg. \(f:\mathbb{R}\rightarrow \mathbb{R}\) given by \(f(x)=x^2, \ \forall x\in\mathbb{R}.\)

In this case \(\mbox{Dom}\,f=\mathbb{R}\) and \(\mbox{Ran}\,f=[0,\infty).\)

We say that \(f\) maps the real line onto \([0,\infty).\)

Eg. \(f(x)=\sqrt{2x+4}, \ x\in[0,6].\) Here \(\mbox{Dom}\,f=[0,6]\) and \(\mbox{Ran}\,f=[2,4].\)

If the domain of a function \(f\) is not explicitly given, then it is taken to be the maximal set of real numbers \(x\) for which \(f(x)\) is a real number.

Eg. \(f(x)=\sqrt{2x+4}.\) Here \(\mbox{Dom}\,f=[-2,\infty)\) and \(\mbox{Ran}\,f=[0,\infty).\)

Eg. \(f(x)=1/(1-x).\) Here \(\mbox{Dom}\,f=\mathbb{R}\backslash\{1\} =(-\infty,1)\cup(1,\infty)\) and \(\mbox{Ran}\,f=\mathbb{R}\backslash\{0\}.\)

In addition to explicit expressions, a function \(f\) may be represented by other means, for example, as a set of ordered pairs \((x,y),\) where \(x\in \mbox{Dom}\,f\) and \(y\in \mbox{Ran}\,f.\)

Note: \(y(x)\) is another common notation for a function. The element \(x\) in the domain is called the independent variable and the element \(y\) in the range is called the dependent variable. This notation is often used if the function is defined by an equation in two variables, including differential equations (see later).

The function \(f(x)=x^2\) is defined by the equation \(y=x^2,\) as we have simply written \(y=f(x).\) However, not all equations will define a function.

Eg. The equation \(y^2=x\) does not define a non-trivial function \(y(x),\) because for \(x<0\) there are no real solutions for \(y,\) and for \(x>0\) there are two solutions for \(y,\) whereas a function must assign only one element of the range for each element of the domain.