Jugami Algebra

Jugami › Algebra › Graphing Linear Equations

Graphing Linear Equations

Coordinates, slope, intercepts and equations of lines for grades 9–10.

A taxi charges $3 to start and $2 for every mile. The cost is y = 2x + 3, where x is the number of miles. Plot the cost for 0, 1, 2, 3, 4 and 5 miles, and the points line up in a straight line. That is why equations like this are called linear.

This unit shows you how to read and draw those lines. You will learn how steep a line is (its slope), where it crosses the axes (its intercepts), and how to write the equation of a line from a graph, from a point and a slope, or from two points.

Graph of taxi cost against distance. The horizontal axis is miles from 0 to 6, and the vertical axis is cost in dollars from 0 to 16. Points at (0, 3), (1, 5), (2, 7), (3, 9), (4, 11) and (5, 13) lie on a straight line that starts at $3 on the cost axis. A dashed triangle from (2, 7) to (3, 9) shows 1 mile more costs $2 more.milescost ($)12345672468101214160run 1rise 2
The taxi’s cost goes up $2 for each mile: the points sit on one straight line.

The coordinate plane

The coordinate plane is made by two number lines that cross at right angles. The horizontal one is the x-axis and the vertical one is the y-axis. They cross at the origin, (0, 0).

Every point has an ordered pair (x, y). The first number tells you how far to move left or right from the origin. The second tells you how far to move up or down. Order matters: (3, 2) and (2, 3) are different points.

The axes split the plane into four quadrants, numbered I to IV counterclockwise, starting at the top right. Points on an axis are not in any quadrant.

A coordinate plane from −6 to 6 on both axes, with the four quadrants labeled: Quadrant I at the top right, Quadrant II at the top left, Quadrant III at the bottom left and Quadrant IV at the bottom right. Points plotted: A at (4, 3) in Quadrant I, B at (−3, 2) in Quadrant II, C at (−5, −4) in Quadrant III, D at (2, −3) in Quadrant IV, E at (0, 4) on the y-axis and F at (−4, 0) on the x-axis.xyQuadrant IIQuadrant IQuadrant IIIQuadrant IV−6−5−3−2−1123456−6−5−4−3−2−1123560A (4, 3)B (−3, 2)C (−5, −4)D (2, −3)E (0, 4)F (−4, 0)
Six points and the four quadrants. To plot D (2, −3), start at the origin, move right 2, then down 3.
Signs of the coordinates in each quadrant
QuadrantxyExample
Ipositivepositive(4, 3)
IInegativepositive(−3, 2)
IIInegativenegative(−5, −4)
IVpositivenegative(2, −3)

Your turn

Which quadrant is each point in?

(−7, 1)
Quadrant IIx is negative and y is positive
(6, −0.5)
Quadrant IVx is positive and y is negative
(0, −3)
No quadrantx is 0, so the point is on the y-axis

Solutions of an equation in two variables

An equation like y = 2x + 1 has two variables. A solution is an ordered pair that makes the equation true when you put in its x and y. There are infinitely many solutions, and the graph of the equation is the picture of all of them.

Testing points in y = 2x + 1
PointPut it inTrue?
(1, 3)3 = 2(1) + 1Yes: 3 = 3
(−2, −3)−3 = 2(−2) + 1Yes: −3 = −3
(2, 4)4 = 2(2) + 1No: 4 ≠ 5
(0, 1)1 = 2(0) + 1Yes: 1 = 1
Graph of the line y = 2x + 1. Three solutions are plotted on the line: (−2, −3), (0, 1) and (1, 3), each marked with a check. The point (2, 4) is off the line, below and to the right of it, and is marked with a cross because it is not a solution.xy−6−5−4−3−2123456−6−5−4−3−2−1234560y = 2x + 1(−2, −3) ✓(0, 1) ✓(1, 3) ✓(2, 4) ✗
The three solutions lie on the line. (2, 4) is not on the line because it is not a solution.

So a point is on the line exactly when it is a solution. That gives you a quick check: if you plotted a point and it is not on your line, one of them is wrong.

Your turn

