✖

Slope-intercept form of a line

The slope-intercept form of a line is based on the size of the angle that the line makes with the x-axis.

Motivation

We have a line p with the general equation ax + by + c = 0. We know that the graph of a linear function is a line. We usually write a linear function in the form y = f(x), so we might want to convert the general equation ax + by + c = 0 to this form. To do that we need b ≠ 0, because we have to isolate y, which means dividing the whole equation by b. If b ≠ 0, we can rearrange the general equation like this:

ax+by+c=0(÷b)axb+y+cb=0(isolate y)y=−axb−cb

This gives us the usual form of a linear function. Because this expression is rather clumsy, we introduce new letters: we write m for the fraction −ab, which is the slope (gradient) of the line, and b for the fraction −cb. Careful: this new b (the y-intercept) is a different number from the coefficient b of the general equation. Then we can write the previous equation as:

y=mx+b

It is not a different form: instead of the ugly fraction −cb we have simply written b, and that is all. Because mx + b describes an ordinary linear function, a line in this form cannot be parallel to the y-axis. We have already ruled that out by requiring the coefficient b of the general equation to satisfy b ≠ 0.

If this coefficient were b = 0, the line would be parallel to the y-axis and the general equation of such a line would have the form ax + c = 0. If we divide this equation by a and rearrange it, we get:

ax+c=0(÷a)x+ca=0x=−ca

Because the fraction −ca is ugly again, we introduce the substitution d=−ca, so in the end we get the equation

x=d

To sum up, we can write every line that is not parallel to the y-axis in the form y = mx + b, where m, b ∈ ℝ, and every line parallel to the y-axis in the form x = d, where d ∈ ℝ.

An equation of the form y = mx + b is called the slope-intercept form of a line, and we call the coefficient m the slope of the line.

Example

We have a line that passes through the points A(2, 8), B(8, 10). Find the slope-intercept form of the line. The slope-intercept form is best found from the general equation of the line, so we construct that first. The general equation has the form ax + by + c = 0, where (a, b) is a normal vector, so we find a normal vector. The direction vector has coordinates (8, 10) − (2, 8) = (6, 2), so the normal vector n→ has coordinates (−2, 6). We can substitute a = −2, b = 6 into the general equation:

−2x+6y+c=0

In place of (x, y) we substitute a point that the line certainly passes through, for example the point B(8, 10). So we substitute x = 8, y = 10 into the equation:

−2⋅8+6⋅10+c=0−16+60+c=0c=−44

We get the general equation

−2x+6y−44=0

We can divide this equation by −2 to get a slightly nicer form:

x−3y+22=0

We get the slope-intercept form by isolating y. We move all the other terms to the right-hand side and then divide the equation by three:

x−3y+22=0−3y=−x−22(⋅(−1))3y=x+22(⋅13)y=13x+223

The last line is the line in slope-intercept form. If we want the coefficients m, b of the slope-intercept form, we write m=13,b=223. You can also look at the graph of the line with the direction vector u→ and the normal vector n→:

The line p with the direction vector \vec{\mathbf{u}} and the normal vector \vec{\mathbf{n}}

If the coefficient b had not come out as awkward as 223, you would see at a glance that b is the y-coordinate of the point where the line crosses the y-axis (the y-intercept). The point where the line meets the y-axis has x-coordinate x = 0. If we substitute this into the equation y=13x+223, we get y=13⋅0+223=223, so for x = 0 the value of y is y=223.

The slope of a line

If we have the equation of a line in slope-intercept form y = mx + b, we call the number m the slope of the line. The slope is related to the angle that the line makes with the positive x-axis. Look at the following picture:

Four different lines with different slopes

The picture shows four different lines with different slopes m but always the same coefficient b = 2. All the lines have the form y = mx + 2. Notice that as the slope, that is, the number in front of the unknown x, changes continuously, the angle that the line makes with the positive x-axis changes too. For example, the purple line y=12x+2 makes the angle δ with the axis, the red line y = x + 2 makes the angle γ and the green line y = 2x + 2 makes the angle β.

In this case, the greater the slope, the greater the angle the line makes with the axis. The slope of the purple line y=12x+2 is m1=12, the slope of the green line y = 2x + 2 is m2 = 2, so m1 < m2. At the same time δ < β. But the slope of the blue line y = −2x + 2 is m3 = −2, which is smaller than all the previous ones, and yet the angle α is the largest of all the angles.

We can see that the slope m is related to the angle somehow. Let’s look at it more closely. We will show only the purple line y=12x+2, and we will be interested in the angle δ. We choose any two different points A, B on the line and use them to build the right-angled triangle ABC, as shown in the picture. The angles δ and ϵ are equal, because they are corresponding angles.

The line y = \frac12x+2

We will now try to express the angle ϵ using the line segments AC and BC. To do that, we need to know their lengths. Let’s label the coordinates of the points A and B like this: A = (x1, y1) = (2, 3) and B = (x2, y2) = (6, 5). The length of the segment AC is then equal to the difference |x2 − x1| = |6 − 2| = 4. We take the x-coordinate of the point B, which is the same as the x-coordinate of the point C, and subtract the x-coordinate of the point A. This gives us the length of the segment AC. We do the same with the segment BC, only with the y-coordinates. So |BC| = |y2 − y1| = |5 − 3| = 2.

Next we use the trigonometric functions, specifically the tangent. In the right-angled triangle ABC, for the angle ϵ we have tan⁡(ϵ)=|BC||AC|. The tangent of the angle ϵ is the ratio of the opposite side to the adjacent side. If we substitute the distances for the segments, we get:

tan⁡(ϵ)=|BC||AC|=|y2−y1||x2−x1|=24=12

So the tangent of the angle ϵ, which is the same as the angle δ, comes out as 12. The tangent of the angle that the line makes with the positive x-axis is 12. And the equation of this line is y=12x+2, so the tangent of the angle that the line makes with the positive x-axis is equal to the slope of the line! This is no coincidence, and it holds in general:

If a line p has the slope-intercept equation y = mx + b, then the slope m is equal to the tangent of the angle that the line p makes with the positive x-axis.

Chapters: Parametric equations of a line, General equation of a line, Normal vector of a line, Slope-intercept form of a line, Equation of a line in 3D