Graphing Linear Equations: Definition, Method and Examples

MathPublished

Graphing Linear Equations

To graph a linear equation, create and plot at least two correct ordered pairs, then draw the straight line through them. In y=mx+by = mx + b, bb gives the yy-intercept and mm gives the rise-over-run slope; a linear graph need not pass through the origin.


Once you know how to draw and interpret these graphs, you can reverse the process for writing linear equations from a coordinate plane.

What does graphing a linear equation mean?

Graphing a linear equation creates a visual representation of all the solutions to that equation. The result is always a straight line on the coordinate plane.


Every individual point on the line has an xx-coordinate and a yy-coordinate. When you substitute those values back into the equation, they make the statement true. Because there are infinite combinations of xx and yy that balance linear equations, the line continues endlessly in both directions.

Graph from a value table

You can graph any linear equation by calculating a small set of coordinate pairs.


To use a value table, choose simple numbers for the independent variable xx, substitute them into the equation, and calculate the corresponding values for yy. Once you have your ordered pairs, plot points on a graph and connect them.


While you only need two points to draw a straight line, it is best practice to calculate three. The third point acts as a check; if all three points do not line up perfectly, you know there is a calculation error.

Graph using slope and y-intercept

When a linear equation is written in slope-intercept form, y=mx+by = mx + b, you can graph it quickly without a value table.


The variable bb represents the yy-intercept, which is the exact point where the line crosses the vertical yy-axis. Its coordinate is always (0,b)(0, b). This provides your starting point.


The variable mm represents the slope of a line. Slope measures the steepness and direction as a ratio of the vertical change (rise) to the horizontal change (run). From your starting yy-intercept, count the rise and the run to find the next point on the line.

Use intercepts when useful

Sometimes equations are given in standard form, such as Ax+By=CAx + By = C. In these cases, finding the two intercepts is often the fastest graphing method.


The x-intercept has a y-coordinate of 0, and the y-intercept has an x-coordinate of 0.


Substitute y=0y = 0 into the equation and solve for xx to find the xx-intercept. Then, substitute x=0x = 0 into the equation and solve for yy to find the yy-intercept. Plot these two points on the axes and draw the line connecting them.

Check the line

Always verify your graphed line by selecting a random test point. Pick any point that lies on your drawn line but was not one of your initial calculated points.


Substitute the xx and yy values of this test point back into the original equation. If both sides of the equation equal the same number, your graph is correct.

Worked examples


Example 1: Graphing using a value table


Question: Graph the equation y=−2x+4y = -2x + 4 using a table of values.


Method:

  1. Choose three simple values for xx, such as 00, 11, and 22.
  2. Substitute each into the equation to calculate yy.

xx

y=−2x+4y = -2x + 4

yy

Ordered Pair

00

−2(0)+4-2(0) + 4

44

(0,4)(0, 4)

11

−2(1)+4-2(1) + 4

22

(1,2)(1, 2)

22

−2(2)+4-2(2) + 4

00

(2,0)(2, 0)

3. Plot the three ordered pairs on the coordinate plane and draw a straight line through them.


Answer:

A coordinate plane showing a straight line passing through the plotted points at 0 comma 4, 1 comma 2, and 2 comma 0.

Check: Test x=3x = 3. The equation gives y=−2(3)+4=−2y = -2(3) + 4 = -2. The point (3,−2)(3, -2) falls exactly on the drawn line.


Example 2: Graphing using slope and intercept


Question: Graph the equation y=13x−2y = \dfrac{1}{3}x - 2.


Method:

  1. Identify the yy-intercept from the equation. The constant bb is −2-2, so the starting point is (0,−2)(0, -2).
  2. Identify the slope. The coefficient mm is 13\dfrac{1}{3}. This means a rise of 11 unit for a run of 33 units to the right.
  3. Start at (0,−2)(0, -2), move up 11 and right 33 to find the next point (3,−1)(3, -1).

Answer:

A coordinate plane showing a line through 0 comma negative 2 and 3 comma negative 1, with dashed arrows showing a rise of 1 and run of 3.

