15  Graphing relations

Seeing equations as pictures

You’ve checked a mobile data plan: £10 a month fixed, then £2 per extra GB. You want to know, at a glance, what you’d pay for 0, 1, 3, 5 gigabytes. You could solve an equation for each value — or you could draw a line and read off every answer at once.

That line is the graph of the equation. It doesn’t replace the algebra. It shows you the whole relationship in one picture.

15.1 What the notation is saying

15.1.1 The coordinate plane

Draw two number lines crossing at right angles. The horizontal one is the x-axis. The vertical one is the y-axis. The point where they cross is the origin — the zero of both axes.

Any point in the plane has an address: \((x, y)\), read “x across, y up”. The \(x\) tells you how far to move left or right from the origin. The \(y\) tells you how far to move up or down.

So \((3, 2)\) means: go 3 to the right, then 2 up. And \((-1, 4)\) means: go 1 to the left, then 4 up. And \((0, -3)\) means: stay on the vertical axis, go 3 down.

The two axes divide the plane into four regions, called quadrants. Top-right is Quadrant I (both \(x\) and \(y\) positive). Top-left is Quadrant II (\(x\) negative, \(y\) positive). Bottom-left is Quadrant III (both negative). Bottom-right is Quadrant IV (\(x\) positive, \(y\) negative). Most of the graphs in this chapter live in Quadrant I, where both values are positive — because most real-world quantities like cost, distance, and time don’t go negative.

Interactive: Coordinate plane explorer. Click anywhere on the grid to place a point. Watch the \((x, y)\) coordinates update and animated arrows trace the “go right, then up” path from the origin.

15.1.2 A relation as a table of pairs

A relation is any set of input-output pairs. You give it an input value, it gives back an output value.

The phone plan from the opening is a relation. Call the number of extra GB the input \(x\), and the monthly cost in pounds the output \(y\). The rule is:

\[y = 2x + 10\]

Read it as: “y equals 2 times x, plus 10.” Plug in \(x = 0\): you get \(y = 10\). Plug in \(x = 3\): you get \(y = 16\). That pair of values is the point \((3, 16)\).

Here’s the table for a few values:

\(x\) (extra GB) \(y\) (cost, £) Point
0 10 \((0, 10)\)
1 12 \((1, 12)\)
2 14 \((2, 14)\)
3 16 \((3, 16)\)
5 20 \((5, 20)\)

Plot those five points on the coordinate plane and they fall in a straight line. Every point on that line satisfies the equation. Every point off it doesn’t.

That’s the key idea: the graph and the equation are the same relationship in two different languages.

15.2 The method

15.2.1 Reading slope: rise over run

The equation \(y = 2x + 10\) has the form \(y = mx + b\).

The letter \(m\) is the slope — how steeply the line rises or falls. Read it as: for every 1 step to the right, the line goes \(m\) steps up (or down, if \(m\) is negative).

To measure slope from any two points on the line, count:

\[m = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x}\]

For the phone plan: pick \((1, 12)\) and \((3, 16)\). Rise = \(16 - 12 = 4\). Run = \(3 - 1 = 2\). Slope = \(4 \div 2 = 2\). That matches the \(2\) in front of \(x\).

Positive slope means the line goes up left-to-right — the quantity grows as \(x\) increases.

Negative slope means the line goes down left-to-right — the quantity shrinks as \(x\) increases. For a negative slope like \(-3\), the number of units down for each unit across is 3 — the size of the slope ignoring the sign. The sign tells you the direction; the number tells you how steep.

Zero slope means a flat horizontal line — the output doesn’t change no matter what the input is.

The letter \(b\) is the y-intercept — where the line crosses the y-axis. Substitute \(x = 0\) into any linear equation and you get \(y = b\). For the phone plan, \(b = 10\): the line crosses the y-axis at \((0, 10)\), meaning you pay £10 even with zero extra data. That’s the standing charge.

Why this works

Every point on a line satisfies its equation — that’s the definition of the line. So if you want to draw the line, you only need two points: the equation holds at both, and a straight line through two points is determined completely. The y-intercept \((0, b)\) is almost always the easiest first point. From there, the slope tells you how to find the next one.

15.2.2 Method 1: Graphing from a table of values

  1. Choose three or four values of \(x\) — spread them out.
  2. Substitute each into the equation to get the matching \(y\).
  3. Write down the \((x, y)\) pairs.
  4. Plot the points on the coordinate plane.
  5. Draw a straight line through them.

Use at least three points. If the third one doesn’t fall on the line through the first two, you’ve made an arithmetic error somewhere.

