8.4: Find the Equation of a Line Given its Graph
Learning Outcomes
- Find the slope of a line given its graph.
- Find the y-intercept of a line given its graph.
- Find the equation of a line given its graph.
There are two main ways of representing a line: the first is with its graph, and the second is with its equation. In this section, we will practice how to find the equation of the line if we are given the graph of the line. The two key numbers in the equation of a line are the slope and the \(y\)-intercept. Thus the main steps in finding the equation of a line are finding the slope and finding the y-intercept. In statistics we are often presented with a scatter plot where we can eyeball the line. Once we have the graph of the line, getting the equation is helpful for making predictions based on the line.
Finding the Slope of a Line Given Its Graph
The steps to follow to find the slope of the line given its graph are the following.
Step 1: Identify two points on the line. Any two points will do, but it is recommended to find points with nice \(x\) and \(y\) coordinates.
Step 2: The slope is the rise over the run. Thus if the points have coordinates \(\left(x_1,y_1\right)\) and \(\left(x_2,\:y_2\right)\), then the slope is:
\[Slope\:=\:\frac{Rise}{Run}=\frac{y_2-y_1}{x_2-x_1}\nonumber \]
Example \(\PageIndex{1}\)
Find the slope of the line shown below.
Solution
First, we locate points on the line that are as easy as possible to work with. The points with integer coordinates are (0, -4) and (2, 2).
Next, we use the rise over run formula to find the slope of the line.
\[Slope\:=\:\frac{y_2-y_1}{x_2-x_1}=\frac{2-\left(-4\right)}{2-0}=\frac{6}{2}=3\nonumber \]
Finding the y-intercept from the graph
If the portion of the graph that is in view includes the \(y\)-axis, then the \(y\)-intercept is very easy to spot. You just see where it crosses the \(y\)-axis. On the other hand, if the portion of the graph in view does not contain the \(y\)-axis, then it is best to first find the equation of the line and then use the equation to find the \(y\)-intercept.
Example \(\PageIndex{2}\)
Find the \(y\)-intercept of the line shown below.
Solution
We just look at the line and notice that it crosses the \(y\)-axis at \(y=1\). Therefore, the \(y\)-intercept is 1 or (0, 1).
Finding the equation of the line given its graph
If you are given the graph of a line and want to find its equation, then you first find the slope as in Example \(\PageIndex{1}\). Then you use \(y\)-intercept, which is \(b\), and the slope, \(m\), and put it into the slope-intercept equation :
\[y =mx + b \nonumber \]
Example \(\PageIndex{3}\)
Find the equation of the line shown below.
Solution
First we find the slope by identifying two nice points. Notice that the line passes through (0, -1) and (3, 1). Now compute the slope using the rise over run formula:
\[Slope\:=\frac{\:rise}{run}=\frac{1-\left(-1\right)}{3-0}=\frac{2}{3}\nonumber \]
We can easily see that the \(y\)-intercept is (0, -1). Thus, \(b\) = -1.
Next use the slope-intercept equation with \(m = \dfrac{2}{3}\) and \(b = -1\).
\[y=\frac{2}{3}x-1\nonumber \]
Try It
Find the equation of this line in slope-intercept form.
- Answer
-
\(y = -3x + 2\)
Additional video resources:
Ex 1: Find the Equation of a Line in Slope Intercept Form Given the Graph of a Line