FreeLesson 1 of 36 min read

What a function is and how its graph shows it

Learn to see a function as a rule that turns each input into exactly one output, and read its graph as a picture of that rule.

Almost every graph you meet tells a story: how the cost of a trip grows with distance, or how a ball's height changes over time. To read these stories, you need one idea first: the function. Once you understand it, a graph stops being a tangle of lines and becomes a set of answers to the question "if I put this in, what comes out?"

A rule with one output per input

A function is a rule that takes an input and gives back exactly one output. Think of a vending machine: press button B3 and you get one particular snack every time. If pressing B3 sometimes gave crisps and sometimes gave chocolate, the machine would not be behaving like a function.

We usually call the input x and write the output as f(x), read "f of x". The notation f(x) = 2x + 1 means: take the input, double it, then add 1. So f(3) means "put 3 in": 2 × 3 + 1 = 7.

From rule to table to graph

A graph is simply every input-output pair drawn as a point. The input goes along the horizontal x-axis, and the output goes up the vertical y-axis. Each point is (input, output), or (x, f(x)).

Example: drawing f(x) = 2x + 1

Step 1: choose some inputs: x = -1, 0, 1, 2.

Step 2: work out each output.

f(-1) = 2(-1) + 1 = -2 + 1 = -1

f(0) = 2(0) + 1 = 0 + 1 = 1

f(1) = 2(1) + 1 = 2 + 1 = 3

f(2) = 2(2) + 1 = 4 + 1 = 5

Step 3: write the points: (-1, -1), (0, 1), (1, 3), (2, 5).

Step 4: plot them and join them. They line up, so the graph is a straight line rising from left to right.

Check: each step of 1 in x adds 2 to the output (-1, 1, 3, 5), which matches "double it".

Reading a graph backwards

You can also use a graph to answer questions without the formula. To find f(4), start at x = 4 on the horizontal axis, go straight up (or down) to the curve, then across to the vertical axis and read the value. To ask "which input gives an output of 5?", start at 5 on the vertical axis, go across to the curve, then down to read x.

The vertical line test

Because each input has only one output, a function's graph can never have two points directly above each other. This gives a quick check called the vertical line test:

Imagine sliding a vertical line across the graph.

  • If it never crosses the graph more than once, the graph shows a function.
  • If it crosses twice anywhere, that input has two outputs, so it is not a function.
  • A circle fails the test: a vertical line through its middle hits it at the top and the bottom.
  • A horizontal line, such as y = 5, passes: every input gives the same single output.

Notice that a function may give the same output for different inputs. For f(x) = x^2, both f(2) and f(-2) equal 4. That is allowed; the rule only forbids one input having two outputs.

Graphs as stories

Example: a made-up story graph

A graph shows the temperature of a cup of tea (output) against minutes since it was poured (input).

The curve starts high, drops quickly, then flattens out.

Story: the tea cools fast at first, then cools more slowly as it nears room temperature.

It passes the vertical line test: at any one moment, the tea has exactly one temperature.

Next time you see a graph, ask three questions: what is the input, what is the output, and what happens to the output as the input grows? That habit turns any graph into a story you can retell in a sentence.

Key takeaways

  • A function gives exactly one output for each input.
  • A graph plots every pair (x, f(x)), with the input along and the output up.
  • If a vertical line can cross a graph twice, the graph is not a function.

Check your understanding

Question 1 of 3

If f(x) = 3x - 2, what is f(4)?

Choose an answer

Question 2 of 3

Which of these graphs is NOT the graph of a function?

Choose an answer

Question 3 of 3

The graph of a function g passes through the point (2, 7). Which statement must be true?

Choose an answer

Written with AI help. Spotted a mistake? Tell us.