What is a Function in Algebra?
Basics of Functions
The next major topic we’re going to look at is functions. Now a function is kind of an abstract concept, but we can think of it as a box, a box where we put a number in on this side, and we get out a number on this side. For instance, we might put in a 2 and get out a 5. Or we might put in a 3 and get out an 8. And so for any number that we put in on one side of the function, we get out a number on the right.
Now, it might be the same number that we put in, for instance, we can put in a 4 and we might get out a 4, and that’s ok. The key feature of a function is that for each number that you put in, there’s only one number that you can get out. So, every time you put in a 2, you’re going to get a 5. It can’t be sometimes a 5 and sometimes a 4 and sometimes an 8. Every time you put in a 2, you would have to get a 5 out, if this were the function. Now, you could have a 2 that gives you a 5, and you could have a 1 also giving you a 5. And that’s ok. Different input numbers can give you the same output number, but one input number can never give you more than one output number, and so that’s a key thing to remember about functions. Everything that goes into a function is called the domain. The domain is the set of all numbers that can go into a function and get a number out. There are some functions for instance where you might not be able to put in a negative one. If you tried to put in a negative one, you wouldn’t get anything out because the function wouldn’t be defined for that number, and so the domain is the set of all numbers for which the function can give you an output. And then on the output side, you have what’s called the range. And the range is the set of all numbers that can be outputs for the function.
Some functions won’t give you negative numbers for an output, and so if the function can give you an output of all real numbers except negative numbers, then your range is going to include only those positive numbers that the function can put out. And so functions can be described in several different ways. They can be described in a table, for instance. You might have inputs and outputs. And, just going off of what we have here, you might put in a 1, get a 5, put in a 2 get a 5, put in a 3, get an 8, put in a 4 get a 4. And you can define a function entirely with a table. But this is a rather limited way to do things because you’d have to list each individual input that you want you be able to use the function for. The more common way to describe a function, and the way that we’re going to focus on as we move forward is a function defined by mathematical equation. And the nomenclature we’re going to use to describe that is f for the function and then the input of the function in parenthesis. So we would read this as f of x where x is the input variable. And so we have f of x and this is equal to some function of x. So let’s say we have 3x-2. And so this function has an input of x, x can be any real number. So the domain of x, or the domain this function is any real number because any real number can be put into this equation and give us a real number output.
And the range of this function, because this is linear, we just have a single value for x, this is a linear function, and so it extends to infinity in both directions on the output side as well, and so our range is also the set of all real numbers. Just to give you a couple of examples with limited domains and ranges, for instance if we have the function f of x equals the square root of x minus 2, if x is less than 2, we have the square root of a negative number here, and that won’t give us a real value for f of x, and so the domain for this function is going to be all real numbers 2 or greater, and that’s the set of numbers that will give us a valid output. The range for this function will start at 0 because if we have x=2, this function will equal 0, and it will go all the way up to infinity because x can extend all the way to infinity as well, and so the range for this function is from 0 to infinity, and the domain of the function is from 2 to infinity.
So that’s an example of a limited domain and range on a function. And a function really can be thought of as just a simple two variable equation, but a function we will be using the function as a means to introduce more complicated types of equations. You can think of this, if you want to, f of x, you can think of this y=3x-2 or y=square root of x minus 2, but the function this is the nomenclature we’re going to use as we move forward in functions.