Writing the Equation of a Line

Learning Objectives

Introduction

The concept of slope is important to understand because it is often used to measure the rate at which changes are taking place. 

Slope-intercept Form

A linear equation can be expressed in the form `y=mx+b`. In this equation, `x` and `y` are coordinates of a point, `m` is the slopeThe ratio of the vertical change to the horizontal change of two points on a line. `Slope=(rise)/(run)`, and `b` is the `y`-coordinate of the y-interceptThe point where the graph of a linear equation intersects the `y`-axis `(0, y)`. . Because this equation describes a line in terms of its slope and its `y`-intercept, this equation is called the slope-intercept formA linear equation written in the form `y = mx + b`, where `m` represents the slope of the line, and `b` represents the `y`-value of the `y`-intercept, `(0, b)`. . When working with linear relationships, the slope-intercept form helps to translate between the graph of a line and the equation of a line. 

Changing the value of `m` in a linear equation changes the slope of the line. If `m` is positive, the line slopes up as you move from left to right. If `m` is negative, the line slopes down as you move from left to right. If `m` is zero, the line is horizontal. 

When `m` is positive, as `m` gets larger the upward slope of the line gets steeper. When the value of `m` gets close to zero, the upward slope flattens. 

When `m` is negative, as the absolute value of `m` gets larger the downward slope of the line gets steeper. When the absolute value of `m` gets close to zero, the downward slope flattens. 

Changing the value of `b` (the `y`-intercept) in a linear equation moves the line up and down on the coordinate plane. A positive `y`-intercept means the line crosses the `y`-axis above the origin. The larger the value of `b`, the higher up it crosses the `y`-axis. A negative `y`-intercept means that the line crosses below the origin. The larger the absolute value of `b`, the farther down it crosses the `y`-axis.  

Simply by changing the values of `m` and `b` in a linear equation, you can define any line. That’s how powerful and versatile the slope-intercept formula is.

Supplemental Interactive Activity

The graph below represents any line that can be written in slope-intercept form. It has two slider bars that can be manipulated. The bar labeled `m` lets you adjust the slope, or steepness, of the line. The bar labeled `b` changes the `y`-intercept. Try sliding each bar back and forth, and see how that affects the line.

Now that you understand the slope-intercept form, you can look at the graph of a line and write its equation just by identifying the slope and the `y`-intercept from the graph. Let’s try it with the line in this graph.

A graph shows a coordinate plane. A straight line passes through two labeled points. The first point is at (negative 5, 0). The second point is at (0, 4), and is labeled “y-intercept.” A vertical line labeled “rise equals 4” starts at (negative 5, 0) and moves up by 4, ending at (negative 5, 4). A horizontal line labeled “run equals 5” starts at (negative 5, 4) and moves right by 5, ending at (0, 4).

For this line, the slope is `4/5`, and the `y`-intercept is `4`. If you put those values into the slope-intercept form, `y=mx+b`, you get the equation `y=4/5x+4`.

Example

Problem

Write the equation of the line that has a slope of `1/2` and a `y`-intercept of `-5`.

 

`y=1/2x+b`

Substitute the slope `(m)` into `y = mx + b`.

Answer

`y=1/2x+(-5)`

or

`y=1/2-5`

Substitute the `y`-intercept `(b)` into the equation.

If you know the slope of a line and a point on the line, you can draw a graph. So, using an equation in the point-slope form, you can easily identify the slope and a point. Consider the equation `y=-3x-1`. You can tell from this equation that the `y`-intercept is at `(0, -1)`. Start by plotting that point, `(0, -1)`, on a graph.

You can also tell from the equation that the slope of this line is `-3`. So start at `(0, -1)` and count up `3` and over `-1` (`1` unit in the negative direction, left) and plot a second point. (You could also have gone down `3` and over `1`.) Then draw a line through both points, and there it is, the graph of `y=-3x-1`.

A graph shows a coordinate plane. A straight line passes through two labeled points. The first point is at (zero, negative 1), and is labeled y-intercept. The second point is at (negative 1, 2). A vertical line labeled “rise equals 3” starts at (zero, negative 1) and moves up by 3, ending at (zero, 2). A horizontal line labeled “run equals negative 1” starts at (zero, 2) and moves left by 1, ending at (negative 1, 2).

What is the equation of a line that has a slope of `-2` and goes through the point `(0, 8)`?

 

A) `y = -2x + 8`

 

B) `y = 8x - 2`

 

C) `y = -2x + 0`

 

D) `0 = 8x - 2`

 

 

Slope and a Point on the Line

Using slope-intercept form to help write the equation of a line is possible when you know both the slope `(m)` and the `y`-intercept `(b)`, but what if you know the slope and just any point on the line, not specifically the `y`-intercept? Can you still write the equation? The answer is yes, but you will need to put in a little more thought and work than you did previously.

Recall that a point is an `(x, y)` coordinate pair and that all points on the line will satisfy the linear equation. So, if you have a point on the line, it must be a solution to the equation. Although you don’t know the exact equation yet, you know that you can express the line in slope-intercept form, `y = mx + b`.

You do know the slope `(m)`, but you just don’t know the value of the `y`-intercept `(b)`. Since point `(x, y)` is a solution to the equation, you can substitute its coordinates for `x` and `y` in `y = mx + b` and solve to find `b`!

This may seem a bit confusing with all the variables, but an example with an actual slope and a point will help to clarify.

Example

Problem

Write the equation of the line that has a slope of `3` and contains the point `(1, 4)`.

 

