Section 5.2 Equation of a Line
In this class, we will only write our linear functions like this:
where \(m\) represents the slope and \(b\) represents the \(y\)-value of the \(y\)-intercept. You might also see it written as \(y=mx+b\text{.}\) If you have seen other ways of writing equations of lines (like \((y-y_1)=m(x-x_1)\)), you are welcome to use them in the middle of a problem if you find it helpful. However, we won't talk about these other forms, and our final answers will always be written as in equation (1).
Example 5.8.
Suppose we have the function
Then we know that the slope of this line is \(-7\) and the \(y\)-intercept is \((0,2)\text{.}\)
Note that if you forget that \(b\) is the \(y\)-value of the \(y\)-intercept, you can still find the \(y\)-intercept using the same strategy you learned in Section 1.1. Using that strategy, the above example would look like this:
To find the \(y\)-intercept, we are looking for where the graph would cross the \(y\)-axis, which is where \(x=0\text{.}\) So we solve:
Don't forget to write the intercept as an ordered pair: \((0,2)\text{.}\)
Checkpoint 5.9.
Find the slope and \(y\)-intercept of \(f(x)=3-2x\text{.}\)
The slope is \(-2\)
The \(y\)-intercept is \((0,3)\text{.}\)
Remembering that the slope is the number that is multiplied by \(x\text{,}\) we have that the slope is \(-2\text{.}\) We know that the number that is not attached to \(x\) is the \(y\)-value of the \(y\)-intercept. Writing the answer as an orderd pair, we have that the \(y\)-intercept is \((0,3)\text{.}\)
Subsection 5.2.1 Writing the Equation when Given Slope
When we are given the slope and the \(y\)-intercept of a line, we can just plug them into our format from equation (1).
Example 5.10.
Suppose we know that the slope of a line is 4 and the \(y\)-intercept is at \((0,-5)\text{.}\) Then we use the format \(f(x)=mx+b\) and plug in our slope for \(m\) and the intercept into \(b\text{:}\)
Checkpoint 5.11.
Write the equation of the linear function with slope -10 and \(y\)-intercept \((0,6)\text{.}\)
Sometimes, we are given the slope but not the \(y\)-intercept. In that case, we'll be given some other point on the graph. This situation will come up often: we have most of the equation we need, but we're missing one number and we have a point on the graph. Whenever this happens, we just plug in the values for \(x\) and \(y\) and solve for what we're missing.
Example 5.12.
Suppose we're trying to find the equation of the line with slope \(2\) and goes through the point \((3,2)\text{.}\) Since we know the slope, we can plug that into our formula: \(f(x)=2x+b\text{.}\) However, we don't have the \(y\)-intercept. We do have a point on the graph, so we can plug in those values to solve for \(b\text{:}\)
Therefore, our final answer is \(f(x)=2x-4\text{.}\)
Checkpoint 5.13.
Write the equation of the linear function with slope \(-3\) and goes through the point \((1,7)\text{.}\)
\(f(x)=-3x+10\)
Since we know the slope, we can plug that into our formula: \(f(x)=-3x+b\text{.}\) However, we don't have the \(y\)-intercept. We do have a point on the graph, so we can plug in those values to solve for \(b\text{:}\)
Therefore, our final answer is \(f(x)=-3x+10\text{.}\)
Subsection 5.2.2 Writing the Equation when Not Given Slope
We do always need to know the slope in order to write the equation of a line, but we aren't always given the slope. Luckily, we know from Section 5.1 how to find the slope!
Example 5.14.
Suppose we want to find the equation of the line that goes through the points \((-1,-5)\) and \((2, 7)\text{.}\) We don't know the slope, but we can use what we learned in Section 5.1 to compute the slope:
So we can plug the slope into our formula: \(f(x)=4x+b\text{.}\) We can use what we learned from the examples above to find \(b\text{.}\) In this case, we have two points we could plug in. You can pick either one, they'll both give you the same answer.
So we have our final answer: \(f(x)=4x-1\text{.}\)
Since you could plug in either point and it will give you the same value for \(b\text{,}\) that's a great way to check your work during an exam: plug in both points. If they give you the same number, your answer is probably the right one. If they give you different numbers, you know you made a mistake somewhere, and you can go check your work.
Checkpoint 5.15.
Write the equation of the line that goes through the points \((-3,2)\) and \((1, -18)\text{.}\)
\(f(x)=-5x-13\)
We don't know the slope, but we can use what we learned in Section 5.1 to compute the slope:
So we can plug the slope into our formula: \(f(x)=-5x+b\text{.}\) In this case, we have two points we could plug in to find \(b\text{.}\) We can pick either one, they'll both give us the same answer. Let's try using \((-3,2)\text{.}\)
Let's check our answer by plugging in the other point:
We got the answer for \(b\text{,}\) which is what should happen! So we have our final answer: \(f(x)=-5x-13\text{.}\)
Subsection 5.2.3 Special Cases: Vertical and Horizontal Lines
Fact 5.16. Horizontal Lines.
Horizontal lines go side-to-side. Notice that at any point on the line, the \(y-\)value is the same, no matter what the \(x\)-value is. So, the equation of a horizontal line is \(y=(number)\text{.}\)
Example 5.17.
Suppose we want to write the equation of the horizontal line through the point \((-3,8)\text{.}\) We know that the equation of a horizonal line is always \(y=\) something. Since we want it to go through the point \((-3,8)\text{,}\) we need the \(y\)-value to be \(8\text{.}\) Therefore, the equation is \(y=8\text{.}\)
Fact 5.18. Vertical Lines.
Vertical lines go up-and-down. Notice that at any point on the line, the \(x-\)value is the same, no matter what the \(y\)-value is. So, the equation of a vertical line is \(x=(number)\text{.}\)
Example 5.19.
Suppose we want to write the equation of the vertical line through the point \((-3,8)\text{.}\) We know that the equation of a vertical line is always \(x=\) something. Since we want it to go through the point \((-3,8)\text{,}\) we need the \(x\)-value to be \(-3\text{.}\) Therefore, the equation is \(x=-3\text{.}\)
Checkpoint 5.20.
Write the equation of the horizontal line through the point \((5,-2)\text{.}\)
Write the equation of the vertical line through the point \((9,0)\text{.}\)
\(\displaystyle y=-2\)
\(\displaystyle x=9\)
We know that the equation of a horizonal line is always \(y=\) something. Since we want it to go through the point \((5,-2)\text{,}\) we need the \(y\)-value to be \(-2\text{.}\) Therefore, the equation is \(y=-2\text{.}\)
We know that the equation of a vertical line is always \(x=\) something. Since we want it to go through the point \((9,0)\text{,}\) we need the \(x\)-value to be \(9\text{.}\) Therefore, the equation is \(x=9\text{.}\)