Is (3, 5) a solution of x + 2y = 13?
3 + 2(5) = 3 + 10 = 13Put in x = 3 and y = 5Yes, it is a solution13 = 13 is true
Is (−1, 4) a solution of y = −3x + 2?
−3(−1) + 2 = 5Put in x = −15 ≠ 4y should be 5, but the point has y = 4No, it is not a solution

Graphing from a table

The most direct way to graph an equation is to make a table. Choose a few values of x, work out y for each one, plot the points, and draw a line through them. Two points are enough to fix a line, but a third point is a good check.

Table of values for y = 2x − 1
x2x − 1yPoint
−12(−1) − 1−3(−1, −3)
02(0) − 1−1(0, −1)
12(1) − 11(1, 1)
22(2) − 13(2, 3)
32(3) − 15(3, 5)
Graph of y = 2x − 1 through the five points from the table: (−1, −3), (0, −1), (1, 1), (2, 3) and (3, 5).xy−6−5−4−3−2−1123456−6−5−41234560y = 2x − 1
The five points from the table, joined by a line with arrows at both ends: the line keeps going.

Tip: pick x-values that make the arithmetic easy

For y = −1/2x + 3, choose x-values that are multiples of 2. Then the fraction cancels and every y is a whole number.

Table of values for y = −1/2x + 3
x−1/2x + 3yPoint
−4−1/2(−4) + 35(−4, 5)
−2−1/2(−2) + 34(−2, 4)
0−1/2(0) + 33(0, 3)
2−1/2(2) + 32(2, 2)
4−1/2(4) + 31(4, 1)
Graph of y = (−1/2)x + 3 through (−4, 5), (−2, 4), (0, 3), (2, 2) and (4, 1). The line falls gently from left to right.xy−6−5−4−3−2−1123456−6−5−4−3−2−1124560y = −(1/2)x + 3
Choosing even values of x gave whole-number points that are easy to plot.

Your turn

Make a table for y = −x + 2 with x = −1, 0, 1, 2, then graph it.
x = −1: y = −(−1) + 2 = 3Point (−1, 3)x = 0: y = −(0) + 2 = 2Point (0, 2)x = 1: y = −(1) + 2 = 1Point (1, 1)x = 2: y = −(2) + 2 = 0Point (2, 0)
Graph of y = −x + 2 through (−1, 3), (0, 2), (1, 1) and (2, 0).xy−6−5−4−3−2−113456−6−5−4−3−2−1134560y = −x + 2

Slope: rise over run

The slope of a line tells you how steep it is and which way it goes. Pick two points on the line. The rise is how far you go up (or down) from one to the other, and the run is how far you go right. Slope is rise divided by run, and it is usually called m.

Graph of a line through (0, −1) and (3, 1). A dashed triangle goes from (0, −1) right 3 units to (3, −1), labeled run 3, then up 2 units to (3, 1), labeled rise 2. A second triangle from (3, 1) to (6, 3) has the same run 3 and rise 2.xy−2−1245678−3−2123450run 3rise 2run 3rise 2(0, −1)(3, 1)(6, 3)
From (0, −1) to (3, 1) the run is 3 and the rise is 2, so m = 2/3. Any two points on the line give the same slope.

For a line you can read off a grid, count squares: right is a positive run, up is a positive rise, and down is a negative rise. Here, m = rise/run = 2/3.

The slope formula

When you only have the coordinates, subtract them. For two points, (x₁, y₁) and (x₂, y₂):

m = y₂ − y₁/x₂ − x₁

The little 1 and 2 just mean “first point” and “second point”. The top is the change in y (the rise), and the bottom is the change in x (the run).

Example 1: (1, 2) and (4, 8)

m = y₂ − y₁/x₂ − x₁The slope formulam = 8 − 2/4 − 1Put in the first point (1, 2) and the second point (4, 8)m = 6/3Subtract on top and on the bottomm = 2Simplify

Example 2: (−2, 5) and (3, −5)

m = y₂ − y₁/x₂ − x₁The slope formulam = −5 − 5/3 − (−2)Put in the first point (−2, 5) and the second point (3, −5)m = −10/5Subtract on top and on the bottomm = −2Simplify. The slope is negative, so the line falls

