To determine the equation of a straight line, you need two key elements: a) a point on the line; and b) its slope (sometimes referred to as gradient). However, the approach to finding these details and how you manipulate them afterward may vary depending on the situation. For simplicity, this article will focus on the slope-intercept form y = mx + b rather than the point-slope form (y - y1) = m(x - x1).
Steps
General Information
Knowing the Slope and a Point on the Line

Calculate the y-intercept in your equation. The y-intercept (or variable b in the equation) is the point where the line intersects the y-axis. You can determine the y-intercept by rearranging the equation to solve for b. The new equation will look like this: b = y - mx.
- Plug the slope and coordinates into the equation above.
- Multiply the slope (m) by the x-coordinate of the given point.
- Subtract this product from the y-coordinate of the point.
- You have now found b, the y-intercept of the equation.

Write the formula: y = ____ x + ____ , including the blanks.

Fill in the first blank, before x, with the slope.

Fill in the second blank with the y-intercept you just calculated.

Solve the example problem. "Find the equation of the line passing through the point (6, -5) with a slope of 2/3."
- Rearrange the equation. b = y - mx.
- Substitute the values and solve.
- b = -5 - (2/3)6.
- b = -5 - 4.
- b = -9
- Verify whether your y-intercept is indeed -9.
- Write the equation: y = 2/3 x - 9
Knowing Two Points on the Line
Calculate the slope between the two points. The slope, often referred to as "rise over run," indicates how much the line ascends or descends as you move one unit to the left or right. The formula for the slope is: (Y2 - Y1) / (X2 - X1)
- Use the two known points and substitute them into the equation (the coordinates here are the two y and two x values). The order in which you plug in the coordinates doesn’t matter, as long as you remain consistent. Here are a few examples:
- Points (3, 8) and (7, 12). (Y2 - Y1) / (X2 - X1) = 12 - 8 / 7 - 3 = 4/4, or 1.
- Points (5, 5) and (9, 2). (Y2 - Y1) / (X2 - X1) = 2 - 5 / 9 - 5 = -3/4.

Choose one pair of coordinates for the rest of the problem. Cross out or cover the other pair to avoid accidentally using them.

Determine the y-intercept of the equation. Once again, rearrange the formula y = mx + b to get b = y - mx. It’s the same equation, just slightly transformed.
- Substitute the slope and coordinates into the equation above.
- Multiply the slope (m) by the x-coordinate of the point.
- Subtract this product from the y-coordinate of the point.
- You’ve now found b, the y-intercept.

Write the formula: y = ____ x + ____ ', including the blanks.

Fill in the first blank, before x, with the slope.

Fill in the second blank with the y-intercept.

Solve the example problem. "Given two points (6, -5) and (8, -12), find the equation of the line passing through these points."
- Find the slope. Slope = (Y2 - Y1) / (X2 - X1)
- -12 - (-5) / 8 - 6 = -7 / 2
- The slope is -7/2 (From the first point to the second, we go down 7 and right 2, so the slope is –7 over 2).
- Rearrange your equation. b = y - mx.
- Substitute and solve.
- b = -12 - (-7/2)8.
- b = -12 - (-28).
- b = -12 + 28.
- b = 16
- Note: When substituting coordinates, since you used 8, you must also use -12. If you use 6, you must use -5.
- Double-check to ensure your y-intercept is indeed 16.
- Write the equation: y = -7/2 x + 16
Knowing a Point and a Parallel Line
Determine the slope of the parallel line. Remember, the slope is the coefficient of x, while y has no coefficient.
- In the equation y = 3/4 x + 7, the slope is 3/4.
- In the equation y = 3x - 2, the slope is 3.
- In the equation y = 3x, the slope is still 3.
- In the equation y = 7, the slope is zero (since there is no x).
- In the equation y = x - 7, the slope is 1.
- In the equation -3x + 4y = 8, the slope is 3/4.
- To find the slope of this equation, rearrange it so that y stands alone:
- 4y = 3x + 8
- Divide both sides by "4": y = 3/4x + 2

Calculate the y-intercept using the slope found in the first step and the equation b = y - mx.
- Substitute the slope and coordinates into the equation above.
- Multiply the slope (m) by the x-coordinate of the point.
- Subtract this product from the y-coordinate of the point.
- You’ve now found b, the y-intercept.

Write the formula: y = ____ x + ____ , including the blanks.

Fill in the first blank, before x, with the slope found in step 1. The key point about parallel lines is that they share the same slope, so your starting point is also your ending point.

Fill in the second blank with the y-intercept.
Knowing a Point and a Perpendicular Line
Determine the slope of the given line. Refer to previous examples for additional information.

Find the negative reciprocal of that slope. In other words, flip the number and change its sign. The key issue with perpendicular lines is that their slopes are negative reciprocals. Therefore, you must transform the slope before using it.
- 2/3 becomes -3/2
- -6/5 becomes 5/6
- 3 (or 3/1 — same thing) becomes -1/3
- -1/2 becomes 2

Calculate the y-intercept using the slope from step 2 and the equation b = y - mx
- Substitute the slope and coordinates into the equation above.
- Multiply the slope (m) by the x-coordinate of the point.
- Subtract this product from the y-coordinate of the point.
- You’ve now found b, the y-intercept.

Write the formula: y = ____ x + ____ ', including the blanks.

Fill in the first blank, before x, with the slope calculated in step 2.

Fill in the second blank with the y-intercept.
