Inequalities and Piecewise Functions

How to Graph Inequalities on a Coordinate Plane

To graph an inequality such as y > 2x − 1: graph the boundary line y = 2x − 1, make it dashed for < or > and solid for ≤ or ≥, then test a point not on the line. If the point makes the inequality true, shade its side; if not, shade the other side. The shaded region is every solution.

The inequality y > 2x − 1 graphed with a dashed boundary line and the region above it shaded; the test point (0, 0) lies in the shaded region.

Check it yourself: every example here can be loaded into the Graphing Inequalities Calculator.

Open the Graphing Inequalities Calculator

The method in three steps

  1. Draw the boundary. Replace the inequality sign with = and graph that line.
    • Dashed for < or > (points on the line are not solutions).
    • Solid for ≤ or ≥ (points on the line are solutions).
  2. Test a point that is not on the line. Substitute it into the original inequality.
  3. Shade. If the test point makes the inequality true, shade the side it is on; if false, shade the other side.

Worked example 1: y > 2x − 1

  1. Boundary: y = 2x − 1 (y-intercept −1, slope 2). The sign is >, so dashed.
  2. Test (0, 0): 0 > 2(0) − 1 → 0 > −1. True.
  3. Shade the side containing the origin — above the line.

Check another point in the shaded region, (−2, 3): 3 > −5 ✓. A point below, (3, 0): 0 > 5 ✗. The picture is consistent.

Try it in the calculator

Worked example 2: 2x + 3y ≤ 6

Three panels: the solid boundary 2x + 3y = 6 through (3, 0) and (0, 2); the test point (0, 0) checked; the region below the line shaded.
Boundary, test, shade.
Text description of this figure

Three panels: the solid boundary 2x + 3y = 6 through (3, 0) and (0, 2); the test point (0, 0) checked; the region below the line shaded.

  1. Replace ≤ with = and graph the line (intercepts (3, 0), (0, 2)).
  2. Substitute (0, 0): 0 ≤ 6 is true.
  3. Shade the side containing (0, 0).
  1. Boundary 2x + 3y = 6 through (3, 0) and (0, 2) — solid, because of ≤.
  2. Test (0, 0): 0 ≤ 6. True.
  3. Shade the side containing the origin — below the line.

Solving for y gives the same result: 3y ≤ −2x + 6 → y ≤ −(2⁄3)x + 2, “y is less than or equal to”, so shade below.

Try it in the calculator

Vertical and horizontal boundaries

  • x ≥ −2: solid vertical line x = −2; shade to the right (x-values greater than −2).
  • y < 3: dashed horizontal line y = 3; shade below.
Try it in the calculator

When to flip the sign

If you solve for y and divide or multiply by a negative number, the inequality sign flips:

−2y > 4x − 6 → divide by −2 → y < −2x + 3 → shade below.

Forgetting to flip is the most common error. A test point catches it every time.

From one variable to two

A one-variable inequality like x > 3 is shown on a number line with an open circle at 3 and an arrow to the right. In two variables, x > 3 becomes a dashed vertical line with everything to its right shaded — the same idea, one dimension higher.

Common mistakes

  • Solid line for a strict inequality (or dashed for ≤/≥). See dashed vs solid boundary lines.
  • Testing a point on the boundary. It gives no information.
  • Not flipping the sign after dividing by a negative.
  • Shading “above” for x > … . For x-inequalities, think left and right.

Next: combine several inequalities in systems of inequalities, or use curved boundaries in nonlinear inequalities.

Questions

Which point should I test?

(0, 0) is easiest if the boundary does not pass through the origin. Otherwise use a point like (1, 0) or (0, 1).

Do I always shade above for >?

Only when the inequality is solved for y (y > …). In forms like 2x − 3y > 6, solve for y first — dividing by −3 flips the sign — or use a test point.

What is the solution of an inequality in two variables?

Every point (x, y) that makes it true. There are infinitely many, which is why the answer is a shaded region rather than a list.

Graph your own example with the Graphing Inequalities Calculator — free, in your browser.

Try it now

Sources and further reading

Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.

Related guides

More in Inequalities and Piecewise Functions · All guides