# 5.1: Linear Equations in Slope-Intercept Form

**At Grade**Created by: CK-12

## Learning Objectives

- Write an equation given slope and \begin{align*}y-\end{align*}intercept.
- Write an equation given the slope and a point.
- Write an equation given two points.
- Write a linear function in slope-intercept form.
- Solve real-world problems using linear models in slope-intercept form.

## Introduction

We saw in the last chapter that linear graphs and equations are used to describe a variety of real-life situations. In mathematics, we want to find equations that explain a situation as presented in a problem. In this way, we can determine the rule that describes the relationship between the variables in the problem. Knowing the equation or rule is very important since it allows us to find the values for the variables. There are different ways to find an equation that describes the problem. The methods are based on the information you can gather from the problem. In graphing these equations, we will assume that the domain is all real numbers.

## Write an Equation Given Slope and y-intercept

Let’s start by learning how to write an equation in slope–intercept form \begin{align*}y=mx+b\end{align*}.

\begin{align*}b\end{align*} is the \begin{align*}y-\end{align*}intercept (*the value of* \begin{align*}y\end{align*} *when* \begin{align*}x=0\end{align*}. *This is the point where the line crosses the* \begin{align*}y-\end{align*}*axis)*.

\begin{align*}m\end{align*} is the slope *how the quantity* \begin{align*}y\end{align*} *changes with each one unit of* \begin{align*}x\end{align*}.

**If you are given the slope and** \begin{align*}y-\end{align*}**intercept of a line:**

- Start with the slope–intercept form of the line \begin{align*}y=mx+b\end{align*}.
- Substitute the given values of \begin{align*}m\end{align*} and \begin{align*}b\end{align*} into the equation.

**Example 1**

a) *Write an equation with a* \begin{align*}\text{slope} = 4\end{align*} *and a* \begin{align*}y-\end{align*}*intercept* \begin{align*}= -3\end{align*}.

b) *Write an equation with a* \begin{align*}\text{slope} = -2\end{align*} *and a* \begin{align*}y-\end{align*}*intercept* \begin{align*}= 7\end{align*}.

c) *Write an equation with a* \begin{align*}\text{slope} = \frac{2}{3}\end{align*} *and a* \begin{align*}y-\end{align*}*intercept* \begin{align*}= \frac{4}{5}\end{align*}.

a) **Solution**

We are given \begin{align*}m=4\end{align*} and \begin{align*}b=-3\end{align*}. Plug these values into the slope–intercept form \begin{align*}y=mx+b\end{align*}.

\begin{align*}y = 4x -3\end{align*}

b) **Solution**

We are given \begin{align*}m=-2\end{align*} and \begin{align*}b=7\end{align*}. Plug these values into the slope–intercept form \begin{align*}y=mx+b\end{align*}.

\begin{align*}y = -2x +7\end{align*}

c) **Solution**

We are given \begin{align*}m=\frac{2}{3}\end{align*} and \begin{align*}b=\frac{4}{5}\end{align*}. Plug these values into the slope–intercept form \begin{align*}y=mx+b\end{align*}.

\begin{align*} y = \frac {2}{3}x + \frac {4}{5}\end{align*}

You can also write an equation in slope-intercept form if you are given the graph of the line.

**Example 2**

*Write the equation of each line in slope–intercept form.*

a)

b)

c)

d)

a) The \begin{align*}y-\end{align*}intercept \begin{align*}= -4 \end{align*} and the \begin{align*}\text{slope} =-\frac{5}{2}\end{align*}. Plug these values into the slope–intercept form \begin{align*}y = mx + b\end{align*}.

**Solution**

\begin{align*}y = -\frac {5}{2}x - 4\end{align*}

b) The \begin{align*}y-\end{align*}intercept \begin{align*}= 2\end{align*} and the \begin{align*}\text{slope} =\frac{3}{1}\end{align*}. Plug these values into the slope–intercept form \begin{align*}y = mx + b\end{align*}.

**Solution**

\begin{align*}y = 3x + 2\end{align*}

c) The \begin{align*}y-\end{align*}intercept \begin{align*}= 4 \end{align*} and the \begin{align*}\text{slope} =-\frac{1}{1}\end{align*}. Plug these values into the slope–intercept form \begin{align*}y = mx + b\end{align*}.

