Functions in math can be one of the most confusing topics for the newbie.

I remember struggling this was a totally dreaded topic in high school.

So here’s an explanation that might help with that.

A function is like a vending machine. It takes inputs, and it spits out outputs.

Picture a vending machine like this one:

Surely you’ve seen one of these beastly contraptions sometime.

Ok, now notice how the vending machine has INPUTS: which are just the buttons on the keypad.

Now, to get an **output** out of the vending machine, what you do is, you put in the correct amount of money ($1), then you **input** the correct keycode.

So assume that the blue Crunch bar is what I want. It costs $1 and the keycode for it is D3.

So the INPUT is the keycode D3. The OUTPUT is the CRUNCH BAR. The idea of a FUNCTION is that a FUNCTION is something that takes your INPUT, and spits out some OUTPUT, depending on the value you inputted.

So the vending machine IS a FUNCTION. It takes your INPUT (keys pressed), and depending on what keys you pressed, it gives a different OUTPUT (some kind of candy bar).

So::::: Remember this: A FUNCTION is what RELATES the INPUT VALUE to the OUTPUTTED VALUE.

So somewhere inside that vending machine, is a FUNCTION that looks at the keys you INPUTTED and then OUTPUTS the correct chocolate bar or bag of chips or whatever.

## But what about MATH functions?

Math functions are easy. Let’s do this by example. Say I have a function:

f(x) = 3x + 5

You have to get used to the notation. Whenever you see something like that, then the whole thing in the box just above this line is called a MATHEMATICAL FUNCTION.

Now, that MATHEMATICAL FUNCTION is really just like our vending machine, if you think about it. The mathematical function has an INPUT (the value of x!), and it has an OUTPUT (the value of f(x)!)

## Input? Output?? wtf?

f(x) = 3x + 5

Just watch what I’m doing here and try to follow along.

I am going to find the OUTPUT of the function f(x) when the INPUT is 2.

f(2) = 3(2) + 5

f(2) = 6 + 5

f(2) = 11

Therefore, the OUTPUT of the function f(x) is 11 when the INPUT is 2.

Let’s take it one line at a time.

The first thing you do, is you take the formula

f(x) = 3x + 5

Now, you are asked to find the OUTPUT of the function f(x) when the INPUT is 2.

INPUT IS 2 just means that you have to take the original formula

f(x) = 3x + 5

and REPLACE ALL THE x’s WITH 2’s.

f(2) = 3(2) + 5

Then you can just see that its plain old math as usual from here. 3 times 2 plus 5 is 11.

f(2) = 6 + 5

**f(2) = 11**

## Domain and Range

Take another look at the vending machine up top.

Notice that the vending machine has keys A to J and then number keys 0 to 9.

If you’ve ever used one of these things, then you know the vending machine only accepts inputs such as A1, A2, D2, or D5, or E9. So the vending machine only accepts your INPUT if you punch in a LETTER, then a NUMBER. You can’t punch in AA, for example. The vending machine wouldn’t understand that because it has no candy bar that it knows to give you for AA.

That is exactly the idea of DOMAIN. The DOMAIN of a FUNCTION IS the set of all INPUTS that the function UNDERSTANDS and CAN give you an OUTPUT for.

What’s the range then? The RANGE is the set of all possible OUTPUTS of the FUNCTION.

So the range of the vending machine above is SOMETHING LIKE:

{ Lays, Ruffles, Fritos, Cirspys, Rold Gold, Crunch, Snickers, Butterfingers . . . } (it goes on but you get the picture)

So looking again at another MATHEMATICAL FUNCTION, let’s find the domain and range of it:

f(x) = 1/x^{2}

What you have to do to determine the DOMAIN of f(x) is just think. Are there any INPUT values of x that I can choose for which f(x) will not have a proper value?

In fact, for f(x) = 1/x, the DOMAIN is {x | x is an element of the set of ALL REAL NUMBERS, x != 0}

x cannot be zero, because 1/0 is undefined (+infinity).

the RANGE is going to be the set of all values that f(x) can *take on*. Think about what I mean by “take on”. . I mean the set of all possible values that f(x) can have as a result as we give it different values of x.

The range can be harder to know. For the vending machine example, its really easy to know what the range is. You just look through the glass and see the set of all outputs that the vending machine can produce.

For a MATHEMATICAL FUNCTION, the analysis is a bit tougher.

For

f(x) = 1/x^{2}

We know that as x takes on values from (-minus infinity, plus infinity), f(x) takes on values from just above 0 (when x is extremely large in magnitude), to positive infinity (when x is extremely small in magnitude).

So

Range = { y | y > 0, y is an element of the real numbers }

Hmm. You might be a bit confused at this point.

It will eventually make sense. Toss the ideas around in your head and you will get it.

GOOD LUCK AND KEEP AT IT!!

Remember, a function is a vending machine.