<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Determining the Equation of a Line

## Write equations from y-intercept and slope or two points

Estimated6 minsto complete
%
Progress
Practice Determining the Equation of a Line

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated6 minsto complete
%
Writing Linear Equations

Janet bought a flowering crab apple tree for her front lawn. The tree was 24 inches tall when she bought it and was told it would grow 6 inches in height every week. How can Janet figure out the height of the tree at the end of six weeks?

In this concept, you will learn to write linear equations.

### Linear Equation

A linear equation can be written in many different forms. To write a linear equation in slope-intercept form, the slope and the \begin{align*}y\end{align*}-intercept of the line must be known. These values can be either given or calculated using the information given. Remember the slope-intercept of a linear equation is written as:

\begin{align*}y=mx+b\end{align*} such that ‘\begin{align*}m\end{align*}’ is the slope of the line, ‘\begin{align*}b\end{align*}’ is the \begin{align*}y\end{align*}-intercept and (\begin{align*}x, y\end{align*}) are the coordinates of a point on the line.

Let’s look at an example.

Write the equation of the line that has a slope of \begin{align*}\frac{1}{2}\end{align*} and passes through the point \begin{align*}(0, -4)\end{align*}.

First, determine what information is given.

The value of the slope (\begin{align*}m\end{align*}) is \begin{align*}\frac{1}{2}\end{align*} and the point \begin{align*}(0, -4)\end{align*} is the value of the \begin{align*}y\end{align*}-intercept (\begin{align*}b\end{align*}).

Next, write the slope-intercept form for the equation of a line.

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

Next, to write the equation in slope intercept form, the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ must be known. Fill these values into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& \frac{1}{2}x+(-4) \end{array}\end{align*}

Then, simplify the equation.

\begin{align*}\begin{array}{rcl} y &=& \frac{1}{2}x+(-4)\\ y &=& \frac{1}{2}x-4 \end{array}\end{align*}

The answer is \begin{align*}y = \frac{1}{2}x-4\end{align*}.

Let’s look at another example.

Write the equation of the line that has a slope of 3 and passes through the point \begin{align*}(9, 6)\end{align*}.

First, determine what information is given.

The value of the slope (\begin{align*}m\end{align*}) is 3 and the line passes through the point \begin{align*}(9, 6)\end{align*} which are the coordinates of a point (\begin{align*}x, y\end{align*}) on the line.

Next, write the slope-intercept form for the equation of a line.

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

Next, to write the equation in slope intercept form, the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ must be known. Fill the value for ‘\begin{align*}m\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& 3x+b \end{array}\end{align*}

Next, since the value of the \begin{align*}y\end{align*}-intercept (\begin{align*}b\end{align*}) is not known, use the coordinates \begin{align*}\begin{pmatrix} x, & y \\ 9, & 6 \end{pmatrix}\end{align*} of the point to calculate the \begin{align*}y\end{align*}-intercept.

\begin{align*}\begin{array}{rcl} y &=& 3x+b\\ 6 &=& 3(9)+b \end{array}\end{align*}

Next, perform the multiplication on the right side of the equation to clear the parenthesis.

\begin{align*}\begin{array}{rcl} 6 &=& 3(9)+b\\ 6 &=& 27+b \end{array}\end{align*}

Next, subtract 27 from both sides of the equation and simplify to solve for ‘\begin{align*}b\end{align*}’.

\begin{align*}\begin{array}{rcl} 6 &=& 27+b\\ 6-27 &=& 27-27+b\\ -21 &=& b \end{array}\end{align*}

Then, fill in the value for ‘\begin{align*}b\end{align*}’ into the slope-intercept form of the equation and simplify.

\begin{align*}\begin{array}{rcl} y &=& 3x+b\\ y &=& 3x+(-21)\\ y &=& 3x-21 \end{array}\end{align*}

The answer is \begin{align*}y = 3x-21\end{align*}.

If neither the slope nor the \begin{align*}y\end{align*}-intercept is given, then both must be calculated using the coordinates of two points on the line.

Let’s look at an example.

Write the equation, in slope-intercept form, of the line that passes through the points \begin{align*}(-2, 6)\end{align*} and \begin{align*}(4, -6)\end{align*}.

First, name the points as being the first point and the second point,

\begin{align*}\begin{pmatrix} x_1, & y_1 \\ -2, & 6 \end{pmatrix} \ \text{and}\ \begin{pmatrix} x_2, & y_2 \\ 4, & -6 \end{pmatrix}\end{align*}

Next, use the coordinates of these points to fill in the formula for calculating the slope of the line.

\begin{align*}\begin{array}{rcl} m &=& \frac{y_2-y_1}{x_2-x_1}\\ m &=& \frac{-6-6}{4--2} \end{array}\end{align*}

Next, simplify the right side of the equation and express the answer in simplest form.

\begin{align*}\begin{array}{rcl} m &=& \frac{-6-6}{4--2}\\ m &=& \frac{-12}{6}\\ m &=& -2 \end{array}\end{align*}