Example 3: (−3, 4) and (5, 4)

m = y₂ − y₁/x₂ − x₁The slope formulam = 4 − 4/5 − (−3)Put in the first point (−3, 4) and the second point (5, 4)m = 0/8Subtract on top and on the bottomm = 0Simplify. The rise is 0, so the line is horizontal

Example 4: (2, −1) and (2, 6)

m = y₂ − y₁/x₂ − x₁The slope formulam = 6 − (−1)/2 − 2Put in the first point (2, −1) and the second point (2, 6)m = 7/0Subtract. The bottom is 0, and you can’t divide by 0Slope: undefinedBoth points have the same x, so the line is vertical

Example 5: (−4, −1) and (2, 3)

m = y₂ − y₁/x₂ − x₁The slope formulam = 3 − (−1)/2 − (−4)Put in the first point (−4, −1) and the second point (2, 3)m = 4/6Subtract on top and on the bottomm = 2/3Simplify. Always reduce the fraction

Either point can go first, but keep the order the same

Using (4, 8) as the first point in Example 1 gives 2 − 8/1 − 4 = −6/−3 = 2: the same slope. What you can’t do is subtract in one order on top and the other order on the bottom.

Four kinds of slope

Coordinate plane from −4 to 4 showing y = x, a line rising from left to right through the origin.xy−4−224−4−224y = x

Positive slope: the line rises from left to right.

Coordinate plane from −4 to 4 showing y = −2x + 1, a line falling from left to right.xy−4−224−4−240y = −2x + 1

Negative slope: the line falls from left to right.

Coordinate plane from −4 to 4 showing y = 2, a horizontal line.xy−4−224−4−240y = 2

Zero slope: the line is horizontal.

Coordinate plane from −4 to 4 showing x = 2, a vertical line.xy−4−24−4−2240x = 2

Undefined slope: the line is vertical.

Positive slopes rise, negative slopes fall, a zero slope is flat, and a vertical line has no slope at all because its run is 0.

Read lines from left to right, the same way you read text. A horizontal line has a rise of 0, so its slope is 0/run = 0. A vertical line has a run of 0, and division by 0 is not defined, so its slope is undefined.

Your turn

Slope through (−1, 7) and (3, −1)
m = y₂ − y₁/x₂ − x₁The slope formulam = −1 − 7/3 − (−1)Put in the first point (−1, 7) and the second point (3, −1)m = −8/4Subtract on top and on the bottomm = −2Simplify
Slope through (0, −3) and (6, 1)
m = y₂ − y₁/x₂ − x₁The slope formulam = 1 − (−3)/6 − 0Put in the first point (0, −3) and the second point (6, 1)m = 4/6Subtract on top and on the bottomm = 2/3Simplify
Slope through (5, 2) and (−1, 2)
m = y₂ − y₁/x₂ − x₁The slope formulam = 2 − 2/−1 − 5Put in the first point (5, 2) and the second point (−1, 2)m = 0/−6Subtract on top and on the bottomm = 0Simplify. A zero slope: the line is horizontal

Slope-intercept form: y = mx + b

When an equation is solved for y, it looks like

y = mx + b

The number in front of x is the slope m. The number on its own, b, is the y-intercept: where the line crosses the y-axis, at (0, b). You can see why: put in x = 0, and y = m(0) + b = b.

Reading the slope and y-intercept from y = mx + b
EquationSlope my-intercept bCrosses the y-axis at
y = 3x − 23−2(0, −2)
y = −x + 4−14(0, 4)
y = 1/2x1/20(0, 0)
y = 505(0, 5)
y = 4 − 2x−24(0, 4)

Watch the last two rows. In y = 5, there is no x term, so m = 0. In y = 4 − 2x, the terms are in a different order, but the slope is still the number with x: −2.

Graphing y = mx + b

  1. Plot the y-intercept (0, b).
  2. From there, use the slope as rise over run to find a second point. For a whole-number slope, write it over 1.
  3. Repeat once more as a check, then draw the line through the points.

Example: y = 3/4x − 2