15.2.3 Method 2: Graphing from slope-intercept form

When the equation is written as \(y = mx + b\), you can graph it without a table:

  1. Plot the y-intercept \((0, b)\) — that’s your starting point.
  2. From that point, apply the slope: go 1 unit right, go \(m\) units up (or, if \(m\) is negative, go that many units down).
  3. Mark that second point.
  4. Draw the line through both points.
  5. Extend the line in both directions.

This is faster than a table once you’re comfortable with it.

15.2.4 Method 3: Finding the equation from a point and a slope

Sometimes you know the slope and a point on the line, but not the y-intercept. To find \(b\), substitute the known point into \(y = mx + b\) and solve.

For example: slope \(m = 2\), and the line passes through \((3, 11)\). Substitute into \(y = mx + b\):

\[11 = 2(3) + b\] \[11 = 6 + b\] \[b = 5\]

So the equation is \(y = 2x + 5\). Check: does \((3, 11)\) satisfy it? \(2(3) + 5 = 11\). Yes.

The same method works when you’re given two points instead of a point and a slope — first calculate the slope from the two points using rise over run, then substitute one of the points to find \(b\).

Interactive: Linear graph builder. Drag the sliders to change slope \(m\) and y-intercept \(b\). The line \(y = mx + b\) redraws live. The slope triangle shows the rise and run. The equation updates above the graph.

15.3 Why this works

The graph is the equation

Every pair \((x, y)\) that satisfies \(y = mx + b\) lies on the line. Every pair that doesn’t satisfy it lies off the line. The line isn’t a picture of the equation — it is the equation, drawn in space. This means you can read information off the graph the same way you’d get it from the algebra: find an \(x\) on the horizontal axis, trace up to the line, and read the matching \(y\) on the vertical axis. Or go the other way: find a \(y\), trace across to the line, read the \(x\).

This two-way reading becomes powerful when you have two lines on the same graph. Where they cross, both equations are satisfied at once — that intersection point is the solution to a system of two equations.

15.4 Worked examples

Example 1 — Distance and time (Sciences).

You cycle to school at a steady 12 km/h. Your school is 6 km away. Write an equation for your distance from school, and graph it.

Let \(x\) = time in hours since you left home. Let \(y\) = distance from home, in kilometres.

At a steady speed:

\[y = 12x\]

This is \(y = mx + b\) with \(m = 12\) and \(b = 0\).

\(x\) (hours) \(y\) (km from home)
0 0
0.25 3
0.5 6

The slope is 12 — for every hour, you cover 12 km. The y-intercept is 0 — at time zero you’re still at home. The graph is a line from the origin, rising steeply. Reading from the graph: after 0.25 hours (15 minutes) you’re 3 km along.

You arrive at school when \(y = 6\). Solve: \(12x = 6\), so \(x = 0.5\) hours. That’s 30 minutes. Confirmed by the table.

Slope = speed in a distance-time graph. This is not a coincidence — it’s exactly what slope means physically.


Example 2 — Phone plan (Finance).

Your data plan costs £8 per month fixed, plus £3 for each extra GB you use. Write and graph the monthly cost equation.

\[y = 3x + 8\]

where \(x\) = extra GB used, \(y\) = total cost in £.

Method 2 (slope-intercept): Plot \((0, 8)\) — that’s the standing charge. Slope is 3, so from \((0, 8)\) go 1 right and 3 up to \((1, 11)\). Draw the line.

\(x\) (extra GB) \(y\) (cost, £)
0 8
1 11
2 14
4 20

Reading from the graph: 3 extra GB costs £17. When does the bill hit £26? Set \(y = 26\): \(3x + 8 = 26\), so \(3x = 18\), \(x = 6\) GB. The algebra and the graph tell the same story.


Example 3 — Points scored (Sport).

A basketball player scores an average of 18 points per game. She has already played 4 games. Write a formula for her total points, and find when she’ll have 144 total.

\[y = 18x + 72\]

Wait — where does the 72 come from? She already has \(18 \times 4 = 72\) points from those 4 games. So \(b = 72\) (her running total at the start of tracking), and \(m = 18\) (she adds 18 each game).

Plot: start at \((0, 72)\) — that’s game zero from now, 72 points already. Each game adds 18. From the graph, you can see she hits 144 points after 4 more games.

Check: \(18x + 72 = 144\), so \(18x = 72\), \(x = 4\). Yes.

Slope = rate — in any graph where the y-axis tracks a total and the x-axis tracks time or count, slope is the rate of change. How fast the total grows.


Example 4 — Computing: screen coordinates.

