How to Graph Linear Equations
Learn how to graph linear equations using slope-intercept form, point-slope form, and two-point methods. Step-by-step guide with examples.
What Is a Linear Equation?
A linear equation is an equation whose graph is a straight line. It represents a constant rate of change: for every unit increase in x, y changes by the same fixed amount. Linear equations are the building blocks of algebra and appear in everything from simple budgets to complex economic models. If you can graph a line, you can visualize direct relationships between any two quantities. The most general form of a linear equation in two variables is Ax + By = C, but for graphing purposes, slope-intercept form is usually the most convenient.
Slope-Intercept Form: y = mx + b
Slope-intercept form is the most widely used form for graphing. In y = mx + b, the coefficient m is the slope and b is the y-intercept. The y-intercept b tells you where the line crosses the y-axis, giving you an immediate first point to plot at (0, b). The slope m tells you the line's steepness and direction. A positive slope means the line rises from left to right. A negative slope means it falls. A slope of zero means the line is horizontal. For example, y = 2x + 3 crosses the y-axis at (0, 3) and rises 2 units for every 1 unit to the right.
Understanding Slope
Slope measures the rate of change of y with respect to x. It is calculated as rise over run: m = (y2 - y1) / (x2 - x1), where (x1, y1) and (x2, y2) are any two points on the line. A slope of 3/2 means the line rises 3 units for every 2 units of horizontal movement. A slope of -1 means the line drops 1 unit for every 1 unit to the right, creating a 45-degree downward angle. Steeper lines have slopes with larger absolute values. A vertical line has an undefined slope (you cannot write it as y = mx + b), while a horizontal line has a slope of zero. Understanding slope as a ratio of vertical change to horizontal change is the single most important concept for graphing lines.
Point-Slope Form: y - y1 = m(x - x1)
Point-slope form is especially useful when you know the slope and one point on the line but not the y-intercept. In y - y1 = m(x - x1), (x1, y1) is the known point and m is the slope. For example, a line with slope 4 passing through (2, 5) is y - 5 = 4(x - 2), which simplifies to y = 4x - 3. Point-slope form is also the natural way to write a line when you are given two points: first calculate the slope using m = (y2 - y1) / (x2 - x1), then plug one of the points and the slope into the formula. You can always rearrange point-slope form into slope-intercept form if you prefer.
Graphing Using Two Points
The simplest method to graph a line is to find two points and draw a straight edge through them. If the equation is in slope-intercept form, one point is the y-intercept (0, b). To find a second point, pick any convenient value of x and calculate y. For accuracy, choose a third point as a check: if all three are collinear, you have the right line. If the equation is in standard form Ax + By = C, the easiest two points to find are the x-intercept and y-intercept. Set y = 0 to find the x-intercept (C/A, 0) and set x = 0 to find the y-intercept (0, C/B). Plot both and connect with a straight line.
Special Cases: Horizontal and Vertical Lines
A horizontal line has the equation y = k for some constant k. Every point on the line has the same y-coordinate. Its slope is zero, and it runs parallel to the x-axis. A vertical line has the equation x = k. Every point on the line has the same x-coordinate. Its slope is undefined, and it runs parallel to the y-axis. Vertical lines cannot be written in slope-intercept form. When graphing these special cases, simply draw a straight line through the given constant, either horizontally at y = k or vertically at x = k. Parallel lines have equal slopes, and perpendicular lines have slopes that are negative reciprocals of each other (m1 * m2 = -1).
Worked Example
Graph the equation 3x + 2y = 12. First, find the y-intercept by setting x = 0: 2y = 12, so y = 6. The y-intercept is (0, 6). Next, find the x-intercept by setting y = 0: 3x = 12, so x = 4. The x-intercept is (4, 0). Plot these two points on the coordinate plane and draw a straight line through them. To verify, convert to slope-intercept form: y = (-3/2)x + 6. The slope is -3/2, meaning the line falls 3 units for every 2 units to the right, which matches what we see going from (0, 6) to (4, 0), a drop of 6 over a run of 4, or -3/2.
Try These Calculators
Put what you learned into practice with these free calculators.
Try It Yourself
Put what you learned into practice with our free graphing calculator.
Related Graphs
Related Guides
How to Graph Quadratic Equations
Learn how to graph quadratic equations step by step. Covers standard form, vertex form, finding the vertex, axis of symmetry, x-intercepts, and plotting parabolas.
How to Graph Sine Functions
Learn how to graph sine functions step by step. Understand amplitude, period, phase shift, vertical shift, and how to plot key points of the sine wave.
Graphing Calculator Tutorial - Complete Guide
Learn how to use the free online graphing calculator at ThePrimeCalculator. Enter equations, pan, zoom, add multiple graphs, pin points, and use 3D mode.