DoAssignment study guide
C4.4 · Determine equations of lines and solve problems
Learn to determine equations of lines and solve problems through clear examples and targeted practice.
Ontario Grade 9 Mathematics
Algebra
Writing and Using Linear Equations to Solve Problems (MTH1W – C4.4)
Every straight-line relationship follows a rule. That rule is the equation of the line. Once you know the equation, you can answer questions like "How much will I earn after 7 hours?" or "When will two phone plans cost the same?" This lesson shows you how to find that equation from different starting points — a graph, a table, or two pieces of information — and how to use it to solve problems. You already know how to plot points and substitute values into formulas; those skills are all you need to get started.
What you will learn
- Identify the slope and y-intercept of a line from a graph, a table of values, or a description, and use them to write the equation of the line in the form y = mx + b.
- Determine the equation of a line when given two points, by first calculating the slope and then finding the y-intercept.
- Use the equation of a line to solve real-world problems by substituting known values and interpreting the result in context.
What You Need to Remember First
A linear relation produces a straight-line graph. Every straight line has two key features: its slope and its y-intercept. You need both features to write the equation of the line.
The slope tells you how steep the line is and in which direction it goes. Slope is calculated by dividing the rise (vertical change) by the run (horizontal change) between any two points on the line. In symbols: slope = rise ÷ run. A positive slope means the line goes up from left to right. A negative slope means it goes down.
The y-intercept is the value of y where the line crosses the y-axis — in other words, the point where x = 0. It is usually written as the letter b.
The equation y = mx + b is called slope-intercept form. Here, m stands for the slope and b stands for the y-intercept. Every point (x, y) on the line satisfies this equation. When you know m and b, you can write the equation immediately.
- Slope = rise ÷ run = (change in y) ÷ (change in x).
- The y-intercept b is the y-value when x = 0.
- The slope-intercept form of a line's equation is y = mx + b.
- A positive slope rises left to right; a negative slope falls left to right.
- A horizontal line has slope 0; a vertical line has an undefined slope.
Finding the Equation from a Graph or Table
When you have a graph, pick two points that sit exactly on grid intersections so you can read their coordinates precisely. Count the rise and the run between them to find the slope. Then read the y-intercept directly from the graph — it is the y-value where the line crosses the vertical axis. Substitute m and b into y = mx + b and you have the equation.
When you have a table of values, the process is the same. Choose any two rows. Subtract the y-values to get the rise and subtract the matching x-values to get the run. Divide rise by run to get m. To find b, substitute m and one known point (x, y) into y = mx + b, then solve for b.
Consider the table below. The y-values increase by 4 every time x increases by 1, so the slope is m = 4. When x = 0, y = 3, so b = 3. The equation is y = 4x + 3. You can verify this by checking every row: when x = 2, y = 4(2) + 3 = 11 ✓.
- From a graph: read two grid-intersection points, calculate slope, read the y-intercept.
- From a table: calculate slope from any two rows, then substitute one point to solve for b.
- Always verify your equation by substituting a second point from the table or graph.
- If the table does not include x = 0, you must substitute to find b — do not guess.
Finding the Equation from Two Points
Sometimes you are given only two points and no graph. The strategy is a two-step process: first find the slope, then find the y-intercept.
Step 1 — Find the slope. Label the two points as (x₁, y₁) and (x₂, y₂). Calculate m = (y₂ − y₁) ÷ (x₂ − x₁). It does not matter which point you call 'point 1' — the answer will be the same either way.
Step 2 — Find the y-intercept. Take the slope m you just found. Substitute m and the coordinates of either point into y = mx + b. Then solve the resulting equation for b using the same algebra skills you used in Grade 8.
For example, suppose you are told a line passes through (2, 7) and (5, 13). The slope is m = (13 − 7) ÷ (5 − 2) = 6 ÷ 3 = 2. Now substitute m = 2 and the point (2, 7): 7 = 2(2) + b, so 7 = 4 + b, so b = 3. The equation is y = 2x + 3. Checking with (5, 13): 2(5) + 3 = 13 ✓.
- With two points, always find slope first, then find b.
- Substitute either given point into y = mx + b to solve for b.
- Verify your equation by substituting the other point.
- The labelling of point 1 and point 2 does not change the slope value.
Using the Equation to Solve Problems
Once you have the equation of a line, you can use it to answer questions about the situation it models. If you know x and want to find y, substitute x into the equation and evaluate. If you know y and want to find x, substitute y and solve the equation for x.
Suppose a cell phone plan charges a flat monthly fee of CAD 15 plus CAD 0.10 per text message. Let x be the number of texts and y be the total monthly cost in dollars. The equation is y = 0.10x + 15. To find the cost for 80 texts: y = 0.10(80) + 15 = 8 + 15 = 23. The plan costs CAD 23. To find how many texts you can send if you have CAD 25: 25 = 0.10x + 15, so 0.10x = 10, so x = 100 texts.
Always end a word problem by writing a sentence that answers the question in context. Include the correct units (dollars, hours, kilometres, etc.) and check whether your answer makes sense.
- To find y, substitute the known x-value and evaluate.
- To find x, substitute the known y-value and solve the equation for x.
- Label variables clearly before writing the equation.
- Answer in a full sentence with correct units.
- Check: does your numerical answer make sense for the situation?
Special Lines: Horizontal and Vertical
Two special cases come up often and are easy to confuse. A horizontal line has the same y-value for every x-value. Its slope is 0, so its equation is simply y = k, where k is that constant y-value. For example, the line passing through (0, 4), (3, 4), and (−2, 4) has equation y = 4.
A vertical line has the same x-value for every point on it. Because every step along it has a run of 0, dividing by 0 is undefined, so vertical lines do not have a defined slope. The equation of a vertical line is x = k, where k is the constant x-value. For example, the line through (−3, 0), (−3, 5), and (−3, −2) has equation x = −3.
These two cases do not fit y = mx + b exactly, so recognise them by their constant coordinate and write their equations in the simpler x = k or y = k form.
x = k or y = k
- Horizontal line: slope = 0, equation is y = k.
- Vertical line: slope is undefined, equation is x = k.
- Vertical lines cannot be written in y = mx + b form.
- Identify these special cases before trying to calculate slope.
Reading the Equation from a Table of Values
| x | y | Change in y (rise) | Change in x (run) | Slope m = rise ÷ run |
|---|---|---|---|---|
| 0 | 3 | — | — | — |
| 1 | 7 | 4 | 1 | 4 |
| 2 | 11 | 4 | 1 | 4 |
| 3 | 15 | 4 | 1 | 4 |
| 4 | 19 | 4 | 1 | 4 |
Worked example
Finding a Line Equation from Two Points — A Real-World Problem
A dog-walker charges a fixed booking fee plus an hourly rate. She charged a customer CAD 22 for 2 hours and CAD 40 for 5 hours. Write the equation that models her total charge y (in dollars) for x hours of walking, then determine how much she would charge for a 4-hour walk.
- Identify the two pointsThe problem gives two (hours, charge) pairs. Write them as coordinate points so you can use the slope formula. The first pair, 2 hours for CAD 22, becomes point 1. The second pair, 5 hours for CAD 40, becomes point 2.(x_1, y_1) = (2, 22) and (x_2, y_2) = (5, 40)
- Calculate the slopeThe slope m equals the change in y divided by the change in x. Subtract the y-values to get the rise, and subtract the matching x-values to get the run. The slope tells you the hourly rate — how much the charge increases per extra hour.
- Substitute one point to find the y-intercept bUse point 1, (2, 22), and the slope m = 6. Substitute both into y = mx + b, then isolate b by subtracting 12 from both sides. The value of b represents the fixed booking fee — the charge when x = 0 hours of walking.
- Write the equationNow that you know m = 6 and b = 10, substitute both values into y = mx + b to write the complete equation.
- Verify with the second pointAlways check your equation with the point you did not use to find b. Substitute x = 5 into the equation and confirm you get y = 40.
- Answer the problem: find the charge for 4 hoursSubstitute x = 4 into the equation and evaluate. This gives the total charge for a 4-hour walk.
Answer: The equation is y = 6x + 10. A 4-hour walk costs CAD 34.
Check: The fixed fee is CAD 10 and the hourly rate is CAD 6. For 4 hours: CAD 10 + 4 × CAD 6 = CAD 10 + CAD 24 = CAD 34. This is between the two known data points (CAD 22 for 2 h and CAD 40 for 5 h) and follows the same pattern, so the answer is reasonable.
Common mistakes and how to avoid them
Subtracting the y-values and x-values in different orders when calculating slope, for example writing (y₂ − y₁) ÷ (x₁ − x₂) instead of (y₂ − y₁) ÷ (x₂ − x₁). This flips the sign of the slope.
Correction: Always keep the same order in the numerator and denominator. If you subtract point 1 from point 2 on top, subtract point 1 from point 2 on the bottom as well.
Reading the y-intercept from a table when x = 0 is not in the table. Students sometimes take the first y-value in the table and call it b even when the first x-value is not 0.
Correction: The y-intercept b is only the y-value when x = 0. If x = 0 is not shown, substitute the slope and any table point into y = mx + b and solve for b algebraically.
Forgetting to substitute m when solving for b. For example, after finding m = 3, a student writes y = b instead of y = 3x + b before substituting a point.
Correction: Write the full equation y = mx + b with the slope already filled in before substituting the point. That way b is the only unknown.
Confusing the equations of horizontal and vertical lines — writing y = k for a vertical line or x = k for a horizontal line.
Correction: A horizontal line is flat, so y stays the same (y = k). A vertical line is upright, so x stays the same (x = k). Check which coordinate is constant, then write that variable equal to that constant value.
Giving only a numerical answer to a word problem without including units or a sentence, for example writing '34' instead of 'The 4-hour walk costs CAD 34.'
Correction: Always re-read the question, identify the units asked for, and write a complete sentence. This ensures the number is interpreted correctly in context.
Lesson summary
- The equation of a straight line is written in slope-intercept form as y = mx + b, where m is the slope and b is the y-intercept.
- Slope is calculated as (change in y) ÷ (change in x) between any two points on the line.
- To find the equation from two points: calculate m first, then substitute m and one point into y = mx + b and solve for b.
- Always verify your equation by substituting a second known point and confirming the equation is satisfied.
- Use the equation to solve problems by substituting a known value for x or y and solving for the other variable. Include units and a sentence in your answer.
- Horizontal lines have slope 0 and equations in the form y = k. Vertical lines have undefined slope and equations in the form x = k.
Check your understanding
Question 1
A line passes through (0, −4) and has slope 3. What is the equation of the line?
- y = −4x + 3
- y = 3x + 4
- y = 3x − 4
- y = −3x − 4
Show answer and explanation
y = 3x − 4
The slope is m = 3 and the y-intercept is b = −4 (because the line passes through (0, −4), which is the point where x = 0). Substituting into y = mx + b gives y = 3x − 4.
Question 2
A line passes through the points (1, 5) and (3, 11). What is the slope of this line?
- 2
- 3
- 8
- 6
Show answer and explanation
3
Slope = (11 − 5) ÷ (3 − 1) = 6 ÷ 2 = 3. The rise is 6 and the run is 2, giving a slope of 3.
Question 3
A parking garage charges a flat entry fee plus an hourly rate. The total cost for 1 hour is CAD 8 and for 4 hours is CAD 17. Using the equation of the line that models this situation, how much does 6 hours of parking cost?
- CAD 23
- CAD 26
- CAD 20
- CAD 29
Show answer and explanation
CAD 23
First find the slope: m = (17 − 8) ÷ (4 − 1) = 9 ÷ 3 = 3. Then find b using (1, 8): 8 = 3(1) + b, so b = 5. The equation is y = 3x + 5. For 6 hours: y = 3(6) + 5 = 18 + 5 = 23. The cost is CAD 23.
Question 4
Which of the following is the equation of a vertical line passing through the point (−2, 7)?
- y = 7
- y = −2
- x = 7
- x = −2
Show answer and explanation
x = −2
A vertical line has a constant x-value for every point on it. Since the line passes through (−2, 7), the x-value is always −2. The equation is x = −2. The y-value (7) belongs to just one point on the line, not to every point.
Key terms
- Linear relation
- A relationship between two variables that produces a straight-line graph and can be described by an equation of the form y = mx + b.
- Slope (m)
- A number that describes the steepness and direction of a line. It equals the rise (vertical change) divided by the run (horizontal change) between any two points on the line.
- y-intercept (b)
- The value of y at the point where the line crosses the y-axis, which occurs when x = 0.
- Slope-intercept form
- The equation format y = mx + b, where m is the slope and b is the y-intercept. Every non-vertical straight line can be written this way.
- Rise
- The vertical change between two points on a line. It is found by subtracting the smaller y-value from the larger one (or y₂ − y₁ in order).
- Run
- The horizontal change between two points on a line. It is found by subtracting the x-values in the same order used for the rise.
- y-intercept form for a horizontal line
- A horizontal line has slope 0 and is written as y = k, where k is the constant y-value shared by every point on the line.
- Equation of a vertical line
- A vertical line is written as x = k, where k is the constant x-value shared by every point on the line. Its slope is undefined.
Continue through MTH1W
View the complete MTH1W Ontario Grade 9 Mathematics curriculum and lessons
Use the free MTH1W test and exam review guide
- C4.3 · Translate, reflect, and rotate lines
- D1.1 · Examine the collection, storage, representation, and use of data
- C1.1 · Explore the development and use of an algebraic concept
- C1.2 · Create expressions that generalize relationships
- C1.3 · Compare expressions and identify equivalent forms
- C1.4 · Simplify algebraic expressions
About this lesson and its review
Published by DoAssignment. This reviewed lesson follows Ontario Grade 9 Mathematics (MTH1W), expectation C4.4. It is a study resource, not an official curriculum publication.
Before publication, content is checked for structure, mathematical or chemical notation, calculations, course boundaries, and readability. Errors can still occur, so corrections are welcomed.