Definition of Functions
Definition
A function is a special type of relation between two sets \( A \) and \( B \). A relation \( R \) from \( A \) to \( B \) is called a function if every element of set \( A \) has exactly one image in set \( B \) under \( R \).
Thus, a relation is a function if it satisfies the following two conditions:
-
Every element of \( A \) is related to an element in \( B \):
This means no element of \( A \) is left without a corresponding element in \( B \).
-
Each element of \( A \) is related to exactly one element in \( B \):
This ensures that no element in \( A \) has more than one image in \( B \). The relationship must be unique for every element in \( A \).
Functions as Mappings
A function can be understood as a "rule" or "mapping" that assigns every element in the set \( A \) (the domain) to exactly one element in the set \( B \) (the codomain). This mapping ensures two critical conditions:
- Each element in \( A \) must have a corresponding element in \( B \): No element in \( A \) is left out.
- Each element in \( A \) is mapped to exactly one element in \( B \): No element in \( A \) is assigned multiple outputs in \( B \).
For example, consider \( A \) as a set of students and \( B \) as a set of grades in a subject. A function \( f: A \to B \) could represent the rule "assign the grade of each student in a subject." This ensures two things:
- Every student has a grade: No student is left without a grade, ensuring totality.
- Each student has exactly one grade: A student cannot have more than one grade for the same subject, ensuring uniqueness.
This way, the function \( f \) clearly and unambiguously maps each student in \( A \) to one and only one grade in \( B \). This structure avoids confusion and guarantees that every input has a well-defined and singular output.
Notation
The notation of functions is different from that of general relations. If there is a relation \( R \) from set \( A \) to set \( B \), it is written as \( R \subseteq A \times B \). However, for a function \( f \) from \( A \) to \( B \), we use arrow notation, writing \( f: A \to B \). This explicitly shows that \( f \) maps elements of \( A \) (the domain) to elements of \( B \) (the codomain).
How elements of \( A \) and \( B \) are related under \( f \) can be described in many ways. If \( x \in A \) and \( y \in B \) are related by the function \( f \), we write:
This notation is intuitive—\( x \) is the input we provide to \( f \), and \( y \) is the output we obtain. The input \( x \) is called the argument or input of \( f \), and the output \( y \) is called the value or output of \( f \).
The rule that relates \( x \) and \( y \) in a function is often expressed as a mathematical equation, just like in relations. For example:
- \( y = x^2 \)
- \( y = x + 1 \)
These equations define how the input \( x \) is transformed into the output \( y \).
Consider the following example:
Let \( f \) be a function from the set of natural numbers \( \mathbb{N} \) to \( \mathbb{N} \), written as:
Suppose the rule for \( f \) is \( y = f(x) \iff y = x^2 \). This means the output \( y \) is the square of the input \( x \).
We can finally write,
\(f:\mathbb{N} \to \mathbb{N}\), where \(y=f(x)\) iff \(y=x^2\). It can be read as, \(f\) is a function from \(\mathbb{N}\) to \(\mathbb{N}\), where \(y\) is the output and \(x\) is the input such that \(y=x^2\).
So,
or equivalently:
A function can also be written in these forms as in relations:
-
Set Builder Form:
The function \( f \) can be expressed as a set of ordered pairs:
\[ f = \{(x, y) : x \in \mathbb{N}, y \in \mathbb{N}, y = x^2\}. \] -
Roster Form:
Alternatively, \( f \) can be written as:
\[ f = \{(1, 1), (2, 4), (3, 9), (4, 16), \dots\}. \]In this form we expicitly show how inputs and outputs are paired. Here, each ordered pair \( (x, y) \) specifies the input-output pair for \( f \). For example, a function \(g\) from the set of students to a grades can be written as, \(\{(\text{john}, A), (\text{jessica}, B), (\text{tom}, A), ...\}\).
Example
Let \( g: \mathbb{R} \to \mathbb{R} \) be a function defined by \( y = g(x) \iff y = x^3 + x \).
This means the function \( g \) maps each real number \( x \) to the value \( x^3 + x \). For example:
- \( g(1) = 1^3 + 1 = 2 \)
- \( g(-2) = (-2)^3 + (-2) = -8 - 2 = -10 \)
- \( g(0) = 0^3 + 0 = 0 \)
The function \( g \) can also be represented in set form as:
This shows the relationship between each \( x \) and its corresponding \( y \) under \( g \).
Example
Let \( h: A \to B \) be a function, where \( A = \{1, 2, 3\} \) and \( B = \{1, 2, 3, 4, 5\} \). The function \( h \) is defined as:
This means:
- \( h(1) = 1 \): The input \( 1 \) in \( A \) is mapped to \( 1 \) in \( B \).
- \( h(2) = 4 \): The input \( 2 \) in \( A \) is mapped to \( 4 \) in \( B \).
- \( h(3) = 1 \): The input \( 3 \) in \( A \) is mapped to \( 1 \) in \( B \).
Here, \( h \) satisfies the conditions of a function:
- Every element in \( A \) has exactly one output in \( B \).
- The mapping is well-defined and unique for each input.
Thus, \( h \) is a valid function from \( A \) to \( B \).
Just a relation but not a function
Let \( k: \mathbb{N} \to \mathbb{N} \) be a relation defined as:
For this relation:
- If \( x = 2 \), then \( k(2) = 2 - 1 = 1 \).
- If \( x = 3 \), then \( k(3) = 3 - 1 = 2 \).
- If \( x = 1 \), then \( k(1) = 1 - 1 = 0 \).
Here, \( k(1) = 0 \) is problematic because \( 0 \notin \mathbb{N} \) (assuming \( \mathbb{N} \) is the set of positive natural numbers, i.e., \( \mathbb{N} = \{1, 2, 3, \dots\} \)). This means that the input \( x = 1 \) does not have a valid output in \( \mathbb{N} \).
Since a function requires every element in the domain \( \mathbb{N} \) to have exactly one output in the codomain \( \mathbb{N} \), \( k \) is not a function. The issue lies in the fact that \( k(1) \) produces an output outside the codomain, violating the definition of a function.
Eliminating the output variable
Let us consider a function \( f: \mathbb{R} \to \mathbb{R} \) defined by the rule \( y = f(x) \iff y = x^2 \). This represents a mathematical relationship between the input \( x \) and the output \( y \). The equation \( y = x^2 \) explicitly shows how \( x \) and \( y \) are related.
However, it is often convenient and more concise to eliminate the output variable \( y \). Instead of writing \( y = f(x) \), we directly express the function as \( f(x) = x^2 \). Here, \( f(x) \) represents the output corresponding to the input \( x \).
For example:
- If \( x = 2 \), then \( f(2) = 2^2 = 4 \).
- If \( x = -3 \), then \( f(-3) = (-3)^2 = 9 \).
By eliminating \( y \), we focus on the rule \( f(x) = x^2 \), which describes the output directly as a function of \( x \). This simplified notation is used very frequently in mathematics, especially when the explicit mention of \( y \) is not necessary.
\( f(x) \) is itself a number. When we write \( f(x) \), we are specifying the value of the function \( f \) at the input \( x \). It represents the output of the function, which is a single number associated with the given input.
For example, consider \( f: \mathbb{R} \to \mathbb{R} \), defined as \( f(x) = x^2 \):
- If \( x = 3 \), then \( f(3) = 3^2 = 9 \). Here, \( f(3) \) is the number \( 9 \).
- If \( x = -2 \), then \( f(-2) = (-2)^2 = 4 \). Here, \( f(-2) \) is the number \( 4 \).
In this way, \( f(x) \) is not just a symbol—it is the value of the function at \( x \), which is a specific number. For instance:
So, when we eliminate the output variable \( y \) and write \( f(x) = x^2 \), we are directly expressing the numerical output of the function \( f \) for a given \( x \). This makes the notation concise and highlights the input-output relationship without requiring an extra variable.
Domain, Co-Domain and Range
A function is a specific type of relation. While a general relation allows the domain to be the subset of the first set, consisting of all elements that have atleast one image in the second set, for a function \( f: A \to B \), the domain is always the entire set \( A \). This requirement arises from the definition of a function, which states that every element of \( A \) must have exactly one image in \( B \).
The domain of a function is the set \( A \) from which all inputs are taken. Since each element of \( A \) must have a corresponding output, the domain of a function is always \( A \) itself. For example, consider \( f: \{1, 2, 3\} \to \{1, 2, 3, 4, 5\} \), where \( f = \{(1, 1), (2, 4), (3, 1)\}\). Here, the domain of \( f \) is \( \{1, 2, 3\} \).
The codomain of a function is the set \( B \) that contains all possible outputs. It represents the target set to which the function maps elements of the domain. However, not all elements of the codomain are necessarily outputs of the function. Only those values in \( B \) that are actually mapped to by some element of \( A \) form the range of the function.
The range of a function is the set of all actual outputs of the function for inputs in the domain. It is a subset of the codomain. For instance, consider \( f: \{1, 2, 3, 4\} \to \mathbb{Z} \), where \( f = \{(1, 1), (2, 4), (3, 9), (4, 16)\}\). Here:
- The domain is \( \{1, 2, 3, 4\} \).
- The codomain is \( \mathbb{Z} \), the set of integers.
- The range is \( \{1, 4, 9, 16\} \), which are the actual outputs obtained from the elements in the domain.
The range of a function is always a subset of the codomain:
If the range equals the codomain, the function is said to be onto or surjective. Otherwise, there exist elements in the codomain that are not mapped to by the function.
For example, in the function \( f: \{1, 2, 3, 4\} \to \mathbb{Z} \), defined above, the range is \( \{1, 4, 9, 16\} \), which is strictly smaller than the codomain \( \mathbb{Z} \). This shows that \( f \) is not onto.
The distinction between codomain and range is important. The codomain is part of the function's definition and represents all possible outputs, while the range depends on the actual mappings and consists of the values that are achieved.
Range Notation
For a function \( f: X \to Y \), the notation \( f(X) \) represents the set of all outputs that \( f \) produces when applied to the elements of \( X \). In other words, \( f(X) \) is the collection of values \( y \in Y \) such that \( y = f(x) \) for some \( x \in X \).
This notation emphasizes that \( f(X) \) is a subset of the codomain \( Y \). It is specifically used to denote the collection of all outputs of \( f \) corresponding to its domain \( X \), making it a concise way to describe the actual results of the function's mapping.
Natural Domain or Exhaustive Domain of an Expression and a Function
Functions are defined using mathematical expressions, but not all such expressions are valid for all real values of \( x \). The natural domain or exhaustive domain of an expression refers to the largest subset of real numbers for which the expression remains valid and well-defined. If we define a function \(f\) using some mathematical expression, then we say that the natural domain of \(f\) is the natural domain of the correspoding expression.
For example:
- Consider the expression \( \frac{1}{x} \). Division by zero is undefined, so this expression is not valid for \( x = 0 \). Hence, its natural domain is \( \mathbb{R} \setminus \{0\} \), meaning all real numbers except \( 0 \).
- Similarly, for the square root expression \( \sqrt{x} \), the square root of a negative number is not defined in the set of real numbers. Therefore, the natural domain of \( \sqrt{x} \) is \( [0, \infty) \), which includes all non-negative real numbers.
When a function is defined using such an expression, the natural domain of the function is limited by the conditions of the expression. For example:
- If \( f(x) = \frac{1}{x} \), the natural domain of \( f \) is \( \mathbb{R} \setminus \{0\} \).
- If \( f(x) = \sqrt{x} \), the natural domain of \( f \) is \( [0, \infty) \).
Example 1
Find the natural domain of \( f(x) = \frac{1}{\sqrt{x}} \).
Here:
- The square root \( \sqrt{x} \) is undefined for \( x < 0 \), so \( x \geq 0 \).
- Division by zero is also undefined, so \( \sqrt{x} \neq 0 \), which means \( x > 0 \).
Hence, the natural domain of \( f(x) \) is \( (0, \infty) \), or all positive real numbers.
Example 2
Find the natural domain of \( f(x) = \sqrt{1 - x^2} \).
Here:
- The square root \( \sqrt{1 - x^2} \) is defined only when \( 1 - x^2 \geq 0 \), which simplifies to \( -1 \leq x \leq 1 \).
- Therefore, the natural domain of \( f(x) \) is \( [-1, 1] \), the interval where \( 1 - x^2 \) is non-negative.
Restricted Domain
The restricted domain of a function is defined when we intentionally limit the domain of the function to a proper subset of its natural domain. This is done to achieve specific properties or focus on a certain range of inputs.
For example:
- Consider \( f(x) = \sqrt{x} \), which has a natural domain of \( [0, \infty) \). If we restrict the domain to \( [0, 10] \), the function now operates only on the interval \( [0, 10] \). Here, \( [0, 10] \) is the restricted domain.
- Similarly, consider \( g(x) = \sin(x) \), which has a natural domain of all real numbers \( \mathbb{R} \). If we restrict the domain to \( [0, \pi] \), the sine function is now evaluated only on that interval.
How is codomain of a fucntion decided?
Given the domain of a function, the codomain is chosen so that it is "large enough" to include all possible outputs (the range) of the function. In other words, the range of a function must always be a subset of its codomain. This ensures that every output the function produces is well-defined within the context of the codomain.
For example, if a function produces only integers as outputs, then \( \mathbb{Z} \) (the set of integers) is a natural and optimal choice for the codomain. Choosing \( \mathbb{R} \) (the set of real numbers) in this case would be unnecessary and excessive, as it includes many values the function can never produce, such as non-integers. However, if the function can produce any real number, then \( \mathbb{R} \) is the appropriate choice because it accurately reflects the range of possible outputs.
The main idea when deciding the codomain is to balance precision and practicality. The codomain should be broad enough to fully contain the range but not unnecessarily large to include elements that are irrelevant to the function. This consideration is part of the function's definition and helps provide clarity about its behavior and purpose in the given context.
Example 1:
Define \( f: \mathbb{R} \to \mathbb{R} \), \( f(x) = x^2 \).
- The codomain is \( \mathbb{R} \) because it is specified during the definition.
- The range of the function is \( [0, \infty) \), which is the set of actual outputs.
Example 2:
Define \( g: \mathbb{R} \to \mathbb{R}^+ \), \( g(x) = x^2 \).
- Here, the codomain is \( \mathbb{R}^+ \) (non-negative real numbers), which is more aligned with the function's behavior.
- The range is still \( [0, \infty) \), and in this case, it equals the codomain.
Explicit vs Implicit Definition of a Function
A function can be defined either explicitly or implicitly, depending on how the relationship between the independent and dependent variables is expressed.
Explicit Definition
A function is said to be explicitly defined when the dependent variable (typically \( y \)) is expressed directly as a formula in terms of the independent variable (typically \( x \)). For example:
Explicit definitions are straightforward, as the dependent variable is given directly without additional constraints.
Implicit Definition
A function is said to be implicitly defined when the relationship between the independent and dependent variables is expressed as an equation that they satisfy together. In this case, the function may not be expressed directly in terms of one variable. Instead, it is defined implicitly by an equation involving both variables.
For example:
Example: \( f: [-1, 1] \to [0, \infty), \, x^{2/3} + y^{2/3} = 1 \)
Consider the equation:
where \( x \in [-1, 1] \) and \( y \in [0, \infty) \).
-
Implicit Definition:
The equation above implicitly defines \( y \) as a function of \( x \). The relationship between \( x \) and \( y \) is given indirectly through the equation, and finding \( y \) for a given \( x \) requires solving the equation:
\[ y^{2/3} = 1 - x^{2/3}, \quad x \in [-1, 1]. \] -
Explicit Definition:
To define \( y \) explicitly as a function of \( x \), we solve for \( y \) in terms of \( x \):
\[ y = \left( 1 - x^{2/3} \right)^{3/2}, \quad \text{for } x \in [-1, 1]. \]Here, \( y \) is explicitly given as a formula in terms of \( x \), and it can be evaluated directly for any \( x \) in the domain.
Key Differences
- Implicit: The function is described indirectly by an equation involving both \( x \) and \( y \). For example, \( x^{2/3} + y^{2/3} = 1 \) implicitly defines \( y \) as a function of \( x \).
- Explicit: The function is expressed directly in terms of \( x \). For example, \( y = \left( 1 - x^{2/3} \right)^{3/2} \).
Implicit definitions are often useful for describing complex relationships or curves, while explicit definitions are more practical for computation and analysis.