`y = 3x + b`

Substitute the slope `(m)` into `y = mx + b`.

 

`4 = 3(1) + b`

Substitute the point `(1, 4)` for `x` and `y`.

 

`4 = 3 + b`

`1 = b`

Solve for `b`.

Answer

`y = 3x + 1`

Rewrite `y = mx + b` with `m = 3` and `b = 1`.

To confirm our algebra, you can check by graphing the equation `y = 3x + 1`. The equation checks because when graphed, it passes through the point `(1, 4)`.

A graph shows a coordinate plane. A straight line passes through two labeled points. The first point is at (zero, 1), and is labeled y-intercept. The second point is at (1, 4). A vertical line labeled “rise equals 3” starts at point (zero, 1) and moves up by 3, ending at (zero, 4). A horizontal line labeled “run equals 1” starts at (zero, 4) and moves right by 1, ending at (1, 4).

Advanced Example

Problem

Write the equation of the line that has a slope of `-7/8` and contains the point `(4,5/4)`.

`y=mx+b`

`y=-7/8x+b`

Substitute the slope `(m)` into `y=mx+b`.

`5/4=-7/8(4)+b`

Substitute the point `(4,5/4)` for `x` and `y`.

`5/4=-28/8+b`

`5/4=-14/4+b`

`5/4+14/4=-14/4+14/4+b`

`19/4=b`

Solve for `b`.

Answer

`y=-7/8x+19/4`

Rewrite `y=mx+b` with `m=-7/8` and `b=19/4`.

 

Write the slope-intercept form of the line with a slope of `2/3` and which contains the point `(9, 4)`.

 

A) `y=-2x+2/3`

 

B) `y=2/3x-2`

 

C) `y=2/3x+10`

 

D) `y=2/3x+19/3`

 

 

 

Advanced Question

Write the slope-intercept form of the line with a slope of `-0.6` and which contains the point `(3.8, 7.25)`.

 

A) `y = -0.6x + 3.8`

 

B) `y = -0.6x + 4.97`

 

C) `y = 3.8x + 7.25`

 

D) `y = -0.6x + 9.53`

 

 

Two Points on the Line

Let’s suppose you don’t know either the slope or the `y`-intercept, but you do know the location of two points on the line. It is more challenging, but you can find the equation of the line that would pass through those two points. You will again use slope-intercept form to help you.

The slope of a linear equation is always the same, no matter which two points you use to find the slope. Since you have two points, you can use those points to find the slope `(m)`. Now you have the slope and a point on the line! You can now substitute values for `m`, `x`, and `y` into the equation `y = mx + b` and find `b`.

Example

Problem

Write the equation of the line that passes through the points `(2, 1)` and `(-1, -5)`.

 

`(1-(-5))/(2-(-1))=6/3=2`

Find the slope using the given points.

 

`y = 2x + b`

Substitute the slope `(m)` into `y = mx + b`.

 

`1 = 2(2) + b`

Substitute the coordinates of either point for `x` and `y`—this example uses `(2, 1)`.

 

`1 = 4 + b`

`-3 = b`

Solve for `b`.

Answer

`y = 2x + (-3)`, or

`y = 2x - 3`

Rewrite `y = mx + b` with `m = 2` and `b = -3`.

Notice that it doesn’t matter which point you use when you substitute and solve for `b`—you get the same result for `b` either way. In the example above, you substituted the coordinates of the point `(2, 1)` in the equation `y = 2x + b`. Let’s start with the same equation, `y = 2x + b`, but substitute in `(-1, -5)`:

`y = 2x + b`

`-5 = 2(-1) + b`

`-5 = -2 + b`

`-3 = b`

The final equation is the same: `y = 2x - 3`.

Advanced Example

Problem

Write the equation of the line that passes through the points `(-4.6,6.45)` and `(1.15, 7.6)`.

`(7.6-6.45)/(1.15-(-4.6))=1.15/5.75=0.2`

Find the slope using the given points.

`y=0.2x+b`

Substitute the slope `(m)` into `y=mx+b`.

`7.6` `=` `0.2(1.15)+b`
`7.6` `=` `0.23+b`
`7.6-0.23` `=` `0.23-0.23+b`
`7.37` `=` `b`

 

 

Substitute either point for `x` and `y`. This example uses `(1.15,7.6)`. Then solve for `b`.

`y=0.2x+7.37`

Rewrite `y=mx+b` with `m = 0.2` and `b = 7.37`.

Answer

The equation of the line that passes through the points `(-4.6,6.45)` and `(1.15,7.6)` is `y=0.2x+7.37`.

     

 

Write the slope-intercept form of the line that passes through `(5, 2)` and `(-1, -10)`.

 

A) `y=2x+12`

 

B) `y=1/2x-7/2`

 

C) `y=2x-8`

 

D) `y=2x+1`

 

 

 

Advanced Question

Which of the following lines goes through the points `(3/2,-4)` and `(7/4,-2)`?

 

A) `y=1/2x-3/4`

 

B) `y=8x-16`

 

C) `y=1/2x+16`

 

D) `y=8x-3/4`

 

 

Summary

The slope-intercept form of a linear equation is written as `y = mx + b`, where `m` is the slope and `b` is the value of `y` at the `y`-intercept, which can be written as `(0, b)`. When you know the slope and the `y`-intercept of a line, you can use the slope-intercept form to immediately write the equation of that line. The slope-intercept form can also help you to write the equation of a line when you know the slope and a point on the line or when you know two points on the line.