Functions and Graphs
Understand functions and graphs: function notation f(x), domain and range, plotting linear and quadratic graphs, gradient and intercepts, with full worked examples.
Key takeaways
- A function gives exactly one output for each input
- f(x) notation means 'the value of the function at x'
- A linear graph y = mx + c is a straight line with gradient m and intercept c
- A quadratic graph y = axΒ² + bx + c is a U-shaped parabola
What is a function?
A function is a rule that takes an input, applies an operation, and produces exactly one output. Think of it as a machine: you feed in a number, and a single number comes out. The key requirement is that the same input always gives the same single output β one input can never produce two different answers.
For example, the rule "double the number and add 3" is a function. Put in 4, you get 4 Γ 2 + 3 = 11. Put in 4 again, you always get 11. That predictability is what makes it a function.
This topic ties together a lot of algebra β if equations of straight lines are new to you, the lesson on the coordinate plane shows how points and lines are plotted, and solving linear equations covers the algebra you will lean on here.
Function notation: f(x)
Instead of always writing y, we often name a function with a letter like f and write f(x), read as "f of x". This means "the output of function f when the input is x". It is not f multiplied by x.
If f(x) = 2x + 3, then:
f(4) = 2(4) + 3 = 11f(0) = 2(0) + 3 = 3f(β1) = 2(β1) + 3 = 1
The advantage of this notation is clarity: f(4) instantly tells the reader "evaluate the function at 4." You can also have several functions at once β f(x), g(x), h(x) β without confusion.
Worked example: Given g(x) = xΒ² β 5, find g(3) and g(β2).
g(3) = (3)Β² β 5 = 9 β 5 = 4.g(β2) = (β2)Β² β 5 = 4 β 5 = β1(remember a negative squared is positive).
Domain and range
- The domain is the set of inputs you are allowed to use (the x-values).
- The range is the set of outputs that result (the y-values).
For f(x) = 2x + 3 with any real number allowed, the domain is "all real numbers" and the range is also "all real numbers," because doubling-and-adding can reach any value. But for f(x) = xΒ², the outputs are never negative (a square is always β₯ 0), so the range is y β₯ 0 even though the domain is all real numbers.
Plotting a function: the table-of-values method
To draw any function, make a table of input values, calculate each output, then plot the points and join them.
Worked example: Plot y = 2x + 1 for x from β2 to 2.
| x | y = 2x + 1 | Point (x, y) |
|---|---|---|
| β2 | 2(β2) + 1 = β3 | (β2, β3) |
| β1 | 2(β1) + 1 = β1 | (β1, β1) |
| 0 | 2(0) + 1 = 1 | (0, 1) |
| 1 | 2(1) + 1 = 3 | (1, 3) |
| 2 | 2(2) + 1 = 5 | (2, 5) |
Plot those five points and you will see they line up perfectly β a straight line. Functions that graph as straight lines are called linear functions.
Linear functions: y = mx + c
Every straight-line graph can be written as:
y = mx + c
- m is the gradient (slope): how steep the line is. A bigger m means a steeper line; a negative m means the line goes downhill.
- c is the y-intercept: where the line crosses the y-axis (the value of y when x = 0).
In y = 2x + 1, the gradient is 2 and the y-intercept is 1, which matches the table: the line crosses the y-axis at (0, 1) and rises 2 for every 1 step right.
Finding the gradient from two points
The gradient is the change in y divided by the change in x ("rise over run"):
m = (yβ β yβ) / (xβ β xβ)
Worked example: A line passes through (1, 4) and (3, 10). Find its gradient.
m = (10 β 4) / (3 β 1) = 6 / 2 = 3.- The line rises 3 units for every 1 unit across, so the gradient is 3.
Quadratic functions: y = axΒ² + bx + c
When a function contains an xΒ² term, its graph is no longer straight β it is a parabola, a smooth U-shaped curve. These are the graphs of quadratic equations.
Worked example: Plot y = xΒ² for x from β3 to 3.
| x | y = xΒ² | Point |
|---|---|---|
| β3 | 9 | (β3, 9) |
| β2 | 4 | (β2, 4) |
| β1 | 1 | (β1, 1) |
| 0 | 0 | (0, 0) |
| 1 | 1 | (1, 1) |
| 2 | 4 | (2, 4) |
| 3 | 9 | (3, 9) |
Plotting these gives a symmetrical U with its lowest point (the vertex) at the origin (0, 0). Notice the symmetry: the values mirror around x = 0.
Key features of a parabola:
- If a > 0, it opens upward (a valley) with a lowest point.
- If a < 0, it opens downward (a hill) with a highest point.
- The points where it crosses the x-axis are the roots β the solutions to
axΒ² + bx + c = 0.
Reading information from a graph
A graph instantly reveals important features:
- The y-intercept is where the curve meets the y-axis (set x = 0).
- The x-intercepts (roots) are where it meets the x-axis (set y = 0).
- The maximum or minimum is the highest or lowest point of the curve.
- Where the line is steeper, the quantity is changing faster.
This is exactly why scientists, economists and engineers graph their data: a single picture summarises how one quantity depends on another.
Where functions are used
Functions describe how one thing depends on another, so they are everywhere. A phone plan where cost depends on data used is a function. The distance a car travels as a function of time. The temperature of a cooling drink over time. Profit as a function of price. Whenever you hear "this depends on that," there is a function lurking β and a graph that brings it to life.
Practice activity
- Given
f(x) = 3x β 2, findf(0),f(2), andf(β1). - Make a table and describe the graph of
y = βx + 4for x from 0 to 3. What is the gradient and y-intercept? - A line passes through (2, 5) and (6, 13). Find its gradient.
- For
g(x) = xΒ² + 1, findg(0),g(2), andg(β3). Is the smallest output 0 or 1?
Answers:
f(0) = β2;f(2) = 3(2) β 2 = 4;f(β1) = 3(β1) β 2 = β5.- Points: (0, 4), (1, 3), (2, 2), (3, 1) β a straight line going downhill. Gradient = β1, y-intercept = 4.
m = (13 β 5)/(6 β 2) = 8/4 = 2.g(0) = 1,g(2) = 5,g(β3) = 10. The smallest output is 1, because xΒ² is never negative, so xΒ² + 1 is never below 1.
Summary
A function gives exactly one output per input, written compactly as f(x). The domain is the allowed inputs and the range is the resulting outputs. Linear functions y = mx + c graph as straight lines with gradient m and y-intercept c; quadratic functions y = axΒ² + bx + c graph as parabolas. Plotting a table of values, then reading off intercepts and turning points, turns abstract formulas into pictures you can understand at a glance.
Quick quiz
Test yourself and earn XP
What makes a relationship a function?
A function maps each input to exactly one output. If one input could give two outputs, it is not a function.
If f(x) = 2x + 3, what is f(4)?
Substitute x = 4: f(4) = 2(4) + 3 = 8 + 3 = 11.
In y = mx + c, what does c represent?
c is the y-intercept β where the line crosses the y-axis (when x = 0).
What shape is the graph of y = xΒ²?
Any quadratic function graphs as a parabola, a smooth U-shaped curve.
A line passes through (0, 2) and (1, 5). What is its gradient?
Gradient = change in y / change in x = (5 β 2)/(1 β 0) = 3/1 = 3.
FAQ
A function is a rule that takes an input, does something to it, and gives back exactly one output β like a machine where the same input always produces the same result.
The domain is the set of allowed inputs (x-values) you can put into a function. The range is the set of outputs (y-values) that come out.
A graph shows the whole behaviour of a function at a glance β where it rises, falls, crosses the axes, and reaches its highest or lowest point β which is far clearer than a list of numbers.
Keep exploring
More in Math