**Solution**

\begin{align*}y = -x + 4\end{align*}

d) The \begin{align*}y-\end{align*}intercept \begin{align*}= -2\end{align*} and the \begin{align*}\text{slope} =\frac{1}{2}\end{align*}. Plug these values into the slope–intercept form \begin{align*}y = mx + b\end{align*}.

**Solution**

\begin{align*} y = \frac{1}{2}x - 2.\end{align*}

## Write an Equation Given the Slope and a Point

Often, we don’t know the value of the \begin{align*}y-\end{align*}intercept, but we know the value of \begin{align*}y\end{align*} for a non-zero value of \begin{align*}x\end{align*}. In this case we can still use the slope–intercept form to find the equation of the line.

For example, we are told that the slope of a line is two and that the line passes through the point (1, 4). To find the equation of the line, we start with the slope–intercept form of a line.

\begin{align*}y = mx + b\end{align*}

Plug in the value of the slope.

We don’t know the value of \begin{align*}b\end{align*} but we know that the slope is two, and that point (1, 4) is on this line. Where the \begin{align*}x\end{align*} value is one, and the \begin{align*}y\end{align*} value is four. We plug this point in the equation and solve for \begin{align*}b\end{align*}.

\begin{align*}4 & = 2(1)+b\\ 4 & = 2+b\\ -2 & = -2\\ 2 &= b\end{align*}

Therefore the equation of this line is \begin{align*}y = 2x + 2\end{align*}.

**If you are given the slope and a point on the line:**

- Start with the slope–intercept form of the line \begin{align*}y = mx + b\end{align*}.
- Plug in the given value of \begin{align*}m\end{align*} into the equation.
- Plug the \begin{align*}x\end{align*} and \begin{align*}y\end{align*} values of the given point and solve for \begin{align*}b\end{align*}.
- Plug the value of \begin{align*}b\end{align*} into the equation.

**Example 3**

*Write the equation of the line in slope–intercept form.*

a) The slope of the line is 4 and the line contains point (-1, 5).

b) The slope of the line is \begin{align*}-\frac{2}{3}\end{align*} and the line contains point (2, -2).

c) The slope of the line is -3 and the line contains point (3, -5).

**Solution**

a)

\begin{align*}\text{Start with the slope–intercept form of the line} & & y & = mx + b\\ \text{Plug in the slope}. & & y & = 4x + b\\ \text{Plug point} \ (-1, 5) \ \text{into the equation}. & & 5&=4(-1)+b \Rightarrow b=9\\ \text{Plug the value of} \ b \ \text{into the equation}. & & y & =4x+9\end{align*}

b)

\begin{align*}\text{Start with the slope–intercept form of the line} & & y & = mx + b\\ \text{Plug in the slope}. & & y & = -\frac{2}{3}x + b\\ \text{Plug point} \ (2,-2) \ \text{into the equation}.& & -2 & =-\frac{2}{3}(2)+b \Rightarrow b=-2+\frac{4}{3}=-\frac{2}{3}\\ \text{Plug the value of} \ b \ \text{into the equation}.& & y & =-\frac{2}{3}x-\frac{2}{3}\end{align*}

c)

\begin{align*}\text{Start with the slope–intercept form of the line} & & y & = mx + b\\ \text{Plug in the slope}. & & y & = -3x + b\\ \text{Plug point} \ (3,-5) \ \text{into the equation}. & & -5 & =-3(3)+b \Rightarrow b=4\\ \text{Plug the value of} \ b \ \text{into the equation}. & & y & =-3x+4\end{align*}

## Write an Equation Given Two Points

One last case is when we are just given two points on the line and we are asked to write the line of the equation in slope–intercept form.

For example, we are told that the line passes through the points (-2, 3) and (5, 2). To find the equation of the line we start with the slope–intercept form of a line

\begin{align*}y = mx + b\end{align*}

Since we don’t know the slope, we find it using the slope formula \begin{align*} m=\frac {y_2-y_1}{x_2-x_1}\end{align*}.

Now substitute the \begin{align*}x_1\end{align*} and \begin{align*}x_2\end{align*} and the \begin{align*}y_1\end{align*} and \begin{align*}y_2\end{align*} values into the slope formula to solve for the slope.

