Linear Functions
4. Writing Linear Equations
Learning outcomes
- I can write equations using two points.
- I can write equations using slope and intercept.
- I can determine equations from tables.
- I can model situations with linear equations.
- I can verify that an equation matches a graph.
Writing Linear Equations
A linear equation describes a relationship in which one variable changes at a constant rate compared with another.
One of the most useful forms is:
y = mx + b
where:
- m = slope or rate of change
- b = y-intercept or initial value
Linear equations can be written from many kinds of information, including:
- two points
- a slope and y-intercept
- a table of values
- a graph
- a real-world situation
A useful overall strategy is:
Find the rate → Find the initial value → Write the equation → Verify
What Information Defines a Line?
A straight line can be determined in several ways.
For example, we can determine a unique nonvertical line if we know:
- two different points
- its slope and one point
- its slope and y-intercept
A table or real-world description can also provide this information.
Once we know:
m
and:
b
we can write:
y = mx + b
Writing an Equation from Slope and y-Intercept
Suppose:
slope = 3
y-intercept = 5
Use:
y = mx + b
Substitute:
m = 3
b = 5
Therefore:
y = 3x + 5
This is the simplest situation because both values needed for slope-intercept form are already known.
Negative Slope and Intercept
Suppose:
m = −2
b = 7
Then:
y = −2x + 7
The negative slope means the line decreases as x increases.
The y-intercept means the line crosses the y-axis at:
(0, 7)
Negative y-Intercept
Suppose:
m = 4
b = −6
Then:
y = 4x − 6
The graph:
- rises from left to right
- crosses the y-axis at (0, −6)
Zero y-Intercept
Suppose:
m = 5
and the line passes through the origin.
The origin is:
(0, 0)
Therefore:
b = 0
and:
y = 5x
An equation of the form:
y = mx
represents a direct proportional relationship.
Writing an Equation from Two Points
Suppose a line passes through:
(2, 5)
and:
(6, 13)
We do not yet know m or b.
First find the slope:
m = (y₂ − y₁)/(x₂ − x₁)
Substitute:
m = (13 − 5)/(6 − 2)
m = 8/4
m = 2
Now use:
y = mx + b
and substitute one of the points.
Using:
(2, 5)
gives:
5 = 2(2) + b
5 = 4 + b
Therefore:
b = 1
The equation is:
y = 2x + 1
The Two-Point Strategy
When given two points:
(x₁, y₁) and (x₂, y₂)
use:
Find m → Find b → Write y = mx + b → Verify
First:
m = (y₂ − y₁)/(x₂ − x₁)
Then substitute m and one known point into:
y = mx + b
to determine b.
Finally, write the complete equation.
Another Two-Point Example
Find the equation through:
(1, 4)
and:
(5, 12)
Find the slope:
m = (12 − 4)/(5 − 1)
m = 8/4
m = 2
Now use:
y = 2x + b
Substitute:
(1, 4)
4 = 2(1) + b
4 = 2 + b
b = 2
Therefore:
y = 2x + 2
Verify Using the Second Point
We used:
(1, 4)
to find b.
Now check:
(5, 12)
in:
y = 2x + 2
Substitute:
12 = 2(5) + 2
12 = 12 ✓
Therefore the equation matches both points.
Two Points with a Negative Slope
Find the equation through:
(1, 8)
and:
(4, 2)
Slope:
m = (2 − 8)/(4 − 1)
m = −6/3
m = −2
Now:
y = −2x + b
Use:
(1, 8)
8 = −2(1) + b
8 = −2 + b
Therefore:
b = 10
Equation:
y = −2x + 10
Check:
2 = −2(4) + 10
2 = 2 ✓
Be Consistent When Finding Slope
Suppose the points are:
(2, 7) and (5, 16)
Correct:
m = (16 − 7)/(5 − 2)
You can also reverse both:
m = (7 − 16)/(2 − 5)
Both give:
m = 3
But do not reverse only the numerator:
(7 − 16)/(5 − 2)
because this changes the sign incorrectly.
The point order must be consistent.
Fractional Slopes
Suppose a line passes through:
(2, 3)
and:
(6, 5)
Slope:
m = (5 − 3)/(6 − 2)
m = 2/4
m = 1/2
Use:
y = (1/2)x + b
Substitute:
3 = (1/2)(2) + b
3 = 1 + b
b = 2
Therefore:
y = (1/2)x + 2
Fractional slopes are completely normal.
Points Containing Negative Coordinates
Find the equation through:
(−2, 1)
and:
(2, 9)
Slope:
m = (9 − 1)/(2 − (−2))
m = 8/4
m = 2
Now:
y = 2x + b
Use:
(−2, 1)
1 = 2(−2) + b
1 = −4 + b
Therefore:
b = 5
Equation:
y = 2x + 5
Writing an Equation from Slope and One Point
Suppose:
m = 3
and the line passes through:
(4, 14)
Start:
y = mx + b
Substitute:
14 = 3(4) + b
14 = 12 + b
Therefore:
b = 2
Equation:
y = 3x + 2
Point-Slope Form
Another useful form is:
y − y₁ = m(x − x₁)
This is called point-slope form.
It is especially useful when you know:
- the slope
- one point
For example, if:
m = 3
and:
(x₁, y₁) = (4, 14)
then:
y − 14 = 3(x − 4)
Expand:
y − 14 = 3x − 12
Add 14:
y = 3x + 2
The same equation is obtained.
Which Method Should You Use?
If you know m and b directly:
Use y = mx + b.
If you know m and one point:
You can:
- substitute into y = mx + b to find b, or
- use point-slope form
If you know two points:
- calculate m first
- then use either method
Choose the method that makes the algebra easiest.
Writing an Equation from a Table
Consider:
| x | y |
|---|---|
| 0 | 3 |
| 1 | 5 |
| 2 | 7 |
| 3 | 9 |
Look at the change in y.
Each time x increases by 1:
y increases by 2
Therefore:
m = 2
When:
x = 0
we have:
y = 3
Therefore:
b = 3
Equation:
y = 2x + 3
Finding Slope from a Table
Slope is:
m = change in y / change in x
Suppose:
| x | y |
|---|---|
| 2 | 7 |
| 4 | 13 |
| 6 | 19 |
| 8 | 25 |
From the first row to the second:
change in x = 2
change in y = 6
Therefore:
m = 6/2
m = 3
Finding the Intercept When x = 0 Is Missing
In the previous table:
| x | y |
|---|---|
| 2 | 7 |
| 4 | 13 |
| 6 | 19 |
| 8 | 25 |
we know:
m = 3
But the table does not show x = 0.
Use one point:
(2, 7)
in:
y = mx + b
7 = 3(2) + b
7 = 6 + b
Therefore:
b = 1
Equation:
y = 3x + 1
Tables with Larger x-Intervals
Do not assume that the change in y is automatically the slope.
Consider:
| x | y |
|---|---|
| 10 | 25 |
| 20 | 45 |
| 30 | 65 |
| 40 | 85 |
The y-values increase by:
20
but the x-values increase by:
10
Therefore:
m = 20/10
m = 2
The slope is 2, not 20.
Tables with Decreasing Values
Consider:
| x | y |
|---|---|
| 0 | 20 |
| 2 | 16 |
| 4 | 12 |
| 6 | 8 |
Changes:
Δx = 2
Δy = −4
Therefore:
m = −4/2
m = −2
Since:
x = 0 → y = 20
we know:
b = 20
Equation:
y = −2x + 20
How Do We Know a Table Is Linear?
A table represents a linear relationship when it has a constant rate of change.
For example:
| x | y |
|---|---|
| 1 | 4 |
| 2 | 7 |
| 3 | 10 |
| 4 | 13 |
Each time x increases by 1, y increases by 3.
Therefore the rate of change is constant.
The relationship is linear.
A Nonlinear Table
Consider:
| x | y |
|---|---|
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
The changes in y are:
+3, +5, +7
The rate of change is not constant.
Therefore these values do not represent a linear relationship.
Not every table should be modeled with:
y = mx + b
Unequal x-Intervals
Constant differences in y are only useful when the x-intervals are equal.
Suppose:
| x | y |
|---|---|
| 1 | 5 |
| 3 | 11 |
| 7 | 23 |
First interval:
m = (11 − 5)/(3 − 1)
m = 6/2
m = 3
Second interval:
m = (23 − 11)/(7 − 3)
m = 12/4
m = 3
The rate of change is constant.
Therefore the table is linear even though the x-values are not equally spaced.
Writing an Equation from a Graph
To write an equation from a graph:
- identify two clear points
- calculate the slope
- identify the y-intercept or calculate it
- write y = mx + b
- check that the equation matches the graph
If the graph clearly crosses the y-axis at an integer value, that point is often the easiest starting point.
Example from a Graph
Suppose a graph passes through:
(0, 4)
and:
(3, 10)
Slope:
m = (10 − 4)/(3 − 0)
m = 6/3
m = 2
Since:
(0, 4)
is the y-intercept:
b = 4
Therefore:
y = 2x + 4
Graphs Without an Obvious y-Intercept
Suppose a graph clearly passes through:
(2, 5)
and:
(6, 13)
but the y-intercept is not easy to read.
Calculate:
m = (13 − 5)/(6 − 2)
m = 2
Then use:
(2, 5)
to find b:
5 = 2(2) + b
b = 1
Therefore:
y = 2x + 1
You do not need to estimate the intercept from the graph.
Verifying an Equation Against a Graph
Suppose you think a graph represents:
y = 3x − 2
Check several features.
Check the y-Intercept
The equation predicts:
(0, −2)
Does the graph cross the y-axis there?
Check the Slope
The equation predicts:
m = 3 = 3/1
Does the line rise 3 units for every 1 unit to the right?
Check Another Point
If the graph contains:
(2, 4)
substitute:
4 = 3(2) − 2
4 = 4 ✓
The equation is consistent with the graph.
Why Checking More Than One Feature Matters
Suppose two lines both cross the y-axis at:
(0, 5)
One might be:
y = 2x + 5
and another:
y = −3x + 5
Checking only the y-intercept would not distinguish them.
Similarly, two parallel lines can have the same slope but different intercepts.
A good verification checks both:
slope and intercept
or:
at least two points
Modeling Real Situations
Many real-world situations have:
- an initial amount
- a constant rate of change
These naturally produce linear equations.
The general model is:
output = rate × input + initial value
This is the same structure as:
y = mx + b
Taxi Fare
A taxi charges:
- $4 starting fee
- $2.50 per kilometre
Let:
C = total cost
d = distance in kilometres
The rate is:
m = 2.5
The initial value is:
b = 4
Therefore:
C = 2.5d + 4
Savings
A student already has $80 and saves $15 each week.
Let:
S = total savings
w = number of weeks
Initial value:
80
Rate:
15 dollars/week
Therefore:
S = 15w + 80
After 10 weeks:
S = 15(10) + 80
S = 230
Temperature
A liquid begins at 90°C and cools by 4°C each minute.
Let:
T = temperature
t = time in minutes
The rate is negative:
m = −4
Initial temperature:
b = 90
Therefore:
T = −4t + 90
Filling a Tank
A tank contains 120 L of water and receives water at 8 L/min.
Let:
V = volume
t = time
Initial amount:
120 L
Rate:
8 L/min
Equation:
V = 8t + 120
Draining a Tank
A tank contains 500 L and drains at 20 L/min.
The initial value is:
500
The rate is:
−20 L/min
Therefore:
V = −20t + 500
The negative slope represents decreasing volume.
Constant-Speed Motion
A cyclist begins 10 km from a reference point and travels away from it at 18 km/h.
Let:
d = distance from the reference point
t = time in hours
Then:
d = 18t + 10
Slope:
18 km/h
Intercept:
10 km
Modeling from Two Measurements
Suppose an experiment records:
At 2 seconds:
temperature = 24°C
At 6 seconds:
temperature = 36°C
Assuming a linear relationship, use the points:
(2, 24)
and:
(6, 36)
Slope:
m = (36 − 24)/(6 − 2)
m = 12/4
m = 3
So:
T = 3t + b
Use:
(2, 24)
24 = 3(2) + b
b = 18
Therefore:
T = 3t + 18
Interpreting the Model
For:
T = 3t + 18
the slope:
3°C/s
means temperature increases by 3°C each second.
The intercept:
18°C
means the model predicts:
T = 18°C when t = 0
Even if the experiment did not measure t = 0 directly, the equation allows us to determine the model's predicted initial value.
Interpolation
Suppose a linear model is based on measurements at:
x = 2
and:
x = 10
Using the equation to predict a value at:
x = 6
is called interpolation.
The prediction is being made inside the range of known data.
Interpolation is often reasonably reliable when the relationship is genuinely linear.
Extrapolation
Using the same model to predict a value at:
x = 100
would be extrapolation.
This prediction is far outside the measured range.
A linear pattern may not continue indefinitely, so extrapolated predictions should be treated more cautiously.
Linear Models Have Limits
An equation may accurately model a situation only over a certain range.
For example:
V = −20t + 500
models a draining tank.
Eventually:
V = 0
After that, the formula would predict negative water volume.
That is mathematically possible in the equation but physically impossible.
Real-world models have appropriate domains.
Writing Equations from Verbal Descriptions
Look for two pieces of information:
Rate of Change
Words such as:
- per
- each
- every
- increases by
- decreases by
often indicate slope.
Initial Value
Words such as:
- starts with
- initially
- base fee
- fixed charge
- already has
often indicate the intercept.
Example from Words
A phone plan costs $25 per month plus $0.10 per text message.
Let:
C = total cost
t = number of text messages
Rate:
$0.10/text
Initial amount:
$25
Therefore:
C = 0.10t + 25
Writing an Equation from a Pattern
Suppose:
| Number of Items | Total Cost ($) |
|---|---|
| 1 | 7 |
| 2 | 11 |
| 3 | 15 |
| 4 | 19 |
The cost increases by:
$4 per item
Therefore:
m = 4
Use:
(1, 7)
to find b:
7 = 4(1) + b
b = 3
Equation:
C = 4n + 3
This means there is a $3 fixed cost plus $4 per item.
Equations from Horizontal Lines
Suppose two points are:
(2, 5)
and:
(8, 5)
Slope:
m = (5 − 5)/(8 − 2)
m = 0
Therefore:
y = 5
This is a linear equation representing a horizontal line.
Vertical Lines
Suppose the points are:
(4, 2)
and:
(4, 9)
The slope calculation would require:
(9 − 2)/(4 − 4)
which involves division by zero.
The slope is undefined.
The equation is:
x = 4
This is a linear equation, but it cannot be written in slope-intercept form:
y = mx + b
Parallel Lines
Suppose one line is:
y = 3x + 5
Any different line parallel to it must have the same slope:
m = 3
For example:
y = 3x − 2
The slopes are equal, but the intercepts are different.
Writing a Parallel Line
Find the equation of a line parallel to:
y = 2x + 7
and passing through:
(3, 1)
Parallel lines have the same slope.
Therefore:
m = 2
Use:
y = 2x + b
Substitute:
1 = 2(3) + b
1 = 6 + b
b = −5
Therefore:
y = 2x − 5
Comparing Equations and Graphs
Suppose a graph:
- crosses the y-axis at 4
- decreases 2 units for every 1 unit right
Then:
m = −2
b = 4
Equation:
y = −2x + 4
If someone proposes:
y = 2x + 4
the intercept is correct, but the slope has the wrong sign.
The graph itself provides evidence that the equation is incorrect.
Checking with Substitution
Suppose you believe the equation through:
(3, 7)
and:
(5, 11)
is:
y = 2x + 1
Check the first point:
7 = 2(3) + 1
7 = 7 ✓
Check the second:
11 = 2(5) + 1
11 = 11 ✓
Both points satisfy the equation.
Checking with Slope
The points:
(3, 7)
and:
(5, 11)
have slope:
m = (11 − 7)/(5 − 3)
m = 4/2
m = 2
The proposed equation:
y = 2x + 1
also has slope 2.
This provides another check.
A Complete Example
Find the equation through:
(−1, 6)
and:
(3, −2)
Find the slope
m = (−2 − 6)/(3 − (−1))
m = −8/4
m = −2
Find the intercept
Use:
y = −2x + b
Substitute:
(−1, 6)
6 = −2(−1) + b
6 = 2 + b
b = 4
Write the equation
y = −2x + 4
Verify
Using:
(3, −2)
−2 = −2(3) + 4
−2 = −6 + 4
−2 = −2 ✓
Therefore:
y = −2x + 4
is correct.
A Reliable Strategy
When writing a linear equation, use:
Identify → Calculate → Construct → Verify → Interpret
Identify
Determine what information is given.
Calculate
Find the slope if necessary.
Construct
Find the intercept and write the equation.
Verify
Check known points, the table, or the graph.
Interpret
If the equation models a real situation, explain what its slope and intercept mean.
Common Mistakes
Mistake: Using only one point to determine a line without knowing the slope.
Many different lines can pass through one point.
Mistake: Mixing the order of points in the slope formula.
Keep subtraction order consistent.
Mistake: Assuming the change in y is always the slope.
Slope is:
change in y / change in x
Mistake: Assuming the first table value is the y-intercept.
The y-intercept occurs when:
x = 0
Mistake: Forgetting to calculate b after finding m.
Finding the slope does not give the complete equation.
Mistake: Using a point's y-coordinate as b when x ≠ 0.
Only a point with x = 0 directly gives the y-intercept.
Mistake: Ignoring negative signs.
A decreasing relationship has a negative slope.
Mistake: Assuming every table is linear.
Check for a constant rate of change first.
Mistake: Using y = mx + b for a vertical line.
A vertical line has equation:
x = constant
Mistake: Failing to verify the equation.
Substitute known points back into the final equation.
Mistake: Checking only the intercept against a graph.
An equation must match both the slope and intercept.
Mistake: Ignoring the meaning of the variables.
In real-world models, interpret the rate, initial value, and appropriate domain.
Key Terms
Linear equation — equation representing a constant rate of change whose graph is a straight line.
Slope-intercept form — equation written as y = mx + b.
Slope — rate of change of y compared with x.
Rate of change — ratio of the change in one variable to the change in another.
y-intercept — point where a graph crosses the y-axis.
Initial value — value of the dependent variable when the independent variable equals zero.
Slope formula — m = (y₂ − y₁)/(x₂ − x₁).
Point-slope form — equation written as y − y₁ = m(x − x₁).
Ordered pair — coordinate written (x, y).
Linear relationship — relationship with a constant rate of change.
Constant rate of change — rate that remains the same throughout a relationship.
Direct proportion — linear relationship of the form y = mx that passes through the origin.
Model — mathematical representation of a real situation.
Interpolation — using a model to predict within the range of known data.
Extrapolation — using a model to predict beyond the range of known data.
Domain — set of input values for which a relationship or model is meaningful.
Verification — checking that an equation satisfies known information.
Horizontal line — line with slope zero.
Vertical line — line with undefined slope.
Parallel lines — lines with equal slopes that do not intersect.
Key Takeaways
- Linear equations describe relationships with constant rates of change.
- Slope-intercept form is y = mx + b.
- The slope m represents the rate of change.
- The intercept b represents the value of y when x = 0.
- If slope and intercept are known, substitute them directly into y = mx + b.
- Two distinct points determine one straight line unless the line is vertical.
- When given two points, calculate the slope first.
- Use m = (y₂ − y₁)/(x₂ − x₁).
- Keep the order of subtraction consistent.
- After finding m, substitute one point into y = mx + b to determine b.
- Point-slope form can also be used when a slope and point are known.
- Tables represent linear relationships when the rate of change is constant.
- Do not confuse change in y with slope when x changes by more than 1.
- If x = 0 appears in a table, its y-value gives the y-intercept directly.
- If x = 0 is missing, use another point to calculate b.
- Graphs can provide two points, a slope, or a y-intercept.
- Verify a graph equation by checking both slope and intercept or by checking multiple points.
- Real-world linear models often contain an initial value and a constant rate.
- Words such as "per" and "each" often indicate slope.
- Words such as "initial," "starting," and "base fee" often indicate the intercept.
- A negative slope represents a decreasing relationship.
- A zero slope represents a horizontal line.
- A vertical line cannot be written in ordinary slope-intercept form.
- Linear models may only be appropriate over a limited domain.
- Interpolation is usually safer than extrapolation.
- Always verify a final equation using the information originally provided.
Check Your Understanding
- Write an equation with slope 4 and y-intercept 7.
- Write an equation with slope −3 and y-intercept 5.
- Write an equation with slope 2 and y-intercept 0.
- Find the slope between (2, 5) and (6, 13).
- Find the equation of the line through (2, 5) and (6, 13).
- Find the equation through (1, 8) and (4, 2).
- Find the equation through (−2, 1) and (2, 9).
- A line has slope 5 and passes through (2, 13). Find its equation.
- A line has slope −2 and passes through (4, −1). Find its equation.
- Determine the equation represented by the table: (0, 4), (1, 7), (2, 10), (3, 13).
- Determine the equation represented by: (2, 9), (4, 15), (6, 21), (8, 27).
- Determine whether the table (1, 2), (2, 4), (3, 8), (4, 16) represents a linear relationship. Explain.
- Explain why the change in y alone does not always equal the slope.
- A graph passes through (0, −3) and (4, 5). Write its equation.
- Explain how you could verify that y = 2x − 3 matches a particular graph.
- A taxi charges $5 initially and $2.20 per kilometre. Write a linear equation for the total cost C after travelling d kilometres and interpret both numbers in your equation.
- A tank contains 300 L and drains at 12 L/min. Write an equation for its volume V after t minutes. State a reasonable domain for the model.
- At 3 seconds an experiment records 14°C, and at 7 seconds it records 30°C. Assuming a linear relationship, write an equation relating temperature T to time t.
- A line is parallel to y = 4x + 2 and passes through (3, 5). Find its equation and verify that the slopes are equal.
- Create a real-world situation that can be modeled by y = −5x + 80. Explain what the slope and intercept represent, and describe how you would verify that a graph correctly represents your equation.