Check: Test x=−3x = -3. The point on the graph is (−3,−3)(-3, -3). Using the equation, y=13(−3)−2=−1−2=−3y = \dfrac{1}{3}(-3) - 2 = -1 - 2 = -3. The point is correct.


Example 3: Graphing using intercepts


Question: Graph the line 3x+2y=63x + 2y = 6 by finding its intercepts.


Method:

  1. Find the xx-intercept by setting y=0y = 0.

3x+2(0)=63x + 2(0) = 6

3x=63x = 6

x=2x = 2

The xx-intercept is (2,0)(2, 0).

  1. Find the yy-intercept by setting x=0x = 0.

3(0)+2y=63(0) + 2y = 6

2y=62y = 6

y=3y = 3

The yy-intercept is (0,3)(0, 3).

  1. Plot (2,0)(2, 0) and (0,3)(0, 3) and draw the line through them.

Answer:

A coordinate plane showing a straight line passing through the y-intercept at 0 comma 3 and the x-intercept at 2 comma 0.

Check: Test the point (4,−3)(4, -3) which lies on the visual graph. Substitute into 3x+2y=63x + 2y = 6: 3(4)+2(−3)=12−6=63(4) + 2(-3) = 12 - 6 = 6. The values match perfectly.

Common mistakes

  • Drawing a short segment instead of a line: Linear equations represent infinite solutions. If you only join your two calculated points, you are drawing a line segment. Always extend the line across the entire grid and place arrows at the ends.
  • Unequal axis spacing: The scale on each axis must be consistent. If one grid square represents 11 unit, it must represent 11 unit everywhere on that axis.
  • Reversing coordinates: An ordered pair is always (x,y)(x, y). A common plotting error is moving vertically first and horizontally second, which plots the point backwards as (y,x)(y, x).

Frequently asked questions

Are there other ways to represent linear equations?

Yes. While slope-intercept form (y=mx+by = mx + b) is common, you can also write linear equations in standard form (Ax+By=CAx + By = C) and point-slope form (y−y1=m(x−x1)y - y_1 = m(x - x_1)). All forms produce the same straight line when graphed.


Do linear equations have exponents?

The variables in linear equations only have an exponent of 11. If an equation contains x2x^2, x3x^3, or variables inside a square root, it will not form a straight line when graphed.

Practice questions

Question

A coordinate plane showing a straight line passing through 0 comma 2, 1 comma 3, and negative 2 comma 0.

Which equation is represented by the line shown in the graph?

  • y=x+2y = x + 2

  • y=x−2y = x - 2

  • y=−x+2y = -x + 2

  • y=2x+1y = 2x + 1

Answer:

y=x+2y = x + 2

Question

What are the xx-intercept and yy-intercept of the line 4x−2y=84x - 2y = 8?

  • xx-intercept: 22, yy-intercept: 44

  • xx-intercept: −2-2, yy-intercept: 44

  • xx-intercept: 22, yy-intercept: −4-4

  • xx-intercept: 44, yy-intercept: −2-2

Answer:

xx-intercept: 22, yy-intercept: −4-4

Question

A line has a yy-intercept of 33 and a slope of −12-\dfrac{1}{2}. Which pair of points lies on this line?

  • (0,3)(0, 3) and (2,2)(2, 2)

  • (3,0)(3, 0) and (2,2)(2, 2)

  • (0,3)(0, 3) and (−2,2)(-2, 2)

  • (0,−3)(0, -3) and (2,2)(2, 2)

Answer:

(0,3)(0, 3) and (2,2)(2, 2)

Question

A coordinate plane showing a straight line with a y-intercept of 1 and passing through negative 1 comma 4.

The graph represents the line y=−3x+1y = -3x + 1. What is the value of yy when x=−1x = -1 based on the graph?

  • 44

  • −2-2

  • −4-4

  • 11

Answer:

44

Question

Which of the following equations represents a line that passes through the origin?

  • y=5xy = 5x

  • y=x+5y = x + 5

  • y=5y = 5

  • x=5x = 5

Answer:

y=5xy = 5x