Lines & Graphs

Graphing Linear Inequalities: Steps, Shading and Worked Examples

To graph a linear inequality, draw the boundary line by replacing the inequality sign with an equals sign, make it solid for ≤\le or ≥\ge and dashed for << or >>, then shade the side where a test point makes the inequality true. The shaded region is the answer: every point inside it is a solution.

ax+by≤cax + by \le c

The method is short, but points are lost in three places: the wrong line style, a bad test point, and a sign that should have flipped. Each one is covered below with the reason behind it.

How do you graph a linear inequality step by step?

A linear inequality in two variables, such as 2x+3y≤122x+3y\le 12, is satisfied by a whole region of points, not just a single line. The related equation 2x+3y=122x+3y=12 acts as a fence. It cuts the plane into two half-planes, and the solutions live in exactly one of them (plus the fence itself, if equality is allowed).

  1. Replace the inequality sign with == and graph that boundary line.
  2. Choose solid or dashed from the symbol.
  3. Pick a test point that is not on the line and substitute it.
  4. Shade the side that gives a true statement.

Take 2x+3y≤122x+3y\le 12. The equation is already in standard form, so graphing with intercepts is fastest. Setting x=0x=0 gives 3y=123y=12, so y=4y=4. Setting y=0y=0 gives 2x=122x=12, so x=6x=6. Plot the points (0,4)(0,4) and (6,0)(6,0) and join them. The symbol ≤\le allows equality, so the line is solid.

Now test (0,0)(0,0):

2(0)+3(0)=0≤122(0)+3(0)=0\le 12

That is true, so shade the side containing the origin, which is below and to the left of the line. If intercepts are awkward for a given line, a table of values produces the same boundary.

Solid or dashed line: what does the boundary mean?

The line style answers one question: are points on the line solutions? With ≤\le or ≥\ge, equality is allowed, so they are, and the line is solid. With << or >>, equality is not allowed, so the line is dashed to show it is a border you can approach but not stand on. This is the same idea as a closed or open circle on a number line.

You can prove the style to yourself with a single point. For y>2x−3y>2x-3, the point (2,1)(2,1) lies exactly on the boundary because 2(2)−3=12(2)-3=1. Substituting gives 1>11>1, which is false, so that point is not a solution and the line must be dashed. A mental anchor: the symbol ≤\le has a bar underneath it, like a line drawn solid beneath the symbol.

Word problems are where the style usually goes wrong, so translate the phrase before drawing anything:

  • “At least” and “no less than” mean ≥\ge (solid).
  • “At most” and “no more than” mean ≤\le (solid).
  • “More than” and “greater than” mean >> (dashed).
  • “Fewer than” and “less than” mean << (dashed).

When the inequality is already solved for yy, slope-intercept form gives the line instantly: start at the yy-intercept bb, then use rise over run for the slope mm.

Quick check

Should the boundary line of y≥3x−1y\ge 3x-1 be solid or dashed?

How do you pick a test point, and why does it work?

Graph of 2x minus y at least 0 showing why the origin fails as a test point
For 2x − y ≥ 0 the origin sits on the line y = 2x, so (1,0) decides the shading.

Move everything to one side and the inequality becomes a question about the sign of ax+by−cax+by-c. This expression changes smoothly as you move across the plane, and it equals zero only on the boundary line. It cannot switch from positive to negative without passing through zero, which means it cannot switch without crossing the line. So every point on one side shares the same sign, and one test point speaks for an entire half-plane.

The classic trap is a boundary that passes through the origin. Graph 2x−y≥02x-y\ge 0. The boundary is y=2xy=2x, which contains (0,0)(0,0). Testing the origin gives 0≥00\ge 0, which is true but only because the origin is on the line, so it says nothing about either side. Use (1,0)(1,0) instead:

2(1)−0=2≥02(1)-0=2\ge 0

