# Functions

### Topics

Remember: a function is a relation where each thing in the domain is matched with only one thing in the range. Another way to say this is that each *x* value gets matched with only one *y* value. We can tell simply by looking at a graph whether a relation is a function or not. We can even do it with one hand tied behind our back. This isn't super-impressive, though. Our hands are not all that involved in the seeing process.

### Sample Problem

Graph the relation *y* = *x* + 1. Is this a function?

Let's make a table of values.

When we graph these, we get

If we fill in the spaces between the points, we get a line:

Each *x* value is matched with only one *y* value, because if we go to any spot on the *x* axis and travel up or down we will never hit more than a single *y* value.

The relation *y* = *x* + 1 is a function. Woo! Are we putting the "fun" in "function, " or what? (Don't answer that.)

### Sample Problem

Graph the relation |*y*| = |*x*| for *x* ≥ 0. Is this a function?

Let's make a table of values. We are told *x* has to be at least 0, so there won't be any negative values of *x* in our table. Negative values of *y* are okay, because the problem never said we couldn't use them. A little unfair that *y* is getting more privileges, but *x* is a big boy. He'll get over it.

We can already tell this relation isn't a function, because each non-zero value of *x* is matched with two values of *y*. However, let's carry on so we can see how it is also possible to glean this by looking at our graph. It's always nice to get confirmation from a second source. In the real world, this is called "covering your butt."

If we plot the points from our table, we find

If we fill in the spaces between the points, we see

We can see that this is not a graph of a function. We can go to a spot on the *x*-axis, travel up and down, and hit two different values of *y*. Can you imagine how much you'd be wigging out if you left your house, passed an office building, continued another 10 miles in the same direction, and passed that exact same office building again? You'd think you stepped into The Twilight Zone, right? Well, now you know how this graph feels.

Since two different values of *y* are being matched with a single value of *x*, as we can see from either our table or our graph, the relation |*y*| = |*x*| for *x* ≥ 0 is not a function. Too bad, so sad.

Because we at Shmoop are total recap-aholics, let's summarize what we did in the previous examples. The goal was to look at a graph of a relation and determine if the relation was a function or not. To do this, we drew a vertical line through the graph (we went to a value of *x* and drew a line up and down) and looked to see in how many spots that line hit the points of the relation. If there was a value of *x* where the line could hit the relation more than once, we knew we didn't have a function. Okay, recap over. Hopefully, this paragraph felt like a ton of deja vu. Okay, recap over. Hopefully, this paragraph felt like a ton of deja vu.

This process of testing to see whether a relation is a function is called the **vertical line test**. Clever name, eh? To determine if a graph shows a function, we see if there's any value of *x* for which a vertical line through that value will hit the graph more than once. If there is, we don't have a function. If a vertical line can hit the graph at most once, no matter where we put it, we *do* have a function. It's pretty black and white. Like the cookie. Simple, satisfying, and most commonly bought and sold in Northeastern New Jersey. All right, our analogies could use some work.