\begin{align*}m=\frac {2-3}{5-(-2)}=-\frac{1}{7}\end{align*}

We plug the value of the slope into the slope–intercept form \begin{align*} y=-\frac {1}{7}x+b\end{align*}

We don’t know the value of \begin{align*}b\end{align*} but we know two points on the line. We can plug either point into the equation and solve for \begin{align*}b\end{align*}. Let’s use point (-2, 3).

Therefore, the equation of this line is \begin{align*} y=-\frac {1}{7}x+\frac{19}{7}\end{align*}.

**If you are given two points on the line:**

- Start with the slope–intercept form of the line \begin{align*}y = mx + b\end{align*}
- Use the two points to find the slope using the slope formula \begin{align*} m=\frac {y_2-y_1}{x_2-x_1}\end{align*}.
- Plug the given value of \begin{align*}m\end{align*} into the equation.
- Plug the \begin{align*}x\end{align*} and \begin{align*}y\end{align*} values of one of the given points into the equation and solve for \begin{align*}b\end{align*}.
- Plug the value of \begin{align*}b\end{align*} into the equation.
- Plug the other point into the equation to check the values of \begin{align*}m\end{align*} and \begin{align*}b\end{align*}.

**Example 4**

*Write the equations of each line in slope–intercept form.*

a) The line contains the points (3, 2) and (-2, 4).

b) The line contains the points (-4, 1) and (-2, 3).

**Solution:**

a)

- Start with the slope–intercept form of the line \begin{align*}y = mx + b\end{align*}.
- Find the slope of the line. \begin{align*} m=\frac {y_2-y_1}{x_2-x_1}=\frac {4-2}{-2-3}=-\frac {2}{5}\end{align*}
- Plug in the value of the slope. \begin{align*} y=-\frac {2}{5}x+b\end{align*}
- Plug point (3, 2) into the equation. \begin{align*} 2=-\frac {2}{5}(3)+b\Rightarrow b=2+\frac {6}{5}=\frac{16}{5}\end{align*}
- Plug the value of \begin{align*}b\end{align*} into the equation. \begin{align*} y=-\frac {2}{5}x+\frac {16}{5}\end{align*}
- Plug point (-2, 4) into the equation to check. \begin{align*} 4=-\frac {2}{5}(-2)+\frac {16}{5}=\frac {4}{5}+\frac {16}{5}=\frac {20}{5}=4\end{align*}

b)

- Start with the slope–intercept form of the line \begin{align*}y = mx + b\end{align*}.
- Find the slope of the line. \begin{align*} m=\frac {y_2-y_1}{x_2-x_1}=\frac {3-1}{-2-(-4)}=\frac {2}{2}=1\end{align*}
- Plug in the value of the slope. \begin{align*}y = x + b\end{align*}
- Plug point (-2, 3) into the equation. \begin{align*}3=-2+b\Rightarrow b=5\end{align*}
- Plug the value of \begin{align*}b\end{align*} into the equation. \begin{align*}y = x + 5\end{align*}
- Plug point (-4, 1) into the equation to check. \begin{align*}1 = -4 + 5 = 1\end{align*}

## Write a Linear Function in Slope-Intercept Form

Remember that you write a linear function in the form \begin{align*}f(x) = mx+b\end{align*}. Here \begin{align*}f(x)\end{align*} represents the \begin{align*}y\end{align*} values of the equation or the graph. So \begin{align*}y = f(x)\end{align*} and they are often used interchangeably. Using the functional notation in an equation gives us more information.

For instance, the expression \begin{align*}f(x) = mx+b\end{align*} shows clearly that \begin{align*}x\end{align*} is the independent variable because you **plug in** values of \begin{align*}x\end{align*} into the function and perform a series of operations on the value of \begin{align*}x\end{align*} in order to calculate the values of the dependent variable, \begin{align*}y\end{align*}.

In this case when you plug \begin{align*}x\end{align*} into the function, the function tells you to multiply it by \begin{align*}m\end{align*} and then add \begin{align*}b\end{align*} to the result. This generates all the values of \begin{align*}y\end{align*} you need.

**Example 5**

*Consider the linear function \begin{align*}f(x) = 3x-4\end{align*}. Find \begin{align*}f(2), f(0)\end{align*} and \begin{align*}f(-1)\end{align*}.*

