Equations of Lines: Forms and How to Write Them from Given Information

Updated

To write the equation of a line, first identify what you are given, then choose the matching form: slope-intercept form (y = mx + b) when you know the slope and y-intercept, point-slope form (y - y_1 = m(x - x_1)) when you know a point and the slope, and standard/general form (Ax + By = C) when you need a tidy equation with integer coefficients. Two points or a graph always let you find the slope first, after which either slope-intercept or point-slope form finishes the job. The sections below give the steps, a worked example for each case, and a quick way to check your answer.

The three forms and when to use each

Form Equation Best when you know Watch out for
Slope-intercept (y = mx + b) Slope (m) and y-intercept (b) (b) is the y-value where (x = 0), not the x-intercept
Point-slope (y - y_1 = m(x - x_1)) Any one point and the slope Sign errors: (y - y_1) uses the point's coordinates with subtraction
Standard / general (Ax + By = C) You want integer coefficients or a form for systems (A) is often written positive, but any nonzero multiple is equivalent

All three describe the same line, so converting between them is just algebra. Slope-intercept form is usually the most readable for graphing; point-slope form is the fastest route from a point and a slope; standard form is common in textbooks and when solving systems of equations.

Writing the equation from a slope and y-intercept

If you are told the slope is (m) and the line crosses the y-axis at ((0, b)), substitute directly into (y = mx + b).

Example: slope (3), y-intercept (-2) gives (y = 3x - 2).

Check: substitute (x = 0); you should get (y = -2), confirming the intercept.

Writing the equation from a point and a slope

Use point-slope form, then simplify to slope-intercept form if requested.

Example: slope (-2) through ((4, 1)).

  1. Substitute: (y - 1 = -2(x - 4)).
  2. Distribute: (y - 1 = -2x + 8).
  3. Add 1: (y = -2x + 9).

Check: plug in (x = 4): (y = -2(4) + 9 = 1), which matches the given point.

Writing the equation from two points

Two points determine the slope; then use either point in point-slope form.

Example: through ((1, 5)) and ((3, 11)).

  1. Slope: (m = \dfrac{11 - 5}{3 - 1} = \dfrac{6}{2} = 3).
  2. Point-slope with ((1, 5)): (y - 5 = 3(x - 1)).
  3. Simplify: (y = 3x + 2).

Check: the second point should satisfy the equation: (3(3) + 2 = 11). ✓

A useful special case: a horizontal line through points with the same y-value has slope (0), so its equation is (y = c). A vertical line through points with the same x-value has an undefined slope and equation (x = c); it cannot be written in slope-intercept form.

Reading the equation from a graph

  1. Find the y-intercept: the point where the line crosses the y-axis gives (b).
  2. Find the slope: pick two clear lattice points and compute (\dfrac{\text{rise}}{\text{run}}).
  3. Substitute into (y = mx + b).

Example: a line crossing the y-axis at ((0, -1)) and passing through ((2, 3)) has slope (\dfrac{3 - (-1)}{2 - 0} = 2), so (y = 2x - 1).

Check: confirm a third point on the graph satisfies the equation before you commit to it.

Verifying your equation

  • Substitute known points. Every point you were given must make the equation true.
  • Recompute the slope from your final equation and compare it with the slope you found.
  • Check the intercept by setting (x = 0) (for slope-intercept form) and comparing with the graph or given data.

If a point fails, the most common causes are a sign error when subtracting coordinates in the slope formula, or distributing the slope to only one term in point-slope form.

Common sticking points

  • Mixing up (x_1) and (y_1) in point-slope form — keep the point's coordinates in the same order as the labels.
  • Dropping the negative sign when the slope is negative and you distribute.
  • Treating the x-intercept as (b) — (b) is always the y-intercept.
  • Forgetting vertical lines have no slope-intercept form.

For related practice, Algebra House (algebrahouse.com) offers worked algebra examples, answered questions, and state test and ACT/SAT practice sections that cover linear equations alongside topics such as combining like terms and the distributive property.