Finding the equation of a line
Through (−2, 1) and (4, 4) there is exactly one line, and its equation is y = (1/2)x + 2.
Working backwards from the picture
So far you have started from an equation and drawn its line. This unit goes the other way: you know something about a line, such as two points on it, and you want its equation. Every case comes down to finding two numbers, the slope m and the y-intercept b, and writing y = mx + b. The easiest case is when both are given. A line with slope −2 and y-intercept (0, 4) has the equation y = −2x + 4, and there is nothing to calculate.
A slope and any point: point-slope form
Often the point you know is not on the y-axis. Suppose the slope is 2/3 and the line passes through (3, 1). Any other point (x, y) on the line must make the same slope with (3, 1), so (y − 1)/(x − 3) = 2/3. Multiply both sides by (x − 3) and you get y − 1 = (2/3)(x − 3). In general this is the point-slope form, y − y₁ = m(x − x₁), where (x₁, y₁) is the known point. To reach slope-intercept form, distribute and add: y − 1 = (2/3)x − 2, so y = (2/3)x − 1.
A shortcut gives the same result: put the point into y = mx + b and solve for b. With m = 2/3 and the point (3, 1): 1 = (2/3)(3) + b, so 1 = 2 + b and b = −1. Either way, check by substituting the known point into your final equation. (2/3) × 3 − 1 = 1, which matches the point. Watch the signs in point-slope form. For the point (−4, 2) the form reads y − 2 = m(x + 4), because x − (−4) is x + 4.
Two points
Given two points, find the slope first with the slope formula, then use either point as above. For (−2, 1) and (4, 4), m = (4 − 1)/(4 − (−2)) = 3/6 = 1/2. Using (−2, 1): 1 = (1/2)(−2) + b, so 1 = −1 + b and b = 2. The line is y = (1/2)x + 2. Check with the other point: (1/2)(4) + 2 = 4. It is good practice to use one point to find b and the other to check, because a slip in the slope would then show up as a mismatch.
Parallel and perpendicular lines use the same steps with a slope you borrow. The line parallel to y = 3x − 1 through (1, 5) has slope 3, so 5 = 3(1) + b and b = 2: y = 3x + 2. The line perpendicular to y = 2x + 3 through (4, 1) has slope −1/2, so 1 = (−1/2)(4) + b and b = 3: y = −(1/2)x + 3. In the graph lab, drag the two points anywhere on the grid and the panel writes out both forms of the line through them.
Drag to turn. Scroll or pinch to zoom.
- Which is the line with slope −2 and y-intercept (0, 4)?
- y = −2x + 4
- y = 4x − 2
- y = −2x − 4
- y = 2x + 4
- A line has slope 2/3 and passes through (3, 1). What is b in y = mx + b?
- What is the slope of the line through (−2, 1) and (4, 4)?
- The line through (−2, 1) and (4, 4) has slope 1/2. What is b?
- Which is the point-slope form of the line with slope 5 through (−4, 2)?
- y − 2 = 5(x + 4)
- y + 2 = 5(x − 4)
- y − 2 = 5(x − 4)
- y − 4 = 5(x + 2)
- What is the slope of the line through (1, −3) and (5, 5)?
- The line through (1, −3) and (5, 5) has slope 2. What is b?
- Which line is parallel to y = 3x − 1 and passes through (1, 5)?
- y = 3x + 2
- y = 3x + 5
- y = −(1/3)x + 5
- y = 5x + 1
- Which line is perpendicular to y = 2x + 3 and passes through (4, 1)?
- y = −(1/2)x + 3
- y = 2x − 7
- y = (1/2)x − 1
- y = −2x + 9
- Which is the equation of the horizontal line through (2, −6)?
- y = −6
- x = 2
- y = 2
- x = −6
- Find m and b, then write y = mx + b.
- Point-slope form: y − y₁ = m(x − x₁).
- From two points: slope first, then b from one point, check with the other.
- Parallel lines borrow the slope; perpendicular lines use its negative reciprocal.