Find the Equation of a Line
By the end of this section, you will be able to:
- Find an equation of the line given the slope and -intercept
- Find an equation of the line given the slope and a point
- Find an equation of the line given two points
- Find an equation of a line parallel to a given line
- Find an equation of a line perpendicular to a given line
The physical sciences, social sciences, and the business world are full of situations that can be modeled with linear equations relating two variables. If data appears to form a straight line when graphed, an equation of that line can be used to predict the value of one variable based on the value of the other. To create a mathematical model of a linear relation between two variables, we must be able to find the equation of the line. In this section we look at several ways to write the equation of a line — the method we use is determined by what information we are given.
Find an equation of the line given the slope and -intercept
If we already know the slope and -intercept of a line, we can find its equation by substituting the values directly into the slope-intercept form, .
Example. Find an equation of a line with slope and -intercept .
We substitute and into :
Example. Find the equation of the line shown, whose -intercept is and which also passes through .
We find the slope by counting the rise and run between the two points: . Substituting and into :
Find an equation of a line with slopeand y-intercept.
Substitute the slope for m and the y-intercept’s y-value for b into y = mx + b.Find an equation of a line with slope -1 and y-intercept (0, -3).
Substitute the slope for m and the y-intercept’s y-value for b into y = mx + b.Find an equation of the line given the slope and a point
The slope-intercept form works well when we know the slope and -intercept. But what if we know the slope and some other point that isn’t the -intercept? We can derive another form of the equation by starting with the slope formula for a line through a specific point and some other point :
Multiplying both sides by and simplifying gives .
Point-slope form of an equation of a line. The point-slope form of an equation of a line with slope and containing the point is
We can use the point-slope form to find an equation of a line when we are given the slope and one point, then rewrite the equation in slope-intercept form.
Find an equation of a line given the slope and a point.
- Identify the slope.
- Identify the point.
- Substitute the values into the point-slope form, .
- Write the equation in slope-intercept form.
Example. Find an equation of a line with slope that contains the point . Write the equation in slope-intercept form.
Substituting and into the point-slope form:
Example. Find an equation of a horizontal line that contains the point . Write the equation in slope-intercept form.
Every horizontal line has slope . Substituting and :
This is the equation of the horizontal line .
Find an equation of a line with slopethat contains the point. Write the equation in slope-intercept form.
Substitute m and the point into, then simplify and solve for y.Find an equation of the line given two points
When real-world data is collected, a linear model can often be created from just two data points. We have two options so far for finding an equation of a line: slope-intercept or point-slope. Since we will know two points rather than the slope directly, it makes more sense to first find the slope from the two points, then use the point-slope form.
Find an equation of a line given two points.
- Find the slope using the given points.
- Choose one point.
- Substitute the values into the point-slope form, .
- Write the equation in slope-intercept form.
Example. Find an equation of a line that contains the points and . Write the equation in slope-intercept form.
First we find the slope:
Choosing the point and substituting into the point-slope form:
Using the other point, , gives the same equation.
Example. Find an equation of a line that contains the points and . Write the equation in slope-intercept form.
Finding the slope:
The slope is undefined, telling us this is a vertical line. Both points have -coordinate , so the equation of the line is . Since there is no , we cannot write it in slope-intercept form.
To write an equation of a line
| If given: | Use: | Form: |
|---|---|---|
| Slope and -intercept | slope-intercept | |
| Slope and a point | point-slope | |
| Two points | point-slope |
Find an equation of a line that contains the points (3, 1) and (5, 6). Write the equation in slope-intercept form.
Find the slope from the two points first, then substitute one point intoand solve for y.Find an equation of a line parallel to a given line
Suppose we need to find an equation of a line that passes through a specific point and is parallel to a given line. Since parallel lines have the same slope, we already have the slope we need — we just combine it with the given point using the point-slope form. We write for the slope of a line parallel to a line with slope .
Find an equation of a line parallel to a given line.
- Find the slope of the given line.
- Find the slope of the parallel line — parallel lines have the same slope.
- Identify the point.
- Substitute the values into the point-slope form, .
- Write the equation in slope-intercept form.
Example. Find an equation of a line parallel to that contains the point . Write the equation in slope-intercept form.
The given line is in slope-intercept form with . Since parallel lines have the same slope, . Substituting and into the point-slope form:
Find an equation of a line parallel to the linethat contains the point. Write the equation in slope-intercept form.
Parallel lines share the same slope. Substituteand the point into, then solve for y.Find an equation of a line perpendicular to a given line
Now consider finding a line through a specific point that is perpendicular to a given line. Perpendicular lines have slopes that are negative reciprocals of each other, so we again already have the slope we need. We write for the slope of a line perpendicular to a line with slope .
Find an equation of a line perpendicular to a given line.
- Find the slope of the given line.
- Find the slope of the perpendicular line — perpendicular slopes are negative reciprocals of each other.
- Identify the point.
- Substitute the values into the point-slope form, .
- Write the equation in slope-intercept form.
Example. Find an equation of a line perpendicular to that contains the point . Write the equation in slope-intercept form.
The given line has , so the perpendicular slope is the negative reciprocal, . Substituting and :
Example. Find an equation of a line perpendicular to that contains the point . Write the equation in slope-intercept form.
The line is vertical, so any line perpendicular to it must be horizontal, with slope . Substituting and :
Example. Find an equation of a line perpendicular to that contains the point . Write the equation in slope-intercept form.
The line is horizontal, so any line perpendicular to it must be vertical, in the form . Since the perpendicular line passes through , every point on it has -coordinate . The equation of the perpendicular line is .
Find an equation of a line perpendicular to the linethat contains the point. Write the equation in slope-intercept form.
The perpendicular slope is the negative reciprocal of. Substitute that slope and the point into, then solve for y.A line is perpendicular to. What form must its equation take?
A line perpendicular to a vertical line is horizontal, and every horizontal line has slope 0.Key terms
point-slope form — the form of an equation of a line with slope that contains the point ; useful whenever the slope and any one point (not necessarily the -intercept) are known, or when two points are known and the slope is found first.
Practice
Find an equation of the line given the slope and -intercept
Find the equation of a line with slopeand-intercept. Write it in slope-intercept form, and enter the expression that follows.
Substituteanddirectly into.Find the equation of a line with slopeand-intercept. Write it in slope-intercept form, and enter the expression that follows.
Substituteanddirectly into.Find an equation of the line given the slope and a point
Find the equation of a line withthat contains. Write it in slope-intercept form, and enter the expression that follows.
Put the slope and point into, then solve for.Find the equation of a line withthat contains. Write it in slope-intercept form, and enter the expression that follows.
Use, then isolate.Find an equation of the line given two points
Find the equation of a line containingand. Write it in slope-intercept form, and enter the expression that follows.
First compute, then use either point in point-slope form and solve for.Find the equation of a line containingand. Write it in slope-intercept form, and enter the expression that follows.
Find the slope from the two points, then substitute one point intoto find.Find an equation of a line parallel to a given line
Find the equation of a line parallel tothat contains. Write it in slope-intercept form, and enter the expression that follows.
A parallel line has slope. Substitute the slope andinto point-slope form, then solve for.Find the equation of a line parallel tothat contains. Write it in slope-intercept form, and enter the expression that follows.
Keep the parallel slope, use the given point, and solvefor.Find an equation of a line perpendicular to a given line
Find the equation of a line perpendicular tothat contains. Write it in slope-intercept form, and enter the expression that follows.
The negative reciprocal ofis. Use slopeand the given point in point-slope form.Find the equation of a line perpendicular tothat contains. Write it in slope-intercept form, and enter the expression that follows.
Use the negative-reciprocal slope, substitute, and solve for.This section is adapted from Elementary Algebra 2e, Section 4.6: Find the Equation of a Line by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: condensed the worked examples and tables; omitted the Be Prepared quiz, Media links, Self Check checklist, and unselected Section Exercises; converted the practice problems (“Try Its”) into interactive exercises with instant feedback; and adapted selected end-of-section exercises into the section-final interactive Practice block.