We have previously seen that a function #f:\blue X \to \orange Y# assigns an element #y# in a set #\orange Y# to each element #x# in the set #\blue X#. We will now look at these sets in more detail.
Let #f# be a function of #\blue X# to #\orange Y#. We call the set #\blue X# the #\blue{\textbf{domain}}# of #f# and the set #\orange Y# the #\orange{\textbf{codomain}}# of #f#.
A function #f# therefore assigns an element #y# from the #\orange{\text{codomain}}# to each element #x# from the #\blue{\text{domain}}#.
example
#f: \{1,2,3\} \to \{1,2,\ldots,9\}#
with function rule: #f(x)=x^2#
#\blue{\text{Domain}}# : #\{1,2,3\}#
#\orange{\text{Codomain}}# : #\{1,2,3,4,5,6,7,8,9\}#
In the case of the #\orange{\text{codomain}}#, it is not necessary that each element is also reached. The part that is reached, is called the range. We will elaborate on this later.
example
#f: \{1,2,3\} \to \{1,2,\ldots,9\}#
with function rule: #f(x)=x^2#
Range: #\{1,4,9\}#
The constant function is a special function: it is the function that assigns the exact same element #y# from #\orange{Y}# to each element #x# from #\blue{X}#. In other words, its output is the same for every input value.
The range of this function is the set #\{y\}#.
Examples
#f(x)=4#
#f(x)=-\frac{1}{3}#
#f(x)=\pi#
Most functions in this course are real-valued functions.
Functions of which the #\orange{\text{codomain}}# is #\mathbb{R}# are called real-valued functions.
Furthermore, if the #\blue{\text{domain}}# is a contained in #\mathbb{R}#, we call the function a real function.
When we denote a real function as a function rule it is not immediately clear what the #\blue{\text{domain}}# is. We say that the #\blue{\text{domain}}# is the largest possible area in which the function is defined.
Examples
The #\blue{\text{domain}}# of:
#f(x)=x^2# is #\blue{\mathbb{R}}#
#f(x)=\sqrt{x}# is #\blue{\ivco{0}{\infty}}#
#f(x)=\frac{1}{x}# is #\blue{\mathbb{R}\setminus\{0\}}#
#f(x) = \sqrt{4-x}# is #\blue{(-\infty, 4]}#
This course will often only give a function on the basis of a function rule. The #\blue{\text{domain}}# is not explicitly stated. In that case, we will assume the largest possible #\blue{\text{domain}}# in #\mathbb{R}#. For some types of functions, such as power functions, we will explicitly mention that we will always choose a limited #\blue{\text{domain}}#.
It is important to take the #\blue{\text{domain}}# into account, for example, when drawing graphs, or solving equations.
The #\orange{\text{codomain}}# is often not explicitly mentioned. Throughout this course, we will mainly working with real or real-valued functions, in which case the #\orange{\text{codomain}}# is equal to #\mathbb{R}#.
A real function #f# represented by a function rule typically has as its domain the greatest possible subset of #\mathbb{R}# on which the function rule #f(t)# is defined. We can always choose to limit the domain of #f#. For example, when working with a function which describes the trajectory of a soccer ball. The function then describes the height of the ball at a time #t#. If the ball is kicked at time #t=0#, it only makes sense to limit the domain to #t \geq 0#.
Because the domain is the largest possible set on which the function is defined, the domain of the real function #f(x) = \sqrt{x}# is equal to the set #\ivco{0}{\infty}#. This is because the root of a negative number is undefined.
Which of the following sets is the largest possible domain of the function #f(x) = {{1}\over{x+3}}#?