A line equation describes every point on a straight line, not just the two points used to draw it. Different forms make different information visible: slope-intercept form shows a rate and an axis crossing, point-slope form starts from a known point, and standard form includes vertical lines.

Choose the form that matches the information given, then verify the finished equation against that information. Rearranging an equation does not change its line when the algebraic steps are equivalent.

On this page

Three useful forms

For a non-vertical line, slope-intercept form is

y=mx+b.y=mx+b.

Here mm is the slope and (0,b)(0,b) is the yy-intercept. A line of slope mm through (x1,y1)(x_1,y_1) has point-slope form

y−y1=m(x−x1).y-y_1=m(x-x_1).

A form that also includes vertical lines is

Ax+By=C,(A,B)≠(0,0).Ax+By=C,\qquad(A,B)\ne(0,0).

The last condition means AA and BB cannot both be zero. If B≠0B\ne0, rearrangement gives slope −A/B-A/B and yy-intercept C/BC/B. If B=0B=0, then A≠0A\ne0 and the line is vertical: x=C/Ax=C/A. These line representations are consistent with OpenStax’s treatment of linear functions.

Given one point and a slope

Find the line through (2,5)(2,5) with slope −32-\tfrac32. Insert the data into point-slope form:

y−5=−32(x−2).y-5=-\frac32(x-2).

Distribute and add 5:

y−5=−32x+3y=−32x+8.\begin{aligned}y-5&=-\frac32x+3\\y&=-\frac32x+8.\end{aligned}

To remove fractions, multiply the equation by 2 and rearrange:

3x+2y=16.3x+2y=16.

All three equations describe the same line. The original point checks: 3(2)+2(5)=163(2)+2(5)=16. The slope from standard form is −3/2-3/2, matching the given rate.

Three forms describe the same line

Three forms describe the same lineThe line through two, five has slope negative three halves, y-intercept eight and x-intercept sixteen thirds.2468−22468100xyP (2, 5)(0, 8)(16/3, 0)
Point-slope, slope-intercept and standard forms preserve the same points.
Diagram explanation and exact data

The equation is y − 5 = −3(x − 2)/2, or y = −3x/2 + 8, or 3x + 2y = 16. Intercepts and the given point are exact.

Three forms describe the same line: exact reference data
Feature Exact value
Given point (2,5)(2,5)
Slope −3/2-3/2
x-intercept (16/3,0)(16/3,0)
y-intercept (0,8)(0,8)

The geometric reasoning behind point-slope form is straightforward. Every other point on this non-vertical line has the same ratio (y−y1)/(x−x1)=m(y-y_1)/(x-x_1)=m. Multiplying by x−x1x-x_1 produces the equation. The equation also includes the starting point itself, where both differences are zero, even though the ratio would be undefined there.

Given two distinct points

Find the line through A=(−1,2)A=(-1,2) and B=(3,10)B=(3,10). First calculate the slope:

m=10−23−(−1)=84=2.m=\frac{10-2}{3-(-1)}=\frac84=2.

Use either point in point-slope form. Using AA gives

y−2=2(x+1)⇒y=2x+4.y-2=2(x+1)\Rightarrow y=2x+4.

Check both points: at x=−1x=-1, the equation gives y=2y=2; at x=3x=3, it gives y=10y=10. Checking both catches mistakes that a single check may miss.

When the points have the same horizontal coordinate

The points (3,−2)(3,-2) and (3,5)(3,5) determine the vertical line x=3x=3. Do not divide by zero while trying to force this into y=mx+by=mx+b.

If the two supplied points are identical, they do not determine a unique line. A slope or another distinct point is needed. “Two points determine a line” assumes that the points are distinct.

Given intercepts

Suppose the intercepts are (6,0)(6,0) and (0,4)(0,4). Since both intercept values are non-zero, start with

x6+y4=1.\frac{x}{6}+\frac{y}{4}=1.

Multiplying by 12 gives 2x+3y=122x+3y=12. Solving for yy gives y=−23x+4y=-\tfrac23x+4. The negative slope fits a line falling from (0,4)(0,4) towards (6,0)(6,0).

For a line through the origin, both axis intercepts coincide. Use another point or a slope instead of trying to put a zero intercept in a denominator.

Whole lines, segments and restricted models

The equation y=2x+4y=2x+4 describes an entire infinite line. To describe only the segment from (−1,2)(-1,2) to (3,10)(3,10), include the restriction

y=2x+4,−1≤x≤3.y=2x+4,\qquad-1\le x\le3.

The endpoint inequalities are part of the description. Without them, points beyond the segment still satisfy the equation. A vertical segment can instead be specified by a fixed xx and an interval for yy.

A model may impose further restrictions. For example, a linear formula for the length of material remaining after cuts should not be extended to negative lengths just because the algebraic line continues.

Check more than appearance

Two drawings can look similar while representing different equations. A dependable check uses the exact slope and a known point. For two-point data, substitute both endpoints. For standard form, multiplying every coefficient and the constant by the same non-zero number produces an equivalent equation.

For instance, 3x+2y=163x+2y=16 and 6x+4y=326x+4y=32 are the same line. Multiplying only the left side changes the equation and generally changes the line. An equivalent line equation is a statement about the whole solution set, not just a cosmetic change of notation.

Practice questions

  1. Find the line through (2,5)(2,5) with slope −32-\tfrac32.
  2. Find the line through (−1,2)(-1,2) and (3,10)(3,10).
  3. Find the line through (3,−2)(3,-2) and (3,5)(3,5).
Check your answers
  1. y−5=−32(x−2)y-5=-\tfrac32(x-2), so y=−32x+8y=-\tfrac32x+8. Equivalently, 3x+2y=163x+2y=16.
  2. The slope is (10−2)/(3+1)=2(10-2)/(3+1)=2. Thus y−2=2(x+1)y-2=2(x+1), or y=2x+4y=2x+4.
  3. Both points have x=3x=3, so the equation is x=3x=3. Its slope is undefined.

Related topics

Use Parallel and Perpendicular Lines to construct lines from a directional relationship. Distance from a Point to a Line uses standard form to measure the shortest separation.

Sources and further reading