Straight Lines

Straight Lines

A straight line is the simplest curve in the plane. Its defining feature is a constant slope: the ratio of the vertical change to the horizontal change between any two points on the line. Every non-vertical line can be written in the form y = mx + b, where m is the slope and b is the y-intercept.

Quick Reference

Form Equation When to Use
Point-slope form y = y_1 + m(x - x_1) Given slope m and a point (x_1, y_1)
Slope-intercept form y = mx + b Given slope m and y-intercept b
Point-point form y = y_1 + \dfrac{y_2-y_1}{x_2-x_1}(x-x_1) Given two points (x_1,y_1) and (x_2,y_2)
General form Ax + By + C = 0 Any non-degenerate line
Vertical line x = x_1 Line parallel to the y-axis

Slope of a Line

Consider a straight line L and two distinct points P(x_1, y_1) and Q(x_2, y_2) on it. The slope of the line, denoted m, is:

\boxed{m = \frac{y_2 - y_1}{x_2 - x_1}}

The slope of a line is independent of which two points we choose on the line. If Q is exactly one unit to the right of P (so x_2 - x_1 = 1), then m = y_2 - y_1: moving one unit horizontally, the slope tells us how many units we must travel vertically to stay on the line. This is the origin of the phrase:

\text{slope} = \frac{\text{rise}}{\text{run}}
Two points P and Q on a line, with a right triangle showing the vertical rise and horizontal run between them.
Slope = Rise / Run

The sign of the slope indicates the line's direction:

  • m > 0: the line rises to the right.
  • m < 0: the line falls to the right.
  • m = 0: the line is horizontal.
The absolute value of the slope measures the steepness of the line: larger |m| means a steeper line.
Several lines through the origin with different slopes labeled, illustrating how larger slopes produce steeper lines.
Lines with different slopes through the origin

Important: The slope of a vertical line is undefined. Any two points on a vertical line share the same x-coordinate, making the denominator x_2 - x_1 = 0, and division by zero is not defined.

Equations of a Line

Point-Slope Form

To find the equation of the line through P(x_1, y_1) with slope m, let (x, y) be any other point on the line. The slope formula gives \dfrac{y - y_1}{x - x_1} = m, which rearranges to:

Point-Slope Form

y = y_1 + m(x - x_1)

Slope-Intercept Form

The special case where the known point is the y-intercept (0, b) gives:

Slope-Intercept Form

y = mx + b

where m is the slope and b is the y-intercept.

Point-Point Form

Given two points (x_1, y_1) and (x_2, y_2), first compute m = \dfrac{y_2 - y_1}{x_2 - x_1}, then substitute into the point-slope form:

Point-Point Form

y = y_1 + \left(\frac{y_2-y_1}{x_2-x_1}\right)(x-x_1)

Vertical Lines

The equation of the vertical line through (x_1, y_1) is x = x_1.

General Equation of a Line

General Equation of a Line

Ax + By + C = 0 \quad (A \text{ and } B \text{ not both zero})

Every line can be written in this form, and every equation of this form represents a line.

To understand why, consider two cases:

  • Nonvertical line y = mx + b: rearrange to -mx + y - b = 0, which matches the general form with A = -m, B = 1, C = -b.
  • Vertical line x = a: rearrange to x - a = 0, matching A = 1, B = 0, C = -a.

Conversely, from Ax + By + C = 0:

  • If B \neq 0, solve for y: y = -\dfrac{A}{B}x - \dfrac{C}{B}. This is slope-intercept form with slope m = -\dfrac{A}{B} and y-intercept b = -\dfrac{C}{B}.
  • If B = 0, the equation becomes Ax + C = 0, giving x = -\dfrac{C}{A}: a vertical line.

Worked Examples

Example 1. Find an equation of the line through (-2, 4) with slope m = \dfrac{3}{4}.

Solution. Using the point-slope form:

\begin{aligned} y - 4 &= \frac{3}{4}(x-(-2)) \\ y &= 4 + \frac{3}{4}(x+2) \\ y &= \frac{3}{4}x + \frac{3}{2} + 4 = \frac{3}{4}x + 5.5. \end{aligned}

Alternatively, multiplying both sides of y - 4 = \dfrac{3}{4}(x+2) by 4:

4y - 16 = 3x + 6 \implies 3x - 4y + 22 = 0.

A slope of \dfrac{3}{4} means moving 4 units right and 3 units up traces the line.

Example 2. Find an equation of the line through $(1, 5)$ and (4, -1).

Solution. First compute the slope:

m = \frac{-1-5}{4-1} = \frac{-6}{3} = -2.

Apply the point-slope form with (x_1, y_1) = (1, 5):

y - 5 = -2(x-1) \implies y = -2x + 7.

Example 3. Find the equation of the line with slope -1 and y-intercept $3$.

Solution. From the slope-intercept form with m = -1 and b = 3:

y = -x + 3.

Example 4. Find the slope and y-intercept of 2y + 4x = 6.

Solution. Solve for y:

2y = -4x + 6 \implies y = -2x + 3.

The slope is m = -2 and the y-intercept is b = 3.

Example 5. Find the slope and y-intercept of 5x - 2y + 8 = 0.

Solution. Isolate y:

-2y = -5x - 8 \implies y = \frac{5}{2}x + 4.

The slope is m = \dfrac{5}{2} and the y-intercept is b = 4.

Frequently Asked Questions

What is the slope of a line?

The slope of a line is the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line. It measures both the steepness and direction of the line. A positive slope means the line rises from left to right, a negative slope means it falls, and a slope of zero means the line is horizontal.


What is the point-slope form of a line? The point-slope form is y = y_1 + m(x - x_1). It is used when you know the slope m and one point (x_1, y_1) on the line. Substitute those values and simplify to get the equation of the line. This is generally the fastest form to use when solving problems.

How is slope-intercept form different from point-slope form? The slope-intercept form y = mx + b is a special case of the point-slope form where the known point is the y-intercept (0, b). Use slope-intercept form when you know the slope and y-intercept directly. Use point-slope form when you know the slope and any other point on the line.

Why is the slope of a vertical line undefined? A vertical line passes through all points sharing the same x-coordinate. If we try to compute the slope using two such points (x_0, y_1) and (x_0, y_2), the denominator of \dfrac{y_2 - y_1}{x_2 - x_1} becomes x_0 - x_0 = 0. Division by zero is undefined, so vertical lines have no defined slope.

What does the general form Ax + By + C = 0 tell us? The general form Ax + By + C = 0 is a unified way to write any line, including vertical ones. From it, you can find the slope and intercepts: if B \neq 0, the slope is -A/B and the y-intercept is -C/B. If B = 0, the line is vertical. The general form is often preferred when working with systems of equations or computing distances.