Equations and graphs of lines

There are several forms of equations for a line. Using these, if you see a line on a Cartesian plane, then you can pick two variables (usually x and y) and write an equation for that line. Conversely, if you understand the slope–intercept form, then you can draw a graph of any linear equation —or even inequality— in two variables.

Equations for lines

There are three common forms of equations for lines: There are also special forms for horizontal and vertical lines.

The general form is not very important for graphing, and I will mostly skip it.

A point–slope form is useful if you know the slope of the line and the coordinates of one of the points on the line. If your variables are x and y (as usual), the slope is m, and the known point is (ab), then the point–slope form of the line for that point is

y − b = m(x − a).
Note that a, b, and m will all stand for specific numbers that you know; only x and y will remain variables.

If you know two different points on one line, then you can use those two points to calculate the slope, then use the slope with either of the original points to get an equation in point–slope form. (Sometimes the resulting equation is called a point–point form of the line.)

The slope–intercept form of a line is basically a special case of the point–slope form when the point used is the y-intercept of the line. Specifically, if m is the slope and the y-intercept is (0, b), then the slope–intercept form of the line is

y = mx + b.

A horizontal line has slope 0, so the equation of a horizontal line will simply be

y = b,
where b is the y-coordinate of any point on the line.

Vertical lines don't have slopes, but you can still write the equation of a vertical line in a similar way, as

x = a,
where a is the x-coordinate of any point on the line.

Graphing a linear equation

Here are the steps to graph a linear equation (or inequality) in two variables (say x and y):

Here are the exceptional cases when y disappears (or was never there):


Go back to the MATH-0950-ES32 homepage.
This web page was written in 2007 by Toby Bartels. Toby reserves no legal rights to it.

The permanent URI of this web page is http://tobybartels.name/MATH-0950/2007SP/lines/.

HTML 5