Unit 3 · Lesson 4 of 5
Writing equations of lines (incl. parallel and perpendicular)
You'll be able to: write the equation of a line in \(y = mx + b\) form from a point and a slope, from two points, or from a parallel or perpendicular line.
Step 1 of 5Warm-up
Two quick questions from earlier lessons. Answer from memory first. Pulling it out of your head is what makes it stick.
Write \(4x + 2y = 6\) in slope-intercept form.
Subtract \(4x\): \(2y = -4x + 6\).
Divide every term by 2: \(y = -2x + 3\).
Simplify \(-3(x - 4) + 2\).
Distribute the \(-3\) to both terms: \(-3x + 12 + 2\).
Combine the numbers: \(-3x + 14\).
Step 2 of 5The idea
A line is pinned down by its slope and any one point on it. The tool that joins them is point-slope form. You fill it in, then tidy it into \(y = mx + b\).
Point-slope form. The line with slope \(m\) through \((x_1, y_1)\) is \[y - y_1 = m(x - x_1)\]
Three steps. (1) Find \(m\). (2) Put \(m\) and the point into point-slope form. (3) Distribute and get \(y\) alone.
Two points? Find \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\) first, then use either point.
Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals: flip the fraction and change the sign. Slope \(\tfrac{2}{3}\) becomes \(-\tfrac{3}{2}\); slope \(4\) becomes \(-\tfrac{1}{4}\).
Always finish with a quick check: put the point's \(x\) into your answer and see that you get its \(y\).
Why this shows up on the placement test: "find the equation of the line through these points" and "find the line perpendicular to this one" are classic placement questions.
Step 3 of 5Worked examples
Example 1: the line through \((-1, 5)\) and \((3, -3)\)
- Slope: \(m = \dfrac{-3 - 5}{3 - (-1)} = \dfrac{-8}{4} = -2\).
- Use the point \((-1, 5)\): \(y - 5 = -2(x - (-1))\), which is \(y - 5 = -2(x + 1)\).
- Distribute: \(y - 5 = -2x - 2\).
- Add 5 to both sides: \(y = -2x + 3\).
- Check with the other point, \((3, -3)\): \(-2(3) + 3 = -3\). It works, so the equation is right.
Example 2: perpendicular to \(y = 2x + 1\), through \((4, 1)\)
- The given slope is \(2 = \tfrac{2}{1}\). Flip it and change the sign: \(m = -\tfrac{1}{2}\).
- Point-slope: \(y - 1 = -\tfrac{1}{2}(x - 4)\).
- Distribute: \(y - 1 = -\tfrac{1}{2}x + 2\). \(-\tfrac{1}{2} \cdot (-4) = 2\).
- Add 1: \(y = -\tfrac{1}{2}x + 3\). Check: \(-\tfrac{1}{2}(4) + 3 = 1\). Good.
- For a parallel line through the same point, keep \(m = 2\): \(y - 1 = 2(x - 4)\), so \(y = 2x - 7\).
Step 4 of 5Practice
Type your answer and press Check. If you miss twice, open the worked solution. Then mark how it went. Give each line in \(y = mx + b\) form.
Write the equation of the line with slope \(4\) through \((1, 3)\).
Point-slope: \(y - 3 = 4(x - 1)\).
Distribute: \(y - 3 = 4x - 4\). Add 3: \(y = 4x - 1\).
Check: \(4(1) - 1 = 3\).
Write the equation of the line with slope \(-2\) through \((-3, 5)\).
Point-slope: \(y - 5 = -2(x - (-3)) = -2(x + 3)\).
Distribute: \(y - 5 = -2x - 6\). Add 5: \(y = -2x - 1\).
Check: \(-2(-3) - 1 = 5\).
Write the equation of the line through \((1, 2)\) and \((3, 8)\).
Slope: \(m = \dfrac{8 - 2}{3 - 1} = \dfrac{6}{2} = 3\).
Point-slope with \((1, 2)\): \(y - 2 = 3(x - 1)\), so \(y - 2 = 3x - 3\) and \(y = 3x - 1\).
Check with \((3, 8)\): \(3(3) - 1 = 8\).
Write the equation of the line through \((-2, 4)\) and \((2, -2)\).
Slope: \(m = \dfrac{-2 - 4}{2 - (-2)} = \dfrac{-6}{4} = -\dfrac{3}{2}\).
Point-slope with \((-2, 4)\): \(y - 4 = -\tfrac{3}{2}(x + 2)\), so \(y - 4 = -\tfrac{3}{2}x - 3\).
Add 4: \(y = -\tfrac{3}{2}x + 1\). Check with \((2, -2)\): \(-3 + 1 = -2\).
What is the slope of any line perpendicular to \(y = -4x + 1\)?
The given slope is \(-4 = -\tfrac{4}{1}\).
Flip it to \(-\tfrac{1}{4}\), then change the sign: \(\tfrac{1}{4}\).
Check: \(-4 \cdot \tfrac{1}{4} = -1\), as perpendicular slopes should.
Write the equation of the line parallel to \(y = 3x - 2\) that passes through \((2, 1)\).
Parallel means the same slope: \(m = 3\).
Point-slope: \(y - 1 = 3(x - 2)\), so \(y - 1 = 3x - 6\) and \(y = 3x - 5\).
Check: \(3(2) - 5 = 1\).
Write the equation of the line perpendicular to \(2x + 3y = 6\) that passes through \((2, -1)\).
First find the given slope: \(3y = -2x + 6\), so \(y = -\tfrac{2}{3}x + 2\). Its slope is \(-\tfrac{2}{3}\).
Perpendicular slope: flip and change the sign, \(m = \tfrac{3}{2}\).
Point-slope: \(y + 1 = \tfrac{3}{2}(x - 2)\), so \(y + 1 = \tfrac{3}{2}x - 3\) and \(y = \tfrac{3}{2}x - 4\).
Check: \(\tfrac{3}{2}(2) - 4 = -1\).
A taxi charges a fixed fee plus a price per mile. A 2-mile ride costs $9 and a 6-mile ride costs $17. Which equation gives the cost \(C\) in dollars for a ride of \(m\) miles?
- \(C = 4m + 1\)
- \(C = 2m + 9\)
- \(C = 2m + 5\)
- \(C = 5m + 2\)
Use the points \((2, 9)\) and \((6, 17)\). Slope: \(\dfrac{17 - 9}{6 - 2} = \dfrac{8}{4} = 2\) dollars per mile.
Point-slope: \(C - 9 = 2(m - 2)\), so \(C - 9 = 2m - 4\) and \(C = 2m + 5\).
Check: \(2(6) + 5 = 17\). Answer: (c).
Step 5 of 5Wrap-up
You can now write any line in \(y = mx + b\) form: find the slope (same for parallel, flipped with the opposite sign for perpendicular), use \(y - y_1 = m(x - x_1)\), then get \(y\) alone.
Read or watch next: OpenStax Intermediate Algebra 2e, 3.3 Find the Equation of a Line (free textbook, with more practice at the end of the section).
Also good: Khan Academy: Writing slope-intercept equations (short videos). Quick rules: Lines and systems cheat sheet.
Something unclear? Ask your teacher bot a follow-up question, for example: "Why do perpendicular lines have slopes that multiply to -1?" It knows this course and can explain things another way.