b = −2Plot (0, −2)m = 3/4Rise 3, run 4(0 + 4, −2 + 3) = (4, 1)The second point
Graph of y = (3/4)x − 2. The line crosses the y-axis at (0, −2). A slope triangle runs right 4 and rises 3 to (4, 1).xy−2−11356−3−11230run 4rise 3(0, −2)(4, 1)

Example: y = −3x + 2

b = 2Plot (0, 2)m = −3 = −3/1Down 3, right 1(1, −1), then (2, −4)Two more points
Graph of y = −3x + 2. The line crosses the y-axis at (0, 2), then goes down 3 and right 1 to (1, −1), and again to (2, −4).xy−2−134−5−4−3−2−110run 1rise −3run 1rise −3(0, 2)(1, −1)(2, −4)

Rewriting an equation in slope-intercept form

If the equation is not solved for y, solve it first, using the same steps as in Solving Linear Equations.

2x + y = 5Starty = −2x + 5Subtract 2x from both sides
4x − 2y = 6Start−2y = −4x + 6Subtract 4x from both sidesy = 2x − 3Divide every term by −2

Your turn

Graph y = −1/2x + 4.
b = 4Plot (0, 4)m = −1/2Down 1, right 2(2, 3) and (4, 2)Two more points
Graph of y = −(1/2)x + 4 through (0, 4), (2, 3) and (4, 2).xy−2−1123456−112350run 2rise −1run 2rise −1(0, 4)(4, 2)
Write 3x + 4y = 8 in slope-intercept form. What are the slope and y-intercept?
4y = −3x + 8Subtract 3xy = −3/4x + 2Divide every term by 4m = −3/4, b = 2Read them off

Line explorer

Change the slope and the y-intercept and watch the line move. Try a slope of 0, then negative slopes. Notice that changing b slides the line up or down without changing its steepness.

Intercepts and standard form

The x-intercept is where a line crosses the x-axis. Every point on the x-axis has y = 0, so to find it, put in y = 0 and solve. The y-intercept is where the line crosses the y-axis, so put in x = 0.

An equation like 3x + 2y = 12, with both variable terms on one side and a number on the other, is in standard form, Ax + By = C. Intercepts are the quickest way to graph it.

x-intercept: let y = 0

3x + 2(0) = 12Put in y = 03x = 12x = 4Divide by 3. The point is (4, 0)

y-intercept: let x = 0

3(0) + 2y = 12Put in x = 02y = 12y = 6Divide by 2. The point is (0, 6)
Graph of 3x + 2y = 12. It crosses the x-axis at (4, 0) and the y-axis at (0, 6), falling from left to right.xy−3−2−1123567−3−2−112345803x + 2y = 12(4, 0)(0, 6)
Plot both intercepts and join them.

Example: 2x − 5y = 10

2x = 10, so x = 5y = 0 gives (5, 0)−5y = 10, so y = −2x = 0 gives (0, −2)

When both intercepts are the origin

For x − 3y = 0, both intercepts are (0, 0), so they give only one point. Choose another x: x = 3 gives 3 − 3y = 0, so y = 1 and the second point is (3, 1).

Your turn

Find the intercepts of 4x + 3y = 12.
4x = 12, so x = 3x-intercept (3, 0)3y = 12, so y = 4y-intercept (0, 4)
Find the intercepts of 5x − 2y = −10.
5x = −10, so x = −2x-intercept (−2, 0)−2y = −10, so y = 5y-intercept (0, 5)

Point-slope form

Suppose a line has slope m and passes through a known point (x₁, y₁). For any other point (x, y) on the line, the slope formula says y − y₁/x − x₁ = m. Multiply both sides by x − x₁ and you get point-slope form:

y − y₁ = m(x − x₁)

It is the fastest way to write an equation when you know a point and the slope.

Slope 3 through (2, 5)

y − 5 = 3(x − 2)Point-slope formy − 5 = 3x − 6Distributey = 3x − 1Add 5 to both sides

Slope −2 through (−1, 4)

y − 4 = −2(x − (−1))Point-slope formy − 4 = −2(x + 1)Subtracting −1 is adding 1y − 4 = −2x − 2Distributey = −2x + 2Add 4 to both sides

Slope 2/3 through (−3, −5)

y − (−5) = 2/3(x − (−3))Point-slope formy + 5 = 2/3(x + 3)Tidy the signsy + 5 = 2/3x + 2Distribute: 2/3 times 3 is 2y = 2/3x − 3Subtract 5 from both sides

Graphing from point-slope form

You don’t have to rearrange first. In y − 1 = −1/2(x − 4), the line goes through (4, 1) and the slope is −1/2. Plot the point, then go down 1 and right 2.

Graph of y − 1 = −(1/2)(x − 4). The line passes through the point (4, 1). From there it goes down 1 and right 2 to (6, 0), and up 1 and left 2 to (2, 2).xy−4−3−2−112345−4−3−2−1124560run 2rise −1(4, 1)(6, 0)(2, 2)
The point in the equation is always on the line.

Watch the signs

The form has minus signs built in, so the point’s coordinates show up with the opposite sign. In y + 2 = 3(x − 1), the line goes through (1, −2), not (1, 2): y + 2 is y − (−2).

Your turn

Write the equation of the line with slope −1/3 through (6, −1) in slope-intercept form.
y + 1 = −1/3(x − 6)Point-slope formy + 1 = −1/3x + 2Distributey = −1/3x + 1Subtract 1

Writing the equation of a line

To write the equation of a line, you need its slope and one point. Every problem comes down to finding those two things.

From a graph

Graph of a line falling from left to right through (0, 4), (2, 1) and (4, −2). A slope triangle from (0, 4) runs right 2 and falls 3 to (2, 1).xy−6−5−4−3−2−112456−6−5−4−3−2−112360run 2rise −3(0, 4)(2, 1)(4, −2)
Find the line’s equation.
b = 4The line crosses the y-axis at (0, 4)m = −3/2From (0, 4) to (2, 1): down 3, right 2y = −3/2x + 4Put m and b into y = mx + b

From a point and a slope: the plug-in method

Point-slope form works, but you can also put the point into y = mx + b and solve for b.

y = 4x + bThe slope is 4−3 = 4(−2) + bPut in the point (−2, −3)−3 = −8 + bb = 5Add 8 to both sidesy = 4x + 5Write the equation

From two points

Find the slope with the formula first, then use either point.

(1, 5) and (3, 9)

m = 9 − 5/3 − 1 = 4/2 = 2Slope5 = 2(1) + bUse (1, 5)b = 3Subtract 2y = 2x + 3Check (3, 9): 2(3) + 3 = 9 ✓

(−2, 7) and (4, −2)

m = −2 − 7/4 − (−2) = −9/6 = −3/2Slope−2 = −3/2(4) + bUse (4, −2)−2 = −6 + bb = 4Add 6y = −3/2x + 4Check (−2, 7): 3 + 4 = 7 ✓

Your turn

Write the equation of this line.

Graph of a line rising from left to right through the marked points (0, −3) and (1, −1).xy−2−1234−2−1120(0, −3)(1, −1)
Show answer
b = −3It crosses the y-axis at (0, −3)m = 2/1 = 2Up 2, right 1y = 2x − 3
Write the equation of the line through (−3, 1) and (3, 5).
m = 5 − 1/3 − (−3) = 4/6 = 2/3Slope5 = 2/3(3) + bUse (3, 5)b = 35 = 2 + by = 2/3x + 3

Horizontal and vertical lines

On a horizontal line every point has the same y-coordinate, so its equation is y = c for some number c. Its slope is 0. On a vertical line every point has the same x-coordinate, so its equation is x = c. Its slope is undefined, and it is the only kind of line that can’t be written as y = mx + b.

Graph of the horizontal line y = 3 and the vertical line x = −2. They cross at (−2, 3).xy−6−5−4−3−1123456−6−5−4−3−2−1124560y = 3x = −2(−2, 3)
y = 3 is horizontal and x = −2 is vertical. Notice that x = −2 crosses the x-axis at −2.
Comparing horizontal and vertical lines
HorizontalVertical
Equationy = cx = c
Slope0undefined
Example points(−1, 3), (4, 3)(−2, 0), (−2, 5)
Crossesthe y-axis at (0, c)the x-axis at (c, 0)

Through (4, −1) and (4, 5)

m = 6/0: undefinedThe x-coordinates are equalx = 4A vertical line

Through (−3, 2) and (5, 2)

m = 0/8 = 0The y-coordinates are equaly = 2A horizontal line

Your turn

Write the equations of the horizontal and the vertical line through (−6, −2).
y = −2Horizontal: keep the y-coordinatex = −6Vertical: keep the x-coordinate

Parallel and perpendicular lines

Parallel lines never meet, so they have the same slope (and different y-intercepts). Perpendicular lines meet at a right angle. Their slopes are opposite reciprocals: flip the fraction and change the sign. Multiply two perpendicular slopes and you always get −1.

Graph of three lines. y = 2x + 1 and y = 2x − 3 are parallel, both rising with slope 2. y = (−1/2)x + 2 falls gently and crosses both of them at right angles.xy−6−5−4−3−2234−6−5−3−2−1134560y = 2x + 1y = 2x − 3y = −(1/2)x + 2
The two teal lines are parallel. The coral line is perpendicular to both.
Parallel and perpendicular slopes
SlopeParallel slopePerpendicular slope
22−1/2
−3/4−3/44/3
1/51/5−5
−1−11
00undefined (vertical)

Parallel to y = 2x + 1 through (3, 1)

m = 2Parallel: same slope1 = 2(3) + bPut in (3, 1)b = −5Subtract 6y = 2x − 5

Perpendicular to y = 2/3x + 4 through (2, −1)

m = −3/2Flip 2/3 and change the sign−1 = −3/2(2) + bPut in (2, −1)−1 = −3 + bb = 2Add 3y = −3/2x + 2

Parallel, perpendicular or neither?

y = 4x − 1 and y = −1/4x + 6
4 · (−1/4) = −1Multiply the slopesPerpendicular
2x + y = 3 and y = −2x + 7
y = −2x + 3Solve the first for yParallelBoth slopes are −2, different intercepts
y = 3x + 2 and y = −3x + 2
3 · (−3) = −9Not equal, and the product is not −1NeitherThey cross at (0, 2), but not at a right angle

Your turn

Write the equation of the line perpendicular to y = −4x + 1 through (8, 3).
m = 1/4Flip −4/1 and change the sign3 = 1/4(8) + bPut in (8, 3)b = 13 = 2 + by = 1/4x + 1

Rate of change problems

In a word problem, the slope is a rate of change: how much one quantity changes for each unit of the other. Its units are “something per something”, like dollars per mile. The y-intercept is the starting value, when x = 0.

The taxi

In y = 2x + 3, the slope 2 means $2 per mile and the y-intercept 3 means $3 before you go anywhere. A 10-mile ride costs 2(10) + 3 = 23 dollars.

A growing plant

A plant is 9 cm tall after 2 weeks and 15 cm tall after 6 weeks. It grows at a steady rate. Write an equation for its height y after x weeks.

m = 15 − 9/6 − 2 = 6/4 = 3/2It grows 3/2 cm, or 1.5 cm, per week9 = 3/2(2) + bUse (2, 9)b = 6It was 6 cm tall at week 0y = 3/2x + 6
Graph of plant height against time. The horizontal axis is weeks from 0 to 8 and the vertical axis is height in centimeters from 0 to 20. The line starts at 6 centimeters at week 0 and passes through (2, 9) and (6, 15).weeksheight (cm)123456782481012141618200run 4rise 6(2, 9)(6, 15)
The y-intercept, 6 cm, is the plant’s height when the measuring started.

A draining tank

A tank holds 400 liters and drains at 25 liters per minute. The amount left is y = −25x + 400. The slope is negative because the amount goes down. When is it empty?

0 = −25x + 400Empty means y = 0: this is the x-intercept25x = 400x = 16Empty after 16 minutes
Graph of water in a tank against time. The horizontal axis is minutes from 0 to 20 and the vertical axis is liters from 0 to 450. The line starts at 400 liters at minute 0 and falls to 0 liters at minute 16.minutesliters24681012141820501001502002503003504500(0, 400)(16, 0)
The intercepts tell the story: 400 liters at the start, empty at 16 minutes.

