Write Linear Equations Given Two Points

Learning Objectives

  • Write and solve equations of lines using two points on the line
    • Write the equation of a line given two points on the line
    • Identify which parts of a linear equation are given and which parts need to be solved for using algebra.

Find the Equation of a Line Given 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 [latex]y=mx+b[/latex] and find b.

Example

Write the equation of the line that passes through the points [latex](2,1)[/latex] and [latex](−1,−5)[/latex].

Notice that is 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 [latex]y=2x+b[/latex]. Let’s start with the same equation, [latex]y=2x+b[/latex], but substitute in [latex](−1,−5)[/latex]:

[latex]\begin{array}{l}\,\,\,\,\,y=2x+b\\-5=2\left(-1\right)+b\\-5=-2+b\\-3=b\end{array}[/latex]

The final equation is the same: [latex]y=2x–3[/latex].

Example (Advanced)

Write the equation of the line that passes through the points [latex](-4.6,6.45)[/latex] and [latex](1.15,7.6)[/latex].

The video below provides another example of how to find the equation of a line given two points:

Summary

The slope-intercept form of a linear equation is written as [latex]y=mx+b[/latex], where m is the slope and b is the value of y at the y-intercept, which can be written as [latex](0,b)[/latex]. 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.