We want a way to describe any straight line on a grid with a simple equation, so we can draw the exact line from its equation or write the equation from its graph.
1
What y=mx+b Means
To pin down a specific non-vertical line, we need to know both where it crosses the vertical y-axis and how much its height changes with each step to the right.
What y = mx + b Means
Text solution
Start on the y-axis (x=0) Before taking any steps left or right, the line crosses the vertical y-axis at its starting height.
y=3
Add 2 for each step x to the right Walking x steps to the right adds 2 to the height for every step taken.
y=2x+3
Writing m for how much the height changes with each step and b for where the line begins on the vertical axis gives Slope-Intercept Form:
y=slopemx+y-interceptb
In this family of parallel lines with slope 2, every line rises 2 boxes for each step right, while the y-intercept b sets where the line crosses the vertical axis without changing its steepness.
In this family of parallel lines, the right 1, up 2 step stays the same while the ending number shows where the line crosses the vertical axis.
2
Graphing a Line from y=mx+b
Now we want to use the equation to draw a line on a grid, whether the slope is a fraction like in y=32x+1 or a negative whole number like in y=−3x+4.
Graphing a Line from y = mx + b
Text solution
Plot the starting point b on the vertical y-axis For y=32x+1, place the starting dot on the vertical axis where x=0.
(0,1)
Run right by the bottom number, rise by the top number Running 3 boxes right adds 32 three times, giving a rise of 2 whole boxes onto a grid corner (and going backward 3 left and 2 down gives (−3,−1) on the left side of the same line).
m=RunRise=32⟹(0+3,1+2)=(3,3)
Write a whole-number slope over 1 For y=−3x+4, put the whole number over 1 so you run 1 box right and go down 3 boxes from (0,4).
m=1−3⟹(0+1,4−3)=(1,1)
Connecting the grid corners gives the upward line through (0,1) and (3,3), and the downward line through (0,4) and (1,1).
Try changing the slope m below to see how the run and rise connect grid corners, and how a negative rise tilts the line downward.
From the starting point on the y-axis, the bottom number of the slope tells you how far to step right so your rise or fall lands cleanly on a grid corner.
3
Writing the Equation from a Graph
Now let's go the other way: we are given a graphed line and want to find its equation y=mx+b.
x
y
0
1
2
3
(0,−2)
(4,1)
4
+3
Writing the Equation from a Graph
y=?x+?
y
3
2
1
2
x
0
4
Text solution
Find the y-intercept b on the y-axis Look at the vertical axis (x=0) to see where the line crosses.
b=−2
Count rise and run to the next grid corner Skip the spots at x=1,2,3 where the line's height is between whole numbers, and count the boxes from (0,−2) to the grid corner at (4,1).
m=RunRise=43
Plug m and b into y=mx+b Put both numbers into the equation, writing plus negative 2 simply as minus 2.
y=43x−2
So the equation of the graphed line is y=43x−2.
4
Finding and Testing Points with the Equation
When a point is far off the grid, we can use the equation y=43x−2 to find the line's height at x=400 or test whether a point like (8,5) actually sits on the line.
Finding and Testing Points with the Equation
y=43x−2
y
3
2
(4,1)
2
x
0
(0,−2)
x=400⟹y=?
Text solution
Plug in x=400 to find the height Replace the number of steps x with 400 and divide 400 by 4 first to simplify.
y=43(400)−2=300−2=298
Plug in x=8 to test (8,5) Find the line's height at x=8 and compare it to the point's y-value of 5.
y=43(8)−2=6−2=4
At 400 steps to the right, the line sits at height 298. At x=8, the line is at height 4, so (8,5) is not on the line: it is 1 box above it.
5
Slope-Intercept Form in Word Problems
Many real-world situations follow this exact start-and-step pattern. If you start with $50 in a jar and add $20 every week, we want an equation for your total money y after x weeks so we can predict how much you will have at week 12.
Slope-Intercept Form in Word Problems
$20
per week
$50
week 12:$?
Text solution
Find the starting amount b and rate of change m At week 0 you begin with $50, and each week x adds $20 to the total.
bm=50,=20
Write the equation and plug in x=12 Put m and b into y=mx+b, then plug in 12 for x.
y=20x+50=20(12)+50=240+50=290
So after 12 weeks, you will have $290 in the jar.
6
Solving for y to Find the Slope and y-Intercept
Sometimes an equation has x and y on the same side, like 2x+3y=6, and we want to find the line's slope and y-intercept.
Solving for y to Find the Slope and y-Intercept
2x+3yy=6=?
Text solution
Subtract the x-term from both sides Subtract 2x from both sides and write −2x in front of 6 (since −2x has an x and 6 is a plain number, they are not like terms and cannot be combined into 4x).
3y=−2x+6
Divide every term by the number multiplying y Divide every single term on both sides by 3 to get y completely by itself.
33yy=3−2x+36=−32x+2
Once y is alone, we see that the slope is −32 (not 2) and the y-intercept is 2 (not 6).
7
Special Cases: Missing Terms, Horizontal, and Vertical Lines
Now let's handle short equations where part of y=mx+b looks like it is missing, such as y=2x,y=x−3, and y=4, along with vertical lines like x=3, which cannot be written in y=mx+b form at all.
Special Cases: Missing Terms, Horizontal, and Vertical Lines
y=2x
y
6
4
2
x
0
−2
2
4
−2
−4
x
y
0
1
3
−2
2
y=4
slope=0
(0,4)
x
y
0
1
−2
2
x=3
slope undefined
(3,−2)
(3,0)
(3,1)
(3,2)
no y-intercept
x
y
0
1
3
−2
2
y=4
slope=0
(0,4)
x
y
0
1
−2
2
x=3
slope undefined
(3,−2)
(3,0)
(3,1)
(3,2)
no y-intercept
Text solution
No number at the end (y=2x) Adding 0 does not change the equation, so the line starts at the origin (0,0) and goes right 1, up 2.
y=2x+0
No number written in front of x(y=x−3) An x by itself means 1x, so the line starts at (0,−3) and goes right 1, up 1.
y=11x−3
No x-term at all (y=4) The x-term is multiplied by 0, so the line starts at height 4 and rises 0 for every step right, making a flat horizontal line.
y=0x+4
A vertical line (x=3) The line x=3 never crosses the y-axis and has zero run (making its slope undefined because we can't divide by 0), so it cannot be written as y=mx+b. Instead, every point on the line simply has x fixed at 3.
x=3
It is easy to mix up y=4 and x=3 because the horizontal axis is the x-axis. If you ever aren't sure, plot two quick points that fit the equation: (0,4) and (1,4) sit at the same height, which draws a flat horizontal line for y=4, whereas (3,0) and (3,1) stack straight up and down for x=3.
Tilt the line flat or straight up and down below to see the rise drop to 0 for a horizontal line, or the line run parallel to the y-axis with every point at the same x for a vertical line.
Tilt the line to see why a flat line only needs a y-number in its equation, and a vertical line only needs an x-number.
Key concepts
Every non-vertical line can be written in Slope-Intercept Form:
y=slopemx+y-interceptb
Think of the equation as two instructions: b is where the line begins on the vertical y-axis (or the starting amount at x=0 in a word problem, like starting with $50 in y=20x+50), and m=RunRise is how the line moves from there. To graph y=32x+1, start at (0,1), run right by the bottom number 3, and rise by the top number 2 to hit the grid corner (3,3); for a whole-number slope like y=−3x+4, put the slope over 1(1−3) to go right 1, down 3. Going the other way from a graph, find b on the y-axis first and use another point whose coordinates you can read exactly to count rise over run.
Do not read m and b off an equation until y is completely alone on one side: in 2x+3y=6, subtract 2x and divide every term by 3 first to get y=−32x+2. When pieces look missing, fill in the unwritten numbers: y=2x is y=2x+0 (starts at the origin), y=x−3 is y=1x−3 (slope 1), and y=4 is y=0x+4 (a flat horizontal line with slope 0). Finally, y=mx+b cannot be used for a vertical line because its slope is undefined. An equation like x=3 keeps x at 3 for every point on the line.
8
Practice
1
To graph y=−4x+5, where do you place the starting dot on the y-axis, how do you write the slope as rise over run, and what point do you land on after taking 1 step to the right?
Set x=0 to start on the vertical axis (putting the dot on the horizontal axis gives (5,0)).
What number can you put underneath a whole-number slope so it has a run to the right?
Place the starting dot on the y-axis Set x=0 to start on the vertical axis (putting the dot on the horizontal axis gives (5,0)).
(0,5)
Write the slope as rise over run and step right 1 Put −4 over 1 so you run 1 right and go down 4 (going up 4 instead of down 4 would land at (1,9)).
m=1−4⟹(0+1,5−4)=(1,1)
Start at (0,5) on the y-axis, write the slope as 1−4 (right 1, down 4), and land at (1,1).
2
You are graphing y=53x−1. Starting from the y-intercept at (0,−1), what grid-corner point do you reach by taking one full rise-over-run step forward to the right, and what grid-corner point do you reach by going one full step backward to the left?
From (0,−1), run right 5 and rise up 3 (swapping rise and run by going right 3 and up 5 gives (3,4)).
In RunRise=53, use the bottom number for your horizontal step and the top number for your vertical step, then reverse both directions to go backward.
Step forward to the right From (0,−1), run right 5 and rise up 3 (swapping rise and run by going right 3 and up 5 gives (3,4)).
(0+5,−1+3)=(5,2)
Step backward to the left Reverse both directions by going left 5 and down 3 (going left 5 while still going up 3 lands off the line at (−5,2)).
(0−5,−1−3)=(−5,−4)
Going right 5 and up 3 lands at (5,2); going backward left 5 and down 3 lands at (−5,−4).
3
A graphed line crosses the vertical y-axis at −4. At x=1 and x=2, the line's height is between whole numbers. At x=3, it passes through the grid corner (3,−2). Write the equation of this line in slope-intercept form.
Count how many boxes you rise up from height −4 to height −2, and put that over the run from x=0 to x=3.
Find b and count rise over run to (3,−2) Going from −4 up to −2 is a rise of +2 over a run of 3 (using the y-coordinate −2 directly as the rise gives y=−32x−4, and putting run over rise gives y=23x−4).
bm=−4,=32
y=32x−4
4
Does the line y=43x−2 pass through the point (60,42)? If not, is (60,42) above or below the line, and by how many boxes?
Plug x=60 into the equation to find the line's height at that x, then compare 42 to the line's height.
Find the line's height at x=60 Divide 60 by 4 to get 15, then multiply by 3 and subtract 2.
y=43(60)−2=45−2=43
Compare the point's height of 42 to the line's height of 43 (don't flip the comparison and say 42 is 1 box above 43).
No. At x=60,y=43(60)−2=43, so (60,42) is 1 box below the line.
5
A candle burns down 2 centimeters every hour from a starting height of 18 centimeters. Write an equation in slope-intercept form for the candle's height y after x hours, and find its height after 7 hours.
Because the candle gets shorter each hour, should the rate of change m be positive or negative?
Write the equation with starting height 18 and rate −2 Use m=−2 since the height goes down by 2 cm per hour (using +2 instead of −2 gives y=2x+18 and a height of 32 cm).
y=−2x+18
Plug in x=7 hours
y=−2(7)+18=−14+18=4
y=−2x+18; after 7 hours, the height is 4 centimeters.
6
Rewrite the equation 5x+2y=8 in slope-intercept form, and give the line's slope and y-intercept.
Subtract the x-term from both sides first, then divide every term on both sides by the number multiplying y.
Subtract 5x from both sides Keep the minus sign on −5x when subtracting it from both sides (dropping the minus sign gives y=25x+4).
2y=−5x+8
Divide every term by 2 Divide both −5x and 8 by 2 (forgetting to divide the 8 by 2 leaves a y-intercept of 8).
22yy=2−5x+28=−25x+4
y=−25x+4; the slope is −25 and the y-intercept is 4.
7
Find the slope m and y-intercept b of each line: (a) y=6x and (b) y=x−5.
In (a), what number is added at the end when none is written? In (b), how many x's are in front of −5?
Write in the unwritten 0 and 1 In (a), y=6x is y=6x+0. In (b), an x by itself means 1x (saying the slope is 0 because no number is written in front of x would make the equation y=−5).
y=1x−5
(a) m=6,b=0; (b) m=1,b=−5.
8
Line A is a horizontal line passing through (0,−3). Line B is a vertical line passing through (4,−1),(4,0), and (4,2). Write the equation and give the slope of each line.
Check which coordinate, the height y or the left-to-right position x, stays at a single number for all points on the line.
Fix y for the horizontal line and x for the vertical line Line A stays at height y=−3 with zero rise, while Line B keeps x=4 for every point with zero run (don't swap the letters to x=−3 and y=4 or call the vertical line's slope 0).
Line A: yLine B: x=−3 (m=0),=4 (slope undefined)
Line A has equation y=−3 and slope 0; Line B has equation x=4 and undefined slope.