The graph is a line: slope and intercept
Learning Objectives
- State and justify that the graph of a linear function is a straight line.
- Identify the slope \(a\) as the rise per unit run, and compute it from two points.
- Identify the \(y\)-intercept \((0, b)\) and read it off the graph.
- Sketch a linear function from its slope and intercept, using two points.
- Relate the sign and size of \(a\) to whether the line rises or falls and how steeply.
From rule to picture
In Lesson 1 we met the linear function \(f(x) = ax + b\) and proved that its rate of change is constant: between any two inputs, the output changes by \(a\) per unit of input. We also saw that \(b = f(0)\).
In the previous course we defined the graph of a function as the set of points \(\bigl(x, f(x)\bigr)\) in the Cartesian plane. So the graph of a linear function is the set
\[G_f = \{\,(x,\, ax + b) \mid x \in \mathbb{R}\,\}.\]
What shape does this set make? The answer is the reason for the name linear: it is a straight line.
The graph of a linear function is a line
Let \(f(x) = ax + b\) with \(a \neq 0\). The graph \(G_f\) is a straight line. Conversely, every line in the plane that is neither vertical nor horizontal is the graph of exactly one linear function.
We use the key fact from Lesson 1: for any two distinct inputs \(x_1 \neq x_2\), the points \(P_1 = (x_1, f(x_1))\) and \(P_2 = (x_2, f(x_2))\) satisfy
\[\frac{f(x_2) - f(x_1)}{x_2 - x_1} = a.\]
Fix two such points \(P_1, P_2\) and let \(\ell\) be the line through them. Take any other graph point \(P = (x_0, f(x_0))\). By the same fact, the ratio of vertical change to horizontal change from \(P_1\) to \(P\) is again \(a\) — the same as from \(P_1\) to \(P_2\). Through a given point, a given ratio of rise to run determines a unique direction, so \(P\) lies on \(\ell\). As \(P\) was an arbitrary point of the graph, every graph point lies on \(\ell\): the graph is contained in a line.
Conversely, the line through \((0, b)\) with rise-to-run ratio \(a\) consists exactly of the points \((x, b + ax)\), which are precisely the points of \(G_f\). So the graph is that line, not merely part of it. A vertical line is excluded because it would assign two outputs to one input (it is not a function), and a horizontal line is excluded because it has \(a = 0\) (a constant function, not first-degree).
Slope and \(y\)-intercept
Now that we know the graph is a line, the two coefficients acquire geometric names.
The coefficient \(a\) is the slope of the line. Geometrically it is the rise per unit run: moving one unit to the right (\(\Delta x = 1\)) changes the height by \(a\) (\(\Delta y = a\)). For any two points on the line, \[a = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}.\] This is exactly the rate of change of Lesson 1, now read off the picture.
The constant term \(b\) is the \(y\)-intercept: the line crosses the \(y\)-axis at the point \((0, b)\), since \(f(0) = b\).
Reading a line: \(f(x) = 2x - 1\)
Here \(a = 2\) and \(b = -1\). The \(y\)-intercept is \((0, -1)\). The slope \(2\) means: from any point on the line, going \(1\) unit right takes us \(2\) units up. Starting at \((0,-1)\) and applying this once lands at \((1, 1)\).
To plot it we needed only the two blue points; the slope triangle in red shows where the \(2\) comes from.
What the slope tells you at a glance
The sign of \(a\) decides which way the line tilts, and the size of \(|a|\) decides how steeply:
\(a > 0\): the line rises from left to right.
\(a < 0\): the line falls from left to right.
The larger \(|a|\) is, the steeper the line; a small \(|a|\) gives a gentle slope.
The intercept \(b\) does something different: changing \(b\) slides the whole line straight up or down without changing its tilt. Two linear functions with the same \(a\) have parallel graphs.
How to sketch any linear function
Because two points determine a line, sketching \(f(x) = ax + b\) takes only two steps:
Plot the \(y\)-intercept \((0, b)\).
Use the slope to step to a second point — go \(1\) right and \(a\) up (down if \(a < 0\)) — then draw the line through both.
When \(b = 0\) the function is the direct proportionality \(f(x) = ax\), whose line passes through the origin \((0,0)\); the slope alone then fixes it.
Connection to Computer Science
Drawing a straight segment between two points is one of the most basic operations a graphics program performs, and it rests on exactly this idea: once you know a starting point and a constant step (the slope), every further point is reached by repeating the same small move. The same constant-step reasoning lets a program fill in intermediate values between two known data points — moving in equal increments along a line.
Is every straight line such a graph?
It is tempting to say "linear function" and "straight line" are the same thing. They are not quite. Two families of lines are left out.
A vertical line, like \(x = 3\), is not the graph of any function at all: the input \(3\) would have infinitely many outputs, violating the uniqueness condition in the definition of a function. (This is the "vertical line test" from the previous course.)
A horizontal line, like \(y = 3\), is a function, but a constant one — its slope is \(0\), so it fails the requirement \(a \neq 0\) and is not first-degree.
So the graphs of linear functions are exactly the lines that are neither vertical nor horizontal: the genuinely slanted lines. That is what the converse half of our theorem said.
Exercises
Exercise 1
Consider \(f \colon \mathbb{R} \to \mathbb{R},\; f(x) = 3x - 2\).
Exercise 2
For each described line, choose the signs of the slope \(a\) and intercept \(b\).
Exercise 3
Decide whether each statement about graphs of linear functions is true or false.
Exercise 4
A line is the graph of a linear function and passes through \((0, 3)\) and \((2, 7)\). Find its slope and intercept.
Exercise 5
From the slope, decide whether each line rises or falls from left to right.
Summary
The graph of a linear function \(f(x) = ax + b\) is a straight line; conversely, every slanted (non-vertical, non-horizontal) line is the graph of exactly one linear function.
The slope \(a\) is the rise per unit run, \(a = \dfrac{\Delta y}{\Delta x}\) — the Lesson 1 rate of change, read off the picture. The \(y\)-intercept is \((0, b)\).
\(a > 0\) rises, \(a < 0\) falls, and larger \(|a|\) is steeper; changing \(b\) slides the line vertically. Equal slopes give parallel lines.
To sketch a line: plot \((0, b)\), step \(1\) right and \(a\) up to a second point, and draw through both. If \(b = 0\) the line passes through the origin.