A function that becomes a straight line
The functions from the last lesson — all y = ax + b. This type has a name: a linear function. “Linea” is Latin for a line. And that is exactly its magic: when you plot its values on a graph, a straight line comes out.
You draw a graph on a coordinate grid: horizontal axis x, vertical axis y. Each row of the table of values is one point — a pair [x; y]. For a linear function all the points lie in one row like beads on a taut string.
Those two numbers in the rule have a job. The number a (next to x) is the slope: it says by how much y rises when x grows by 1. A large a = a steep line. A negative a = the line falls.
The number b (on its own) is the starting value: where the line crosses the y-axis. It is y for x = 0.
Today you will draw your first graphs and learn to read the shape of the line from the rule, before you draw it.
Ema is saving for headphones. She starts with 200 Kč and each week she adds 50 Kč. “That is a linear function,” she shows Adam, “y = 50x + 200. After x weeks I have y koruna.” She draws a graph: points [0; 200], [1; 250], [2; 300] — all in one straight row. Adam puts a ruler on it: “Really a straight line. And I can see the future too — in 10 weeks you will have 700.” Ema grins: “That is exactly why you draw it. The graph shows all the weeks at once.”
To draw a straight line two points are enough — but calculate three. The third point is a check: if it does not lie in line with the first two, there is a counting mistake somewhere.
From the rule to the graph in three steps
I will show it on the function y = 2x + 1.
Step 1: A table of at least three values. I pick simple x: 0, 1, 2. You get y: 1, 3, 5. I have points [0; 1], [1; 3], [2; 5].
Step 2: Plot the points. Point [1; 3] means: go along the x-axis to one, then up to three. A dot.
Step 3: 참여 with a ruler. All three points must lie on one straight line. If the third one ducks away, recount it — it is a counting mistake, not the ruler.
Reading the rule without drawing:
y = 3x + 2 → slope 3 (rises steeply), crosses the y-axis at height 2. y = x − 4 → slope 1 (rises gently, by 1 for 1), crosses the y-axis at −4. y = −2x + 5 → slope −2, falls (for every step right it goes 2 down), starts at 5. y = 3 → slope 0, a horizontal line at height 3. That is a linear function too, just a lazy one.
A check trick: substitute x = 0. You get exactly b. If your graph does not cross the y-axis at b, something does not match.
Example 1: draw y = x + 2
Question: Build a table and draw the graph of the function y = x + 2.
Method: Table for x = 0, 1, 2, 3:
y = 2, 3, 4, 5. Points: [0; 2], [1; 3], [2; 4], [3; 5].
I plot and join with a ruler — the line rises at 45° (the slope is 1: one right, one up).
Check: For x = 0, y should be 2 — the line really crosses the y-axis at two. It matches.
Example 2: recognise a function from the rule
Question: Decide without drawing what the graphs of y = 4x + 1, y = −x + 3 and y = 0.5x look like.
Method: I read a and b.
y = 4x + 1: slope 4 — a very steep rise. 시작 on the y-axis at height 1.
y = −x + 3: slope −1 — it falls. 시작 at height 3.
y = 0.5x: slope 0.5 — it rises gently (half up for one right). The number b is 0, so it goes through the origin [0; 0].
Answer: the first grows steeply, the second falls, the third grows gently straight from the origin.
Example 3: saving as a straight line
Question: Filip has 300 Kč and saves 40 Kč a week. Write the function, draw the graph and read off when he will have 500 Kč.
Method: Rule: y = 40x + 300 (x = weeks, y = Kč).
Table: x = 0, 2, 5 → y = 300, 380, 500.
From the table I see at once: he has 500 Kč in the fifth week. I check with an equation: 500 = 40x + 300, so 200 = 40x, so x = 5. It matches.
Answer: In 5 weeks. The graph will show this answer as the point where the line crosses height 500.
Do not forget the scale of the axes. When on the y-axis you jump in hundreds and on the x-axis in ones, the line looks a different steepness from what the slope suggests. That is fine — just have regular ticks on both axes and label them. A graph with no numbers on the axes is a picture, not a graph.
Practice: now you do it 🎲
Now try it for real. You will see all the questions at once, like on paper. 시작 with ten. When it goes well, add more.
Calculate values of linear functions — each answer is one point of the graph. Write a whole number.
On paper
Take squared paper, draw the axes and draw. A ruler is required.
-
Draw the graph of y = 2x + 1: table for x = 0, 1, 2, 3, plot, join. Check that the line crosses the y-axis at 1.
-
On the same picture draw y = 2x + 3. What do both lines have in common? (Hint: the same a.)
-
Draw y = −x + 4. Check that it falls and starts at 4.
-
From the graph of the first function read off y for x = 2.5 and check by substituting into the rule.
Now you 💪
- From the rule you can tell without drawing whether the line rises or falls.
- You know where the line crosses the y-axis (it is the number b, the value for x = 0).
- Your three points always lie on one straight line — you use the third point as a check.
Done when: You have drawn three lines with the right slope and the right crossing of the y-axis, and one value read off the graph and checked by calculation.
What to take from this lesson
- A linear function y = ax + b has a straight-line graph.
- The number a is the slope: by how much y rises when x grows by 1. Negative a = falling.
- The number b is the crossing with the y-axis — the value for x = 0.
- Two points are enough for a line, draw a third as a safety net.
- The same a = parallel lines, they only differ in the starting height.
© 2026 Ing. Martin Polak / AlgoRhino · 콘텐츠 이용 약관