Domain
The domain is the set of all inputs for which a function is defined. An input outside this set cannot be evaluated by that function.
Finding the Domain Example
This function divides by its input, and a division is defined only when its denominator is not zero:
The rule divides by the input. At input , the denominator becomes zero:
Division by zero is undefined, so is excluded while every other real number is allowed.
So, the domain of the function is all real numbers except .
Another example:
This rule takes the square root of its input. Testing gives:
Over the real numbers, a square root requires a nonnegative radicand. Therefore, only and positive inputs are allowed.
So, the domain of the function is all real numbers greater than or equal to ().
Codomain
The codomain is the target set declared as part of a function's definition. Every output must belong to this set, but the function does not have to reach every member of it.
For example, define a function .
We specify the Domain (input) as the set of natural numbers:
Then, we specify the codomain as the set of integers:
By choosing the integers as the codomain, we declare the set in which every value of must lie. For natural-number inputs, the function actually produces only positive even numbers. Those attained values form the range:
The chosen codomain is valid because every actual result in the range is an integer.
The codomain therefore describes the permitted target space. It is not a list of values the function necessarily produces.
Range
The Range is the collection of all output values that are actually produced by the function when we input all members of the domain. The Range is part of (or sometimes exactly the same as) the Codomain.
Example:
For this example, the domain and codomain of are the integers.
When we input values from the domain:
- and so on...
The values that actually come out as output are , and so on (non-negative square numbers).
So, the Range of this function (with this domain) is the set:
Notice that this range () is a part (subset) of the codomain we defined (integers):
Not all members of the codomain are part of the range.
Different Roles of Domain Codomain and Range
The domain keeps invalid inputs, such as division by zero, out of the function. The codomain declares the target space, while the range identifies the values the function actually reaches.
Mathematical Relationship
Mathematically, a function maps every element from the set Domain () to one element in the set Codomain (). This is often written as:
The Range () is the set of all actual results for every in the Domain. In other words:
The range is always a subset of the codomain:
Every value actually reached by the function must belong to the codomain. The reverse is not required: a codomain value may never occur as an output.
Check Your Understanding
Let be defined by . Answer the three questions below for this function. Start from the input that the denominator forbids, then ask which output values the fraction can reach.
- Why is excluded from the domain?
- Can belong to the range?
- State the range of .
Worked Solutions
-
At , the denominator is zero:
The expression is undefined, so cannot be in the domain.
-
No. A fraction with numerator cannot equal .
-
Every nonzero real value is reached. Given , choosing gives . Thus: