Chalk−1

Math · College algebra · Concept

Slope and equations of lines

The slope of a line measures how steep it is: m=(y2−y1)⁢/⁢(x2−x1), the change in y divided by the change in x between any two of its points. A line with slope m and y-intercept b has the equation y=m⁢x+b, and the line through (x1,y1) with slope m is y−y1=m⁢(x−x1). Parallel lines have equal slopes, and perpendicular lines have slopes whose product is −1.

Try one — Chalk checks each line

A concrete case

Filling a pool

A pool is being filled from a hose. At 2 p.m. the water is 30 cm deep, and at 5 p.m. it is 120 cm deep. The depth rose 90 cm in 3 hours, which is 90÷3=30 cm per hour.

Check the hours in between. At 3 p.m. the depth is 60 cm and at 4 p.m. it is 90 cm. Every hour adds the same 30 cm, so the points sit on a straight line. Pick any two of them and the change in depth divided by the change in time is always 30.

That steady rate is the slope of the line. Run it backward one hour and the depth at 1 p.m. was 30−30=0, so the hose was turned on at 1 p.m. Run it back to noon and the line gives −30 cm, which is impossible. A line describes the real pool only while the hose is running.

120−305−2=30
The pool’s depth hour by hour
TimeHours after noonDepth (cm)Change from the hour before
1 p.m.10hose turned on
2 p.m.23030
3 p.m.36030
4 p.m.49030
5 p.m.512030

The rule

Slope is rise over run

The slope of a line is the change in y divided by the change in x between any two of its points, often called rise over run. With the points written (x1,y1) and (x2,y2), m=(y2−y1)⁢/⁢(x2−x1). Use the same point first on the top and the bottom.

A positive slope rises from left to right and a negative slope falls. A slope of 0 is a horizontal line. A vertical line has a run of 0, and dividing by 0 is undefined, so its slope is undefined. That is not the same as a slope of 0. In a model the slope carries units, output units per input unit, such as 30 cm per hour.

m=y2−y1x2−x1(x2≠x1)
m=y2−y1x2−x1(x2≠x1)

Three ways to write a line

Slope-intercept form, y=m⁢x+b, shows the slope m and the y-intercept b, the height where the line crosses the y-axis at (0,b). Point-slope form, y−y1=m⁢(x−x1), is the line through (x1,y1) with slope m. It is the one to use when the known point is not on the y-axis. Standard form, A⁢x+By=C, keeps both letters on one side, and solving it for y shows the slope −A⁢/⁢B.

Two lines have no slope-intercept form worth the name. A horizontal line is y=k, with slope 0. A vertical line is x=h. It has no y=… form at all, since one x gives many y-values, so it is not the graph of a function.

y=m⁢x+by−y1=m⁢(x−x1)
y=m⁢x+by−y1=m⁢(x−x1)

Parallel and perpendicular lines

Parallel lines have equal slopes, so two different parallel lines never meet. Perpendicular lines have slopes whose product is −1. Each slope is the negative reciprocal of the other, as 2⁢/3 and −3⁢/2 are. A horizontal line and a vertical line are also perpendicular, although the vertical one has no slope to multiply.

m1m2=−1

Why it works

Why the slope never changes

Draw two slope triangles under one line, each with a horizontal run and a vertical rise. Both triangles have a right angle, and both meet the line at the same angle, so they are similar. Their sides are in proportion, and rise÷run comes out the same in both. That is why any two points of a line give the same slope, and why a straight graph means a constant rate.

Point-slope form is the slope formula with one point left free. A point (x,y) is on the line exactly when its slope to (x1,y1) is m, (y−y1)⁢/⁢(x−x1)=m. Multiplying both sides by x−x1 gives y−y1=m⁢(x−x1).

The perpendicular rule comes from turning a slope triangle a quarter turn. A run of 1 with a rise of m turns into a run of −m with a rise of 1. The new slope is 1⁢/⁢(−m)=−1⁢/⁢m, and m⋅(−1⁢/⁢m)=−1.

y−y1x−x1=m ⟹ y−y1=m⁢(x−x1)
y−y1x−x1=m⟹ y−y1=m⁢(x−x1)

The method

The line through two points

Find the slope first, then start from either point. The table works through the line through (−2,7) and (4,−2), the first worked example below.

Either point gives the same line. Starting from (4,−2) instead gives y=−2−(3⁢/2)⁢(x−4), which also expands to y=−(3⁢/2)⁢x+4.

The steps for the line through (−2,7) and (4,−2)
StepWhat to doFor (−2,7) and (4,−2)
1Subtract in the same order on top and bottomm =(−2−7)⁢/⁢(4−(−2)) =−9⁢/6
2Simplify the slopem=−3⁢/2
3Write point-slope form from one pointy−7 =−(3⁢/2)⁢(x+2)
4Solve for y and expandy =−(3⁢/2)⁢x+4
5Check the other point−(3⁢/2)⁢(4)+4 =−2

A line through a point, parallel or perpendicular to another

First find the slope of the given line, solving its equation for y if it is not already in y=m⁢x+b form. A parallel line keeps that slope. A perpendicular line takes the negative reciprocal, so flip the fraction and change its sign. Then write point-slope form through the given point and expand.

For the line through (2,1) perpendicular to y=4⁢x−3, the given slope is 4 and the new slope is −1⁢/4. Point-slope form gives y=1−(1⁢/4)⁢(x−2), which expands to y=−(1⁢/4)⁢x+3⁢/2.