That is true, so shade the side containing (1,0)(1,0), which is below and to the right of the line. A second test confirms it: (0,1)(0,1) gives −1≥0-1\ge 0, which is false, and (0,1)(0,1) lies above the line. Solving the original for yy agrees, since −y≥−2x-y\ge -2x becomes y≤2xy\le 2x, meaning below.

Axis points are cheap

Points like (1,0)(1,0) and (0,1)(0,1) need almost no arithmetic and miss most lines through the origin. Reach for them whenever (0,0)(0,0) sits on the boundary.

Graphing linear inequalities with negative or fractional slopes

The shortcut “greater than means shade above, less than means shade below” works only when yy is alone with a positive coefficient. If the inequality is in another form, the shortcut can lie. Dividing by a negative number reverses the symbol, because multiplying by −1-1 reflects the number line: 2<52<5, yet −2>−5-2>-5. Forget that flip and the shading lands on the wrong side.

Graph −3y>2x+6-3y>2x+6. Divide every term by −3-3 and flip the symbol:

y<−23x−2y<-\frac{2}{3}x-2

The boundary is dashed with yy-intercept (0,−2)(0,-2). The slope is −23-\frac{2}{3}, so from (0,−2)(0,-2) go right 3 and down 2 to reach (3,−4)(3,-4), or left 3 and up 2 to reach (−3,0)(-3,0). Because yy is less than the line, shade below. Verify with the origin in the original inequality: −3(0)>2(0)+6-3(0)>2(0)+6 becomes 0>60>6, which is false. The origin lies above the line, so it should be unshaded, and it is.

Try this: Graph −2y<x−4-2y<x-4 by solving for yy first (watch the flip), then test (0,0)(0,0) in the original inequality to confirm which side you shaded.

Fractions are easier than they look. For x2+y3<1\frac{x}{2}+\frac{y}{3}<1, multiply every term by the positive number 66 to get 3x+2y<63x+2y<6. Multiplying by a positive number never flips the symbol, so clearing denominators is safe. Only negatives are dangerous.

Quick check

Solve −4y≤8x−12-4y\le 8x-12 for yy.

How do you graph x > a or y < b on the coordinate plane?

When only one variable appears, the boundary is a vertical or horizontal line. For x≤−2x\le -2, draw a solid vertical line through (−2,0)(-2,0). The other variable is unconstrained, so any yy is allowed, and the test point (−4,7)(-4,7) gives −4≤−2-4\le -2, which is true. Shade everything to the left. For y>1y>1, draw a dashed horizontal line through (0,1)(0,1) and shade above.

The trap is applying “above” and “below” to a vertical line. A vertical line has no above or below, only left and right. When xx is the variable, think left and right. When yy is the variable, think down and up.

Number line versus plane

On a number line, x≤−2x\le -2 is a ray. On the coordinate plane, the same inequality is a half-plane, because yy can be anything.

These cases also explain the sign patterns of the four quadrants. The inequalities x>0x>0 and y>0y>0 together shade exactly Quadrant I, with both axes drawn dashed.

How do you graph a system of linear inequalities?

Graph of system y at most minus x plus 4 and y greater than x minus 2 with open corner
The solid and dashed lines meet at (3,1), but the dashed line makes 1 > 1 false, so the corner is not a solution.

A system asks for points that satisfy every inequality at once. Graph each inequality with its own line style and shading, then keep only the overlap. Take y≤−x+4y\le -x+4 and y>x−2y>x-2. The first is a solid line with slope −1-1 and intercept 44, shaded below. The second is a dashed line with slope 11 and intercept −2-2, shaded above. The solution is the wedge where both shadings overlap.

The corner of the wedge is where the boundaries meet. Set them equal:

−x+4=x−2⇒2x=6⇒x=3, y=1-x+4=x-2 \quad\Rightarrow\quad 2x=6 \quad\Rightarrow\quad x=3,\ y=1

