Graph of a linear equation

Take any linear equation in two variables — say x+y=5x + y = 5 — and start listing its solutions: (0,5)(0,5), (2,3)(2,3), (5,0)(5,0), and infinitely many more. Plot a few of these ordered pairs on the Cartesian plane and something remarkable happens: they never scatter. Every single one lands on the same straight line. That line is not just a picture — it is the complete solution set of the equation, an infinite list of ordered pairs compressed into one geometric object you can draw with a ruler. This article shows why the points always line up, gives a fast two-point method for drawing the graph without plotting a dozen solutions, and works through examples so you can move confidently between the algebra of an equation and the geometry of its graph.

The core insight

Every solution (x,y)(x, y) of a linear equation ax+by+c=0ax + by + c = 0 plots as a point on the Cartesian plane, and all such points are collinear, so the graph of the equation is a single straight line representing every one of its infinitely many solutions.

The core idea

A linear equation in two variables, ax+by+c=0ax + by + c = 0, has infinitely many solutions — pairs (x,y)(x, y) that make the equation true. Choose any value for one variable, solve for the other, and you get one such pair. Plot enough of these pairs on graph paper and they are always found to be collinear: they sit on one common straight line, never scattered. That line is called the graph of the linear equation. Every point on it satisfies the equation, and every point off it does not — the line is a complete geometric picture of an infinite algebraic solution set. Two special families are worth spotting on sight. A line of the form y=cy = c (a fixed number, no xx term) is parallel to the xx-axis, sitting at a constant height ∣c∣|c| above or below it, because every point on it has the same yy-value no matter what xx is. Symmetrically, x=cx = c is parallel to the yy-axis. A third useful pattern: if the equation has no constant term, ax+by=0ax + by = 0, then (0,0)(0,0) always satisfies it, so the line must pass through the origin. Because a straight line is fixed once you know just two points on it, you rarely need to plot many solutions at all. The fastest reliable method is to find where the line crosses each axis — its intercepts — since these are two points you can compute directly from the equation without guessing values.

x-intercept=−ca,y-intercept=−cbx\text{-intercept} = -\frac{c}{a}, \qquad y\text{-intercept} = -\frac{c}{b}

where: the xx-intercept is the point where the line crosses the xx-axis (found by setting y=0y = 0 in ax+by+c=0ax + by + c = 0), the yy-intercept is where it crosses the yy-axis (found by setting x=0x = 0), and aa, bb, cc are the coefficients of the equation in standard form, with a≠0a \neq 0 and b≠0b \neq 0 for both intercepts to exist.

Figure
Graph of x plus y equals 5 showing three collinear points joined by one straight line crossing both axes
Graph of x + y = 5 x y 0 (0, 5) (2, 3) (5, 0) All three points lie on one line — the graph of the equation

Derivation

Derivation AFinding the two axis intercepts to plot ax + by + c = 0

The goal is to turn any linear equation given in standard form ax+by+c=0ax + by + c = 0 into two concrete, computable points — the places where its graph crosses the xx-axis and the yy-axis — so that a straight line can be drawn immediately with a ruler, without the extra work of tabulating and checking three or more arbitrary solutions.

Step 1. Every point that lies on the xx-axis has y=0y = 0, since height above the axis is exactly what yy measures. Substitute y=0y = 0 into the standard form: ax+b(0)+c=0ax + b(0) + c = 0, which simplifies to ax+c=0ax + c = 0, so x=−cax = -\dfrac{c}{a}. This gives the xx-intercept, the point (−ca, 0)\left(-\dfrac{c}{a},\ 0\right).

Step 2. By the same reasoning, every point on the yy-axis has x=0x = 0. Substitute x=0x = 0 into the standard form: a(0)+by+c=0a(0) + by + c = 0, which simplifies to by+c=0by + c = 0, so y=−cby = -\dfrac{c}{b}. This gives the yy-intercept, the point (0, −cb)\left(0,\ -\dfrac{c}{b}\right).

Step 3. Plot these two points and join them with a ruler, extending the line in both directions. Two distinct points completely determine a straight line, so this pair alone fixes the entire graph — no third solution is strictly necessary, though plotting one as a check is good practice.