y=1−14⁢(x−2)=−14x+32
y=1−14⁢(x−2)=−14x+32

Where it breaks

Where it breaks

Slope belongs to straight lines. For the points (0,0), (1,1) and (2,4) on y=x2, the slope from the first point to the second is 1 and from the second to the third is 3. Different slopes between neighboring points mean the points are not on one line. For a curve, the same calculation gives an average rate of change over an interval, not the slope of a line.

A vertical line breaks the slope formula, since its run is 0. Its equation is x=h, with no m and no b.

A line fitted to a real situation is true only over the inputs where the situation holds. The pool line gives −30 cm at noon, before the hose was on.

The constant in standard form is not the y-intercept. 2⁢x−3⁢y=6 crosses the y-axis at −2, found by putting x=0, not at 6.

Check your answer

Check your answer

Two points fix a line, and those two points are what you test it with.

Put both given points into your equation. Each must make it true. One point checking is not enough, since many lines pass through one point.

Read the slope from the graph or the table. Move one unit right from any point on the line and the height should change by m.

For a perpendicular line, multiply the two slopes. The product must be −1.

To have Chalk check the work, write the slope as a fraction equal to its value on one row of a Math box, such as (−2−7)⁢/⁢(4−(−2)) =−3⁢/2. A wrong value reads ✗. For the equation, write point-slope form solved for y on one row, y=7−(3⁢/2)⁢(x+2), and the expanded line below it. A wrong expansion reads ✗ with “This expansion isn’t equal to row 1.”

A wrong line under point-slope form, y−7=−(3⁢/2)⁢(x+2), reads ✗ “Not row 1 solved for y.” Under 2⁢x−3⁢y=6 a wrong line still reads ? rather than ✗, so write that first row as y=… to have both checked.

The slopes of x=4 and y=−2 do not multiply to −1. Are the lines perpendicular?

Yes. x=4 is vertical and y=−2 is horizontal, so they meet at a right angle, at (4,−2). The product rule for slopes needs two slopes, and a vertical line has none, since its run is 0. Giving x=4 the slope 0 would make the lines look parallel. The product test covers every perpendicular pair except a vertical line with a horizontal one.

Slope, angle and rate

The slope is the tangent of the angle a line makes with the x-axis. A slope of 1 is a 45⁢° line, and the slope grows without limit as the line turns toward vertical. That is why a vertical line has no slope.

A linear function is the one function whose outputs change by the same amount for every step of 1 in the input. In a table with evenly spaced inputs, equal differences in the outputs show a line before you graph anything.

For a curve, the slope between two of its points is its average rate of change over that interval. Calculus asks what happens to that slope as the two points slide together. The answer, when it exists, is the slope of the curve at a single point.

Common mistakes

  • Subtracting coordinates in different orders on the top and bottom. For (1,2) and (4,8), (8−2)⁢/⁢(1−4)=−2 is wrong. Use the same point first in both, (8−2)⁢/⁢(4−1)=2, because otherwise the signs of rise and run no longer match.
  • Reading b off an equation that is not solved for y. 2⁢x−3⁢y=6 does not have y-intercept 6. Solving for y gives y=(2⁢/3)⁢x−2, so the intercept is −2.
  • Negating a slope for a perpendicular line but forgetting the reciprocal. Perpendicular to 2⁢/3 is −3⁢/2, not −2⁢/3, because the product of the two slopes must be −1.
  • Giving a vertical line slope 0. Its run is 0, and division by 0 is undefined, so its slope is undefined. A slope of 0 belongs to a horizontal line.
  • Using only one point to check a line. y=2⁢x−1 passes through (1,1) but not through (3,7), the second given point. Both points must satisfy the equation, because many lines pass through any single point.
  • Dropping the units of a slope. A fare that rises $1.75 per kilometer has slope 1.75 dollars per kilometer. Without the units, 1.75 could be per mile or per minute, and the model says nothing.

Key terms

Slope of a line
The ratio m=(y2−y1)⁢/⁢(x2−x1) of the change in y to the change in x between two points of a nonvertical line. Every pair of points on the line gives the same slope.
Slope-intercept form
The equation y=m⁢x+b of a nonvertical line, where m is the slope and (0,b) is the y-intercept.
Point-slope form
The equation y−y1=m⁢(x−x1) of the line with slope m through the point (x1,y1).
Parallel and perpendicular lines
Distinct nonvertical lines are parallel when their slopes are equal and perpendicular when their slopes multiply to −1. Vertical lines are parallel to one another and perpendicular to horizontal lines.
x-intercept
A point where a graph crosses or touches the x-axis, so its y-value is 0. For y=f⁡(x), its x-value is a zero (root) of f.
y-intercept
The point where a graph crosses the y-axis, found by setting x=0: (0,f⁡(0)) when 0 is in the domain.
Average rate of change
The change in output divided by the change in input between two distinct inputs a and b: (f⁡(b)−f⁡(a))⁢/⁢(b−a). Geometrically it is the slope of the secant line through the two points.

Work through an example

Find the equation of the line through (−2,7) and (4,−2) in slope-intercept form.

Find the equation of a line through two points →

Write parallel and perpendicular lines →

Interpret slope as a rate of change →

Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Graph the line Check the line in Math Study the 7 key terms Open worked example on a board Slope formula in Math Reference

Your existing work stays on this device. Examples open as editable copies.