The corner is (3,1)(3,1). It lies on the dashed line y=x−2y=x-2, where 1>11>1 is false, so the corner itself is excluded even though the other line is solid. To check the region, (0,0)(0,0) gives 0≤40\le 4 and 0>−20>-2, both true, so it is inside. The point (5,0)(5,0) gives 0≤−10\le -1, which is false, so it is outside.

Systems can also have no solution. The inequalities y>x+1y>x+1 and y<x−1y<x-1 describe regions bounded by parallel lines, since both slopes equal 11, and the shadings face away from each other. They never overlap. This corner-finding skill matters later: in linear programming, the best value of a linear quantity always occurs at a corner of the region.

Quick check

Does (1,2)(1,2) satisfy both y≥1y\ge 1 and x+y<3x+y<3?

How do you check a graph and use inequalities in real life?

A reliable check uses three points. Pick one inside the shaded region, which must satisfy the inequality. Pick one clearly outside, which must fail. Then pick one on the line: it should satisfy a solid-line inequality and fail a dashed one. Thirty seconds of this catches nearly every shading and line-style error.

The same logic runs backward when you must write an inequality from a graph. Read the line style for the symbol, find the line’s equation (from the intercept and slope, from point-slope form, or from two points on the line), and read the shading for the direction. Test one shaded point to confirm.

Real constraints are inequalities. Suppose notebooks cost $3 each and pens cost $2 each, and the budget is $24. With xx notebooks and yy pens, the constraint is 3x+2y≤243x+2y\le 24, together with x≥0x\ge 0 and y≥0y\ge 0. The intercepts are (8,0)(8,0) and (0,12)(0,12), and the region is a triangle. The slope of y=−32x+12y=-\frac{3}{2}x+12 is the trade-off rate of change: each extra notebook costs 1.51.5 pens. Since you cannot buy half a pen, only whole-number points in the triangle count. The point (4,5)(4,5) costs 12+10=2212+10=22 and works, while (6,4)(6,4) costs 18+8=2618+8=26 and does not.

Practice problems

0 of 5 solved

  1. Decide whether (3,1)(3,1) is a solution of y<2x−4y<2x-4.

  2. Graph y≥12x−1y\ge \frac{1}{2}x-1. State the line type and which side is shaded.

  3. Graph 3x−2y>63x-2y>6. State the line type and which side is shaded.

  4. A solid line passes through (0,1)(0,1) and (2,5)(2,5), and the region above it is shaded. Write the inequality.

  5. Find the corner point of the solution region of y≥−x+1y\ge -x+1 and y<2x+4y<2x+4, and say whether it belongs to the solution set.

Common questions

Is the line solid or dashed for greater than or equal to?

Solid. The symbol ≥\ge includes equality, so points on the boundary line are solutions and the line is drawn as part of the region. Only the strict symbols << and >> call for a dashed line.

How do you know which side of the line to shade?

Substitute a point that is not on the line into the original inequality. If the statement is true, shade the side containing that point. If false, shade the other side.

Why does the inequality sign flip when you divide by a negative number?

Multiplying or dividing by a negative reflects numbers across zero, which reverses their order. For example, 2<52<5 but −2>−5-2>-5. Skipping the flip puts the shading on the wrong side.

Can you always use (0, 0) as the test point?

No. If the boundary line passes through the origin, the test gives an equality and settles nothing about the side. Use another point such as (1,0)(1,0) or (0,1)(0,1) instead.

What is the difference between graphing an inequality and graphing an equation?

An equation such as y=2x+1y=2x+1 is satisfied only by points on a line. An inequality such as y>2x+1y>2x+1 is satisfied by every point in a whole half-plane, so the graph needs shading as well as a line.

How do you graph two linear inequalities together?

Graph each one with its own line style and shading, then keep only the overlap. Every point in the overlap satisfies both inequalities. If the shaded regions never meet, the system has no solution.

Up next