One thing worth knowing before this example: in maths, \(y\) increases upward. On a screen — in game engines, browser graphics, and most image software — \(y\) increases downward, so \((0, 0)\) is the top-left corner. This example uses mathematical coordinates. If you’re writing actual game code, a character “moving up” would have a decreasing \(y\) value in the engine’s system.

A character starts at position \((x, y) = (50, 80)\) in mathematical coordinates and moves right at 5 pixels per frame and down at 3 pixels per frame.

After \(t\) frames: \[x = 50 + 5t \qquad y = 80 + 3t\]

These are two separate linear equations, one for each axis. After 10 frames: \(x = 100\), \(y = 110\). After 20 frames: \(x = 150\), \(y = 140\). The path is a straight line, and its slope (in these coordinates) is \(\frac{3}{5}\) — 3 units down for every 5 across.

15.5 A note on curves

All the examples above produce straight lines. But not all relationships are linear.

If you track your savings when you’re earning interest on interest, the graph curves upward — it gets steeper as time goes on. If you track how a hot drink cools, it curves downward and flattens out. A ball thrown in the air traces a curve that dips back down.

A curve on a graph means the rate of change isn’t constant. The slope isn’t fixed — it depends on where you are. That’s a very different situation from a straight line, where the slope is the same everywhere.

You’ll meet curved graphs properly when we reach polynomials and functions in Volume 3. For now, notice the difference: a straight line means a constant rate. A curve means the rate is changing.

15.6 Where this goes

The slope of a line is a constant — pick any two points and you get the same number. In Volume 3, Functions and relations makes this more precise: you’ll define a function formally, think about domain and range, and meet graphs that aren’t lines. From there, in Volume 5, Differential calculus asks a harder question: if the slope of a curve isn’t constant, what is the slope at a single point? The answer — the derivative — is built on exactly the rise-over-run idea from this chapter. You’re already holding the seed of calculus in the phrase “change in \(y\) over change in \(x\).”

The second direction is systems of equations. You’ve already seen that a linear equation graphs as a line. Two linear equations graph as two lines. If they cross, the crossing point solves both equations at once — you can read the answer off the graph, or find it algebraically. That’s the foundation of linear algebra, which appears in Volume 4 and underpins nearly everything in engineering and data science.

Where this shows up

  • A civil engineer plots a road’s vertical profile as a distance-height graph. Slope is gradient, measured in percent. Regulations specify maximum gradients for different road types.
  • A physicist reads the slope of a velocity-time graph to find acceleration. The area under the graph gives distance — a preview of integration.
  • A business analyst draws cost and revenue lines on the same graph. The crossing point is break-even: the number of units where cost equals revenue.
  • A game developer uses \((x, y)\) coordinates to position every object on screen. Movement is addition; rotation involves trig — which also starts with the coordinate plane.

15.7 Exercises

These are puzzles. Each one has a clean answer. The work is reading the situation carefully, building the equation, and deciding whether the graph or the algebra gives you what you need faster.

  1. A streaming service costs £6 per month. A rival service costs £2 per month plus £1 per film watched. Write equations for both costs and find how many films per month makes them equal. Which service is cheaper if you watch 5 films a month?
  1. A delivery driver starts a shift with a full tank holding 60 litres. She uses fuel at 0.08 litres per kilometre. Write an equation for fuel remaining after \(x\) km. What is the slope, and what does it mean in context? How far can she drive before the tank is empty?
  1. Two friends start at the same place and walk in opposite directions. Priya walks at 5 km/h; Jordan walks at 4 km/h. Write an equation for the distance between them after \(t\) hours. What is the slope? After how long are they 13.5 km apart?
  1. A runner’s training log shows she ran 15 km in week 1 and increases her distance by 2 km each week. Write an equation for total distance run after \(w\) weeks of training (not counting week 1 as week 0 — let week 1 be \(w = 1\)). Plot the first six weeks. In which week does she first exceed 100 km total?
  1. A line passes through the points \((2, 7)\) and \((5, 13)\). Find the slope. Then substitute one of the points into \(y = mx + b\) to solve for the y-intercept \(b\), and write the full equation. Check your equation works for both original points.
  1. A line has slope \(-2\) and passes through \((3, 4)\). Substitute the point into \(y = mx + b\) to find \(b\), then write the full equation. Find where the line crosses the x-axis (the point where \(y = 0\)).
  1. Two phone plans are graphed below — but the graph has been removed. Plan A: \(y = 4x + 5\). Plan B: \(y = 2x + 15\). Without drawing the graph, find the value of \(x\) where the plans cost the same. Which plan is cheaper for someone using 4 units? Which for someone using 8 units?