Step 4. Check the formula against the known equation x+y=5x + y = 5, written in standard form as x+y−5=0x + y - 5 = 0, so a=1a = 1, b=1b = 1, c=−5c = -5. The xx-intercept is −ca=−−51=5-\dfrac{c}{a} = -\dfrac{-5}{1} = 5, giving (5,0)(5, 0), and the yy-intercept is −cb=−−51=5-\dfrac{c}{b} = -\dfrac{-5}{1} = 5, giving (0,5)(0, 5). Both match the solutions found earlier by direct substitution, confirming the shortcut agrees with the point-by-point method.

Worked example

Problem. A pen costs ₹2 more than a pencil. Taking the pencil's cost as ₹xx and the pen's cost as ₹yy, the relationship is y=x+2y = x + 2. Use the intercept method to draw its graph, and read off the pen's cost when the pencil costs ₹3.

Step 1. Write the equation in standard form: y=x+2y = x + 2 becomes x−y+2=0x - y + 2 = 0, so a=1a = 1, b=−1b = -1, c=2c = 2.

Step 2. Find the xx-intercept: set y=0y = 0, so x−0+2=0x - 0 + 2 = 0, giving x=−2x = -2. The line crosses the xx-axis at (−2,0)(-2, 0).

Step 3. Find the yy-intercept: set x=0x = 0, so 0−y+2=00 - y + 2 = 0, giving y=2y = 2. The line crosses the yy-axis at (0,2)(0, 2).

Step 4. Plot (−2,0)(-2, 0) and (0,2)(0, 2) and join them with a ruler, extending the line rightward. To read the pen's cost when the pencil costs ₹3, locate x=3x = 3 on the horizontal axis, move up to the line, and read the yy-value: the line passes through (3,5)(3, 5).

Step 5. Cross-check algebraically: substituting x=3x = 3 into y=x+2y = x + 2 gives y=5y = 5, matching the graph exactly. The pen costs ₹5.

Common traps

  • Plotting only two arbitrary points instead of using intercepts or a checking third point — an arithmetic slip in one solution can silently produce a wrongly angled line.
  • Confusing x=cx = c and y=cy = c — mistakenly drawing x=3x = 3 as horizontal instead of vertical; it is parallel to the yy-axis, not the xx-axis.
  • Using the intercept method when a=0a = 0 or b=0b = 0 (equations like y=3y = 3 or x=−2x = -2), where one of the two intercepts does not exist because the line never crosses that axis.
  • Not extending the line beyond the plotted points, forgetting that the equation's solutions continue indefinitely in both directions.

Ask the tutor: Want help finding the intercepts of your own equation, choosing a good scale for your axes, or checking whether your plotted points are truly collinear? Ask the AI tutor to walk through it with you step by step.

Why do the plotted points always end up on one straight line — could they not curve?

Because the equation itself is linear — every term is either a constant or a variable raised to the first power, with no x2x^2, xyxy, or higher terms. Algebraically, solving ax+by+c=0ax + by + c = 0 for yy gives y=−abx−cby = -\frac{a}{b}x - \frac{c}{b}, which is the equation of a straight line: for every unit increase in xx, yy changes by the same fixed amount −ab-\frac{a}{b}. That constant rate of change is exactly what keeps every solution point on one line rather than letting the pattern bend or curve.

Do I always need three points, or is the intercept method enough on its own?

Two points are mathematically enough to fix a straight line, so the two intercepts alone are sufficient to draw the graph. In practice, though, plotting a third point — any other solution of the equation — is strongly recommended as a check, especially in an exam: if the third point does not fall on the line joining the first two, you know immediately that an arithmetic mistake was made somewhere, before you lose marks for a wrong graph.

What if the equation has no constant term, like 2x + 3y = 0 — where does the line cross the axes?

When c=0c = 0, both intercept formulas give x=0x = 0 and y=0y = 0, meaning the line crosses both axes at the same single point, the origin (0,0)(0,0). In that case the intercept method collapses to just one point, so you must find at least one more solution by substituting any convenient value, such as x=3x = 3 giving y=−2y = -2 for 2x+3y=02x + 3y = 0, and draw the line through that point and the origin.

Before this

Where this leads