**Solution**

All the numbers in the parentheses are the values of \begin{align*}x\end{align*} that you need to plug into the equation of the function.

When you plug values into a function, it is best to plug in the whole parenthesis, not just the value inside the parenthesis. We often plug expressions into the function instead of numbers, and it is important to keep the expression inside the parenthesis in order to perform the correct order of operations. For example, we want to find \begin{align*}f(2x-1)\end{align*} for the same function we used before.

Functional notation is a very compact way of giving information. For example you are told that \begin{align*}f(3)=2\end{align*}.

To read this information, remember a few things.

The value inside the parentheses is the \begin{align*}x-\end{align*}value.

The value equal to the function is the dependent value (i.e. the \begin{align*}y-\end{align*}value for lines).

So, \begin{align*}f(3) = 2\end{align*} tells you that \begin{align*}x = 3\end{align*} and \begin{align*}y = 2\end{align*} or that point (3, 2) is on the line.

We will now use functional notation to write equations of lines in slope–intercept form.

**Example 6**

*Find the equation of the following lines in slope–intercept form*

a) \begin{align*}m = -2\end{align*} *and* \begin{align*}f(0)=5\end{align*}.

b) \begin{align*}m = 3.5\end{align*} *and* \begin{align*}f(-2) = 1\end{align*}.

c) \begin{align*}f(-1) = 1\end{align*} *and* \begin{align*}f(1) = -1\end{align*}.

**Solution**

a) We are told that \begin{align*}m = -2\end{align*} and the line contains point (0, 5), so \begin{align*}b = 5\end{align*}.

Plug the values of \begin{align*}m\end{align*} and \begin{align*}b\end{align*} into the slope–intercept form \begin{align*}f(x) = mx + b\end{align*}.

\begin{align*}f(x) = -2x + 5.\end{align*}

b) We are told that \begin{align*}m = 3.5\end{align*} and line contains point (-2, 1).

\begin{align*}\text{Start with slope–intercept form}. & & f(x) & = mx + b\\ \text{Plug in the value of the slope}. & & f(x) & = 3.5x + b\\ \text{Plug in the point} \ (-2, 1). & & 1 & =3.5(-2)+\Rightarrow b=1+7=8\\ \text{Plug the value of} \ b \ \text{in the equation}.& & f(x) & = 3.5x + 8\end{align*}

c) We are told that the line contains the points (-1, 1) and (1, -1).

\begin{align*}\text{Start with slope–intercept form}. & & f(x) & = mx + b\\ \text{Find the slope}.& & m &= \frac {-1-1}{1-(-1)} =\frac {-2}{2} = -1\\ \text{Plug in the value of the slope}.& & f(x) & = -1x + b\\ \text{Plug in the point} & & (-1, 1). 1 & =-1(-1)+b\Rightarrow b=0\\ \text{Plug the value of} \ b \ \text{in the equation}.& & f(x) & = -x\end{align*}

## Solve Real-World Problems Using Linear Models in Slope-Intercept Form

Let’s apply the methods we just learned to a few application problems that can be modeled using a linear relationship.

**Example 7**

*Nadia has $200 in her savings account. She gets a job that pays $7.50 per hour and she deposits all her earnings in her savings account. Write the equation describing this problem in slope–intercept form. How many hours would Nadia need to work to have $500 in her account?*

Let’s define our variables

\begin{align*}y =\end{align*} amount of money in Nadia’s savings account

\begin{align*}x =\end{align*} number of hours

You can see that the problem gives us the \begin{align*}y-\end{align*}intercept and the slope of the equation.

We are told that Nadia has $200 in her savings account, so \begin{align*}b = 200\end{align*}.

We are told that Nadia has a job that pays $7.50 per hour, so \begin{align*}m = 7.50\end{align*}.

If we plug these values in the slope–intercept form \begin{align*}y = mx + b\end{align*} we obtain \begin{align*}y=7.5x+200\end{align*}.

To answer the question, we plug in \begin{align*}y = 500\end{align*} and solve for \begin{align*}x\end{align*}. \begin{align*}500=7.5x+200\Rightarrow 7.5x=300\Rightarrow x=40 \ hours\end{align*}.

**Solution**