The slope of the line is -2.

Next, use the slope of the line and the coordinates of one point to calculate the \begin{align*}y\end{align*}-intercept of the line.

\begin{align*}m=-2 \ \text{and} \begin{pmatrix} x_1, & y_1 \\ -2, & 6 \end{pmatrix}\end{align*}

Next, substitute the values into the slope-intercept form of an equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ 6 &=& -2(-2)+b \end{array}\end{align*}

Next, perform the multiplication to clear the parenthesis.

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

Next, subtract 4 from both sides of the equation to solve for ‘\begin{align*}b\end{align*}’.

\begin{align*}\begin{array}{rcl} 6 &=& 4+b\\ 6-4 &=& 4-4+b\\ 2 &=& b \end{array}\end{align*}

Then, substitute the values for ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ into the slope-intercept form of the equation of a line.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& -2x+2 \end{array}\end{align*}

The answer is \begin{align*}y=-2x+2\end{align*}.

The equation of a line can also be written using the values in a given t-table. Remember the values in the table are ordered pairs (\begin{align*}x, y\end{align*}). If none of the values are given in the form \begin{align*}\begin{pmatrix} x, & y \\ 0, & \# \end{pmatrix}\end{align*} then both the slope and the \begin{align*}y\end{align*}-intercept would have to be calculate as shown in the previous example.

### Examples

#### Example 1

Earlier, you were given a problem about Janet and the flowering crab apple tree. She needs to figure out the height of the tree at the end of six weeks, given that it grows 6 inches a week. How can Janet figure this out?

She can use an equation of a line written in slope intercept form.

First, write down the given information.

The height of the tree increases 6 inches in one week. This means \begin{align*}m=\frac{\text{change in }y}{\text{change in }x}=\frac{6}{1}=6\end{align*}. The original height of the tree, was 24 inches. This means \begin{align*}b=(0, 24)=24\end{align*}.

Next, write the equation of a line in slope-intercept form.

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

Next, substitute the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& 6x+24 \end{array}\end{align*}

Next, substitute ‘6’ into the equation for ‘\begin{align*}x\end{align*}’ to calculate the height of the tree, ‘\begin{align*}y\end{align*}’ in six weeks.

\begin{align*}\begin{array}{rcl} y &=& 6x+24\\ y &=& 6(6)+24 \end{array}\end{align*}

Then, simplify the equation.

\begin{align*}\begin{array}{rcl} y &=& 36+24\\ y &=& 60 \end{array}\end{align*}

The height of the tree at the end of 6 weeks will be 60 inches or 5 feet.

#### Example 2

Write the equation of the line that has a slope of 4 and crosses the \begin{align*}y\end{align*}-axis at the point \begin{align*}(0, -3)\end{align*}.

First, write down the given information.

\begin{align*}m=4\end{align*} and the given point is the \begin{align*}y\end{align*}-intercept of the line. Therefore, \begin{align*}b = -3\end{align*}.

Next, write the equation of a line in slope-intercept form.

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

Next, substitute the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& 4x+(-3) \end{array}\end{align*}

Then, simplify the equation.

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

The answer is \begin{align*}y=4x-3\end{align*}.

#### Example 3

Write an equation in slope-intercept form to model the values given in the following t-table.

 \begin{align*}x\end{align*} \begin{align*}y\end{align*} 0 6 1 1 2 -4 3 -9 4 -14

The value of the \begin{align*}y\end{align*}-intercept (\begin{align*}b\end{align*}) is 6 and the line passes through the points \begin{align*}(1, 1), (2, -4), (3, -9)\end{align*} and \begin{align*}(4, -14)\end{align*} which are the coordinates of points (\begin{align*}x, y\end{align*}) on the line. Choose one of the points to represent (\begin{align*}x, y\end{align*}).

Next, write the slope-intercept form for the equation of a line.

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

Next, to write the equation of a line in slope intercept form, the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ must be known. Fill the value for ‘\begin{align*}b\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& mx+6 \end{array}\end{align*}

Next, since the value of the \begin{align*}y\end{align*}-intercept (\begin{align*}b\end{align*}) is known, use the coordinates \begin{align*}\begin{pmatrix} x, & y \\ 1, & 1 \end{pmatrix}\end{align*} of the point to calculate the slope.

\begin{align*}\begin{array}{rcl} y &=& mx+6\\ 1 &=& m(1)+ 6 \end{array}\end{align*}

Next, perform the multiplication on the right side of the equation to clear the parenthesis.

\begin{align*}\begin{array}{rcl} 1 &=& m(1)+6\\ 1 &=& m+6 \end{array}\end{align*}

Next, subtract 6 from both sides of the equation and simplify to solve for ‘\begin{align*}m\end{align*}’.

\begin{align*}\begin{array}{rcl} 1 &=& m+6\\ 1-6 &=& m+6-6\\ -5 &=& m \end{array}\end{align*}