Your turn

A gym charges a $25 sign-up fee plus $15 a month. Write the cost y after x months. What do 6 months cost?
y = 15x + 25Rate $15 per month, start $2515(6) + 25 = 115$115 for 6 months
A phone battery is at 80% after 1 hour and 50% after 3 hours. Write a linear equation for the charge y after x hours.
m = 50 − 80/3 − 1 = −30/2 = −15It loses 15 percentage points per hour80 = −15(1) + bUse (1, 80)b = 95It started at 95%y = −15x + 95

Common mistakes

✗Slope as run over rise: from (0, 0) to (2, 6), m = 2/6 = 1/3.✓Rise over run: m = 6/2 = 3. The change in y goes on top.
✗Mixing the order: 5 − 1/2 − 4 using (2, 1) and (4, 5), which gives −2.✓Same order on top and bottom: 5 − 1/4 − 2 = 2.
✗Reading the slope of 2x + y = 5 as 2.✓Solve for y first: y = −2x + 5, so m = −2.
✗Point-slope with (−1, 4) and slope 3 written as y − 4 = 3(x − 1).✓Subtract the coordinate: y − 4 = 3(x − (−1)), which is y − 4 = 3(x + 1).
✗Plotting (3, 2) by going up 3 and right 2.✓x comes first: right 3, then up 2.
✗Saying a vertical line has slope 0.✓A vertical line has undefined slope. A horizontal line has slope 0.
✗Drawing x = 3 as a horizontal line through 3 on the y-axis.✓x = 3 is vertical: every point on it has x-coordinate 3.
✗The perpendicular slope to 2/3 is −2/3 or 3/2.✓Flip and change the sign: −3/2. Check: 2/3 · (−3/2) = −1.

Practice problems

Try each one on paper, then open the answer to check your work.

  1. Which quadrant is (−4, −7) in?
    Show answer
    Quadrant IIIBoth coordinates are negative
  2. Is (2, −1) a solution of 3x + 4y = 2?
    Show answer
    3(2) + 4(−1) = 6 − 4 = 2Put in the pointYes2 = 2 is true
  3. Find the slope through (−3, 2) and (1, 10).
    Show answer
    m = 10 − 2/1 − (−3) = 8/4Slope formulam = 2
  4. Find the slope through (4, −2) and (−2, 1).
    Show answer
    m = −2 − 1/4 − (−2) = −3/6Using (−2, 1) as the first pointm = −1/2
  5. Find the slope through (5, −3) and (5, 4), and write the equation of the line.
    Show answer
    m = 7/0: undefinedThe x-coordinates are equalx = 5A vertical line
  6. Give the slope and y-intercept of y = −4x + 7.
    Show answer
    m = −4The number with xy-intercept (0, 7)b = 7
  7. Write 6x − 3y = 9 in slope-intercept form and graph it.
    Show answer
    −3y = −6x + 9Subtract 6xy = 2x − 3Divide by −3
    Graph of y = 2x − 3 through (0, −3) and (1, −1).xy−2−1234−2−1120(0, −3)(1, −1)
  8. Find the intercepts of 2x + 5y = 10 and graph the line.
    Show answer
    2x = 10, so x = 5x-intercept (5, 0)5y = 10, so y = 2y-intercept (0, 2)
    Graph of 2x + 5y = 10 through (5, 0) and (0, 2).xy−2−11234−2−11340(5, 0)(0, 2)
  9. Write and graph the line with slope −1/2 and y-intercept 3.
    Show answer
    y = −1/2x + 3Put m and b into y = mx + b
    Graph of y = −(1/2)x + 3 through (0, 3) and (2, 2).xy−2−11234−112450run 2rise −1(0, 3)(2, 2)
  10. Write the equation of the line with slope 4 through (−2, −5).
    Show answer
    −5 = 4(−2) + bPlug in the pointb = 3Add 8y = 4x + 3
    Graph of y = 4x + 3 through (−2, −5) and (0, 3).xy−4−3−212−6−5−4−3−2−140(−2, −5)(0, 3)
  11. Write the equation of the line through (−1, −4) and (3, 4).
    Show answer
    m = 4 − (−4)/3 − (−1) = 8/4 = 2Slope4 = 2(3) + bUse (3, 4)b = −2y = 2x − 2
    Graph of y = 2x − 2 through (−1, −4) and (3, 4).xy−3−2−12345−5−2−1123450(−1, −4)(3, 4)
  12. Write the equation of the line through (−3, 6) and (−3, −1).
    Show answer
    m = −7/0: undefinedSame x-coordinatex = −3A vertical line
    Graph of the vertical line x = −3 through (−3, 6) and (−3, −1).xy−5−4−2−112−2−112345670(−3, −1)
  13. Write the equation of the line perpendicular to y = 3x − 2 through (6, 1).
    Show answer
    m = −1/3Opposite reciprocal of 31 = −1/3(6) + bPut in (6, 1)b = 31 = −2 + by = −1/3x + 3
    Graph of y = 3x − 2 and the perpendicular line y = −(1/3)x + 3. The point (6, 1) is marked on the second line.xy−3−21234567−2−1124560(6, 1)
  14. Renting a bike for 2 hours costs $12, and for 5 hours it costs $27. Write a linear equation for the cost y of x hours, and say what the slope and y-intercept mean.
    Show answer
    m = 27 − 12/5 − 2 = 15/3 = 5$5 per hour12 = 5(2) + b, so b = 2A $2 fee up fronty = 5x + 2