Nadia must work 40 hours if she is to have $500 in her account.

**Example 8**

*A stalk of bamboo of the family Phyllostachys nigra grows at steady rate of 12 inches per day and achieves its full height of 720 inches in 60 days. Write the equation describing this problem in slope–intercept form.*

*How tall is the bamboo 12 days after it started growing?*

Let’s define our variables

\begin{align*}y =\end{align*} the height of the bamboo plant in inches

\begin{align*}x =\end{align*} number of days

You can see that the problem gives us the slope of the equation and a point on the line.

We are told that the bamboo grows at a rate of 12 inches per day, so \begin{align*}m= 12\end{align*}.

We are told that the plant grows to 720 inches in 60 days, so we have the point (60, 720).

\begin{align*}\text{Start with the slope–intercept form of the line} & & y & = mx + b\\ \text{Plug in the slope}.& & y & = 12x + b\\ \text{Plug in point} \ (60, 720). & & 720 & =12(60)+ b \Rightarrow b=0\\ \text{Plug the value of} \ b \ \text{back into the equation}. & & y & = 12x\end{align*}

To answer the question, plug in \begin{align*}x = 12\end{align*} to obtain \begin{align*}y= 12(12) = 144 \ inches\end{align*}.

**Solution**

The bamboo is 144 inches (12 feet!) tall 12 days after it started growing.

**Example 9**

*Petra is testing a bungee cord. She ties one end of the bungee cord to the top of a bridge and to the other end she ties different weights and measures how far the bungee stretches. She finds that for a weight of 100 lb, the bungee stretches to 265 feet and for a weight of 120 lb, the bungee stretches to 275 feet. Physics tells us that in a certain range of values, including the ones given here, the amount of stretch is a linear function of the weight. Write the equation describing this problem in slope–intercept form. What should we expect the stretched length of the cord to be for a weight of 150 lbs?*

Let’s define our variables

\begin{align*}y = \end{align*} the stretched length of the bungee cord in feet in feet

\begin{align*}x =\end{align*} the weight attached to the bungee cord in pounds

You can see that the problem gives us two points on the line.

We are told that for a weight of 100 lbs the cord stretches to 265 feet, so we have point (100, 265).

We are told that for a weight of 200 lbs the cord stretches to 275 feet, so we have point (120, 270).

\begin{align*}\text{Start with the slope–intercept form of the line} & & y & = mx + b\\ \text{Find the slope of the line}.& & m & =\frac {y_2-y_1}{x_2-x_1}=\frac {270-265}{120-100}=\frac {5}{20}=\frac {1}{4}\\ \text{Plug in the value of the slope}.& & y & =\frac {1}{4}x+b\\ \text{Plug point} \ (100, 265) \ \text{into the equation}. & & 265 & =\frac {1}{4}(100)+b\Rightarrow b=265-25=240\\ \text{Plug the value of} \ b \ \text{into the equation}. & & y & =\frac {1}{4}x+240\end{align*}

To answer the question, we plug in \begin{align*}x = 150\end{align*}. \begin{align*} y=\frac {1}{4}(150)+240\Rightarrow y=37.5+240=277.5 \ feet\end{align*}

**Solution**

For a weight of 150 lbs we expect the stretched length of the cord to be 277.5 feet.

## Lesson Summary

- The equation of a line in
**slope-intercept**form is \begin{align*}y = mx + b\end{align*}.

Where \begin{align*}m\end{align*} is the slope and \begin{align*}(0, b)\end{align*} is the \begin{align*}y-\end{align*}intercept).

- If you are
**given the slope and**\begin{align*}y-\end{align*}**intercept**of a line:

- Simply plug \begin{align*}m\end{align*} and \begin{align*}b\end{align*} into the equation.

- If you are
**given the slope and a point**on the line:

- Plug in the given value of \begin{align*}m\end{align*} into the equation.
- Plug the \begin{align*}x\end{align*} and \begin{align*}y\end{align*} values of the given point and solve for \begin{align*}b\end{align*}.
- Plug the value of \begin{align*}b\end{align*} into the equation.

- If you are given two points on the line:

- Use the two points to find the slope using the slope formula \begin{align*} m=\frac {y_2-y_1}{x_2-x_1}\end{align*}.
- Plug the value of \begin{align*}m\end{align*} into the equation.
- Plug the \begin{align*}x\end{align*} and \begin{align*}y\end{align*} values of one of the given points and solve for \begin{align*}b\end{align*}.
- Plug the value of \begin{align*}b\end{align*} into the equation.
- Plug the other point into the equation to check the values of \begin{align*}m\end{align*} and \begin{align*}b\end{align*}.

## Review Questions

Find the equation of the line in slope–intercept form.

- The line has slope of 7 and \begin{align*}y-\end{align*}intercept of -2.
- The line has slope of -5 and \begin{align*}y-\end{align*}intercept of 6.
- The line has slope of \begin{align*}-\frac{1}{4}\end{align*} and contains point (4, -1).
- The line has slope of \begin{align*}\frac{2}{3}\end{align*} and contains point \begin{align*} \left ( \frac{1}{2},1 \right )\end{align*}.
- The line has slope of -1 and contains point \begin{align*} \left ( \frac{4}{5},0 \right)\end{align*}.
- The line contains points (2, 6) and (5, 0).
- The line contains points (5, -2) and (8, 4).
- The line contains points (3, 5) and (-3, 0).
- The line contains points (10, 15) and (12, 20).

Write the equation of each line in slope-intercept form.

Find the equation of the linear function in slope–intercept form.

- \begin{align*}m = 5, f(0) = -3\end{align*}
- \begin{align*}m = -7, f(2) = -1 \end{align*}
- \begin{align*}m= \frac{1}{3}, f(-1) = \frac{2}{3}\end{align*}
- \begin{align*}m = 4.2, f(-3) = 7.1\end{align*}
- \begin{align*} f\left( \frac{1}{4} \right )=\frac {3}{4}, f(0)=\frac {5}{4}\end{align*}
- \begin{align*}f(1.5) = -3, f(-1) = 2\end{align*}
- To buy a car, Andrew puts a down payment of $1500 and pays $350 per month in installments. Write an equation describing this problem in slope-intercept form. How much money has Andrew paid at the end of one year?
- Anne transplants a rose seedling in her garden. She wants to track the growth of the rose so she measures its height every week. On the third week, she finds that the rose is 10 inches tall and on the eleventh week she finds that the rose is 14 inches tall. Assuming the rose grows linearly with time, write an equation describing this problem in slope-intercept form. What was the height of the rose when Anne planted it?
- Ravi hangs from a giant spring whose length is 5 m. When his child Nimi hangs from the spring its length is 2 m. Ravi weighs 160 lbs. and Nimi weighs 40 lbs. Write the equation for this problem in slope-intercept form. What should we expect the length of the spring to be when his wife Amardeep, who weighs 140 lbs., hangs from it?

## Review Answers

- \begin{align*}y = 7x- 2\end{align*}
- \begin{align*}y = -5x + 6 \end{align*}
- \begin{align*}y =-\frac{1}{4}x \end{align*}
- \begin{align*}y = \frac{2}{3}x + \frac{2}{3} \end{align*}
- \begin{align*}y = -1x + \frac{4}{5} \end{align*}
- \begin{align*}y = -2x + 10 \end{align*}
- \begin{align*}y = 2x-12 \end{align*}
- \begin{align*}y = \frac{5}{6}x + \frac{5}{2} \end{align*}
- \begin{align*}y = \frac{5}{2}x- 10\end{align*}
- \begin{align*}y = -x + 3 \end{align*}
- \begin{align*}y= 4x- 6 \end{align*}
- \begin{align*}f(x)= 5x- 3 \end{align*}
- \begin{align*}f(x) = -7x + 13 \end{align*}
- \begin{align*}f(x) = \frac{1}{3}x + 1 \end{align*}
- \begin{align*}f(x) = 4.2x + 19.7 \end{align*}
- \begin{align*}f(x) = -2x + \frac{5}{4} \end{align*}
- \begin{align*}f(x)= -2x \end{align*}
- \begin{align*}y = 350x + 1500; y = \$5700\end{align*}
- \begin{align*}y = 0.5x + 8.5; y= 8.5 \ inches\end{align*}
- \begin{align*}y = .025x + 1\end{align*} or \begin{align*}y =\frac{1}{40}x + 1; y = 4.5 \ m\end{align*}