The previous articles showed us how to define a function and how to draw a graph of a function.
The Domain of a Function
This article will be about the magical “for all x” part in the function definition:
Why is it there? Let’s suppose two functions defined by this table:
f_{1}: Input | f_{1}: Output | f_{2}: Input | f_{2}: Output | |
---|---|---|---|---|
1 | 1 | 1 | 1 | |
2 | 4 | 2 | 4 | |
3 | 9 | 3 | 9 | |
4 | 16 | 4 | 16 | |
5 | 25 | 5 | 25 | |
6 | 36 |
We have two functions, f_{1} and f_{2}. Are they same (except for the name)? We can see that f_{1}(2) = 4 as well as f_{2}(2) = 4. This equality holds for each number from 1 to 5. But still, there is input 6. f_{1}(6) = 36 but there is no output for f_{2}(6). We say that the function f_{2} is not defined for input x = 6. This means that the two functions f_{1} and f_{2} are not the same. They are different functions.
The magical formula “for all x” tells us for which x is the function defined. When we described what is a function we said that A function is a rule that assigns one real number to another real number. It means that function can be defined for all real numbers. But it also means that a function can be defined for some subset of real numbers.
Our first example of a function was a function that converts inches to centimeters. We can now define this function f this way:
I intentionally forgot the “for all” part. Clearly, we can compute the output value of input value − 10 if we want: f( − 10) = − 25.4. But does it make sense? Remember, this function convert inches to centimeters. Does it make sense to convert minus ten inches to centimeters? Can your brand new 4K 3D TV has screen size of minus 42 inches? You can have TV which is ten inches smaller than your neighbour’s TV but you cannot have negative size TV screen.
In the end, you can convert just non-negative number of inches to centimeters. It doesn’t make much sense to convert negative number of inches to centimeters. Thus we can define our function f properly this way:
We restricted our function just to non-negative numbers. Now we can compute f(10) but the value f( − 4) is not defined. The set of real numbers for which is function f defined is called domain of the function f and it’s denoted by D(f).
We can say that the domain of the function f is the set of all non-negative real numbers. We can go back to our function f_{1} and f_{2} defined by the table. The domain of these functions are values from its first column. Thus
The set of numbers for which is function f_{1} defined is the set {1, 2, 3, 4, 5, 6}. And it’s exactly the first column from the table. For the second function we have
We can restrict the domain as we want. It’s entirely up to us. On the other hand we usually do not restrict the domain unless it’s necessary. Thus sometimes we don’t write the magic formula “for all x”. We write just
with meaning “for all x for which the function makes sense”. And the converse: if you see an exrsice in which you should find “the domain of a function”, it means find the greatest domain. Thus the domain of a function f is the set of all possible inputs of this function.
The Image of a Function
If a domain is a set of all inputs, then the range of a function is set of all its outputs. Let’s look back to our functions f_{1} and f_{2} defined above. We know that the domain of f_{1} is D(f_{1}) = {1, 2, 3, 4, 5, 6} and it’s the first column of the table that defines the function. The range is the second column, the outputs. Thus the range of the function f_{1} is equal to {1, 4, 9, 16, 25, 36} and the range of f_{2} is equal to {1, 4, 9, 16, 25}.
Be aware: sometimes the word range is used instead of the word image. So when you see the term the range of a function it probably means the same as the image if a function.
Determining the Domain and the Image From the Graph
Each function has its own graph. Let’s take an example, the
function. The graph follows:
We can find the domain as follows: choose a point on horizontal axis, for example x = 4. Now draw a straight vertical line through this point. If this line intersect the graph, the point x is included in the domain. Otherwise it’s not.
As you can see the vertical line does intersect the graph thus the point x is part of the domain. We can do it for all points on the horizontal axis. We’ll find out that all points are included in the domain and the domain are all real numbers.
What about the image? It’s the same, just for different axis. We choose a point on vertical axis and we draw a straight horizontal line and if this line intersects the graph, the point is part of the image. We can test for y = 2 and for y = − 1:
We can see that the horizontal line for the point y = 2 intersects the graph, the other line does not. It means that the number 2 is part of the image and the number 1 is not. If we try it for all point on vertical axis we’ll find out that the image of this function is all non-negative real numbers.
Exercise
Find the domain and the image of the following functions.
This one is easy. Can we substitute x for each real number? Yes, we can! Thus the domain of this function is ℝ, the whole set of real numbers.
What about the image? First, we convert the function definition to a equation: y = 4x − 3. It’s just the matter of notation, because usually f(x) = y. Then we solve the equation for x.
Can we substitute the y for each real number? Yes, we can. Thus the image of f is the whole set of real numbers again. We can draw the graph to verify our results:
We can see that the graph is a straight line the goes to infinity.
Can we substitute x for each real number? No, we cannot since we cannot divide by zero. Thus the denominator cannot be equal to zero:
The domain of the function are all real number except of 2. Now the image. Again, we convert it to equation and solve it for x:
Can we substitute y for each real number? No, we cannot. The denominator must not be zero, thus the image of this function is all real number except of 0. We can draw the graph to verify our results:
The only number that is not part of the domain is the number − 2 and it’s the point on horizontal axis for which the vertical line (the grey dashed line) does not intersect the graph. The only number that is not part of the image is the number 0 and it’s exactly the point on vertical axis for which the horizontal axis does not intersect the graph. All correct.