History: who first put equations on a graph?

The idea of turning an equation into a curve, and a curve into an equation, is called analytic geometry. Two French mathematicians found it at about the same time, each without knowing about the other.

René Descartes (1596–1650) published it in 1637, in La Géométrie, one of three appendices to his famous Discourse on Method, printed in Leiden. The same book started the habit of using letters from the end of the alphabet, like x, y and z, for unknowns and letters from the start, like a, b and c, for known numbers.

Pierre de Fermat (1601–1665), a lawyer and judge in Toulouse who did mathematics in his spare time, wrote a short Introduction to Plane and Solid Loci before the spring of 1636. In it he stated the key idea: whenever an equation has two unknown quantities, “there results a locus fixed in place, and the end point of one of these unknown quantities describes a straight line or a curve.” The first case he worked out was the straight line, which in today’s notation is an equation like Dx = By. Fermat’s essay was passed around in handwritten copies and wasn’t printed until 1679, after his death.

Neither of them drew the grid on this page. They measured from one fixed line, and the perpendicular pair of axes with four quadrants came later. Still, the coordinate plane is often called the Cartesian plane, after Descartes’ Latin name, Cartesius.

Why is slope called m?

Nobody knows. The earliest known use of m for slope is by the Italian mathematician Vincenzo Riccati in 1757. In the 1840s the Irish mathematician George Salmon wrote y = mx + b, and a few years earlier Matthew O’Brien wrote y = mx + c, which is still used in Britain. The choice may have been arbitrary. Some books mention that the French verb monter means “to climb”, but there is no evidence that this is where the letter came from. Other countries use other letters: in Sweden it’s y = kx + m.

How do we know?

Descartes’ 1637 book and the 1679 printing of Fermat’s papers both survive. Fermat’s letters to mathematicians in Paris begin in the spring of 1636, and they show he had already written his essay by then, a year before Descartes’ book was printed. That is how historians know the two found the idea independently.

Practice: Line It Up

A new problem every time, with hints, full steps and a graph of the answer. Choose a level, or mix them all. Type slopes like 2, −3/4 or undefined, points like (4, 0), and equations like y = 2x − 3, y = −1/2x + 4, x = 5 or y = 3. Any correct form of the equation is accepted, such as y − 1 = 2(x − 2) or 2x − y = 3.

Sources

Credits: all graphs on this page are original SVG drawings made for Jugami. Every slope, intercept, equation and plotted point was checked by a script against the equation it belongs to and the graph it is drawn on.