Then, fill in the value for ‘\begin{align*}m\end{align*}’ into the slope-intercept form of the equation and simplify.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& mx+6\\ y &=& -5x+6 \end{array}\end{align*}

The answer is \begin{align*}y = -5x+6\end{align*}.

#### Example 4

Write the equation of the line in slope-intercept form that passes through the points \begin{align*}(7, 0)\end{align*} and \begin{align*}(0, 4)\end{align*}.

First, write down the given information.

The given points \begin{align*}(7, 0)\end{align*} and \begin{align*}(0, 4)\end{align*} are the \begin{align*}x\end{align*}- and  \begin{align*}y\end{align*}-intercepts respectively of the line.

Next, write the slope-intercept form for the equation of a line.

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

Next, to write the equation in slope intercept form, the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ must be known. Fill the value for ‘\begin{align*}b\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& mx+4 \end{array}\end{align*}

Next, name the points as being the first point and the second point,

\begin{align*}\begin{pmatrix} x_1, & y_1 \\ 7, & 0 \end{pmatrix}\ \text{and} \ \begin{pmatrix} x_2, & y_2 \\ 0, & 4 \end{pmatrix}\end{align*}

Next, use the coordinates of these points to fill in the formula for calculating the slope of the line.

\begin{align*}\begin{array}{rcl} m &=& \frac{y_2-y_1}{x_2-x_1}\\ m &=& \frac{4-0}{0-7} \end{array}\end{align*}

Next, simplify the right side of the equation and express the answer in simplest form.

\begin{align*}\begin{array}{rcl} m &=& \frac{4-0}{0-7}\\ m &=& \frac{4}{-7}\\ m &=& - \frac{4}{7}\\ \end{array}\end{align*}

Then, fill in the value for ‘\begin{align*}m\end{align*}’ into the slope-intercept form of the equation and simplify.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& mx+4\\ y &=& -\frac{4}{7}x+4 \end{array}\end{align*}

The answer is \begin{align*}y = -\frac{4}{7}x+4\end{align*}.

#### Example 5

Write the equation of a line that has a slope of zero and a \begin{align*}y\end{align*}-intercept of -5.

First, write down the given information.

\begin{align*}m=0\end{align*} and the \begin{align*}y\end{align*}-intercept of the line is \begin{align*}b=-5\end{align*}.

Next, write the equation of a line in slope-intercept form.

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

Next, substitute the values of ‘\begin{align*}m\end{align*}’ and ‘\begin{align*}b\end{align*}’ into the equation.

\begin{align*}\begin{array}{rcl} y &=& mx+b\\ y &=& 0x+(-5) \end{array}\end{align*}

Then, simplify the equation.

\begin{align*}\begin{array}{rcl} y &=& 0-5\\ y &=& -5 \end{array}\end{align*}

The answer is \begin{align*}y = -5\end{align*}.

### Review

Write the equation of a line with the following slopes and \begin{align*}y\end{align*}-intercepts.

1. \begin{align*}\text{slope} = 2, y \text{ int} = 4\end{align*}

2. \begin{align*}\text{slope} = -3, y \text{ int} = 2\end{align*}

3. \begin{align*}\text{slope} = -4, y \text{ int} = 4\end{align*}

4. \begin{align*}\text{slope} = 3, y \text{ int} = -5\end{align*}

5. \begin{align*}\text{slope} = \frac{1}{2} , y \text{ int} = -2\end{align*}

6. \begin{align*}\text{slope} = \frac{-1}{3} , y \text{ int} = 2\end{align*}

7. \begin{align*}\text{slope} = 1, y \text{ int} = 8\end{align*}

8. \begin{align*}\text{slope} = -2, y \text{ int} = 4\end{align*}

9. \begin{align*}\text{slope} = -1, y \text{ int} = -1\end{align*}

10. \begin{align*}\text{slope} = 5, y \text{ int} = -2\end{align*}

Write the following horizontal or vertical line equations.

11. A horizontal line with a \begin{align*}b\end{align*} value of 7.

12. A horizontal line with a \begin{align*}b\end{align*} value of -4.

13. A vertical line with an \begin{align*}x\end{align*} value of 2.

14. A vertical line with an \begin{align*}x\end{align*} value of -5.

Write the equation of a line that passes through the following points.

15. \begin{align*}(3, -3)\end{align*} and \begin{align*}(-3, 1)\end{align*}

16. \begin{align*}(2, 3)\end{align*} and \begin{align*}(0, -3)\end{align*}

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

### Vocabulary Language: English

dependent variable

The dependent variable is the output variable in an equation or function, commonly represented by $y$ or $f(x)$.

Function

A function is a relation where there is only one output for every input. In other words, for every value of $x$, there is only one value for $y$.

independent variable

The independent variable is the input variable in an equation or function, commonly represented by $x$.

1. [1]^ License: CC BY-NC 3.0

### Explore More

Sign in to explore more, including practice questions and solutions for Determining the Equation of a Line.