Linear Inequalities & System of Inequalities (2 Variables) Calculator

Linear Inequalities & System of Inequalities (2 Variables) Calculator ax + by ≤ c

Enter the coefficients (integers, decimals or fractions p/q). The calculator draws each boundary line, uses a test point to pick the solution half-plane, hatches the rejected region, finds the corner points of the feasible region and the maximum and minimum of F(x, y) = ax + by, step by step.

Linear inequality in two variables

x +y

Pick ≤, ≥, < or >. Coefficients a and b cannot both be 0.

Textbook examples (click to solve):

The calculator above graphs linear inequalities in two variables and systems of linear inequalities, and solves small linear programming problems. It has two modes:

  • Single Inequality ax + by ≤ c (or ≥, <, >): it draws the boundary line, substitutes a test point, picks the solution half-plane and hatches out the rejected side.
  • System & Linear Programming: enter 2 to 8 inequalities. The tool shades the feasible region, solves every pair of boundary lines to find the corner points (vertices), keeps the ones that satisfy the whole system and, if you tick the option, evaluates the objective function F(x, y) = ax + by at each corner to find its maximum and minimum.

Coefficients may be integers, decimals or fractions such as 1/3, and every corner point is computed exactly as a reduced fraction. The sample buttons follow the numbering of the Vietnamese Grade 10 textbook (Kết nối tri thức series), whose examples are worked out below.

Linear inequalities in two variables

A linear inequality in two variables x and y has one of the forms

ax + by < c, ax + by > c, ax + by ≤ c, ax + by ≥ c

where a, b, c are real numbers and a and b are not both zero. An ordered pair (x0, y0) that makes the inequality true is a solution. The set of all solutions, drawn as points of the coordinate plane, is the solution region (or graph) of the inequality.

For example, (50, 60) solves 2x + y < 200 because 2·50 + 60 = 160 < 200, while (100, 10) does not because 210 > 200. A linear inequality has infinitely many solutions, so we describe them with a picture rather than a list.

Half-planes: why one test point is enough

Half-plane theorem. The line d: ax + by = c divides the plane into two open half-planes. Every point of one of them satisfies ax + by > c, and every point of the other satisfies ax + by < c.

The reason is that f(x, y) = ax + by − c is zero only on d; moving between two points on the same side without crossing d, f changes continuously and never passes through 0, so its sign stays the same. Consequently:

  • the graph of a strict inequality (< or >) is an open half-plane: the boundary line is dashed;
  • the graph of a non-strict inequality (≤ or ≥) is a closed half-plane: the boundary line is solid;
  • testing a single point not on d tells you which half-plane is the solution set.

How to graph a linear inequality (test point method)

  1. Draw the boundary line ax + by = c through its intercepts: y = 0 gives x = c/a, x = 0 gives y = c/b. If c = 0 the line passes through the origin, so use a second point such as (−b, a). Use a solid line for ≤, ≥ and a dashed line for <, >.
  2. Choose a test point M0 ∉ d: the origin O(0, 0) when c ≠ 0, otherwise (0, 1) or (1, 0).
  3. Substitute the test point into ax + by and compare with c.
  4. Conclude: if the statement is true, the solution set is the half-plane containing M0; if false, it is the other half-plane. Following the Vietnamese textbook convention, the calculator hatches out the rejected half-plane and leaves the solution set clear (tinted blue).
SignBoundary linePoints on the line
≤, ≥SolidIncluded (closed half-plane)
<, >DashedExcluded (open half-plane)

Worked examples: single inequalities

Example 3: x + y ≥ 100

The boundary x + y = 100 meets the axes at A(100, 0) and B(0, 100); the sign ≥ means a solid line. Since c = 100 ≠ 0, test the origin: 0 + 0 = 0 and 0 ≥ 100 is false. The solution set is the closed half-plane that does not contain the origin, i.e. y ≥ −x + 100, the region above the line.

Graph of the solution region on the Oxy plane−2020406080−2020406080100120140xyd: x + y = 100A(100, 0)B(0, 100)M₀ ≡ O
x + y ≥ 100: the solid line d is included; the half-plane containing O is hatched out.

Example 4: 5x − 7y ≤ 0

Here c = 0, so the boundary 5x − 7y = 0 passes through the origin; x = 7 gives y = 5, so it also passes through A(7, 5). The origin cannot be the test point, so use M0(0, 1): 5·0 − 7·1 = −7 and −7 ≤ 0 is true. The solution set is the closed half-plane containing (0, 1), the region above y = (5/7)x.

Graph of the solution region on the Oxy plane−2−1123456789−2−11234567xyOd: 5x − 7y = 0A(7, 5)M₀(0, 1)
5x − 7y ≤ 0: the line passes through O, so the test point is M₀(0, 1).

Practice 2: 2x + y < 200

The boundary 2x + y = 200 has intercepts A(100, 0) and B(0, 200). The inequality is strict, so the line is dashed. Testing O: 0 < 200 is true, so the solution set is the open half-plane containing the origin, the region below the line. Points on the line itself, such as (100, 0), are not solutions.

Graph of the solution region on the Oxy plane−20204060801404080120160200xyd: 2x + y = 200A(100, 0)B(0, 200)M₀ ≡ O
2x + y < 200: the boundary is dashed because the inequality is strict.

Example: a vertical boundary, −3x ≤ 6

With a = −3 and b = 0 this is still a linear inequality in two variables. The boundary −3x = 6 is the vertical line x = −2. Testing O: 0 ≤ 6 is true, so the solution set is the closed half-plane to the right of x = −2, i.e. x ≥ −2. Remember to reverse the inequality sign when dividing both sides by a negative number.

Systems of linear inequalities and the feasible region

A system of linear inequalities in x and y is a set of linear inequalities that must hold at the same time. Its solution set, called the feasible region, is the intersection of the half-planes of the individual inequalities. To graph it:

  1. Graph every inequality on the same axes and hatch out the half-plane it rejects.
  2. The part of the plane left unhatched is the feasible region. In most problems it is a convex polygon (bounded region) or an unbounded region.
  3. Find the corner points: each vertex is the intersection of two boundary lines. Solve the 2×2 linear system for every pair of lines and keep only the intersection points that satisfy every inequality of the system. The calculator lists every pair, including parallel lines and rejected intersections.

Example 1: the triangle OAB

x ≥ 0, y ≥ 0, x + y ≤ 150

x ≥ 0 keeps the right of the y-axis, y ≥ 0 keeps the part above the x-axis, and x + y ≤ 150 keeps the side of x + y = 150 containing the origin. The pairwise intersections O(0, 0), A(150, 0) and B(0, 150) all satisfy the system, so the feasible region is the triangle OAB, edges included.

Graph of the solution region on the Oxy plane306090120306090120150xyd₁: x = 0d₂: y = 0d₃: x + y = 150O(0, 0)A(150, 0)B(0, 150)
The feasible region is the triangle OAB (edges included).

Example 2: a production system

A workshop makes products I and II. Each unit of I needs 1 hour on machine M1 and 3 hours on M2; each unit of II needs 2 hours on M1 and 1 hour on M2. M1 runs at most 10 hours and M2 at most 15 hours a day. With x, y units of I and II per day:

x ≥ 0, y ≥ 0, x + 2y ≤ 10, 3x + y ≤ 15

Solving x + 2y = 10 with 3x + y = 15 gives B(4, 3). The other corners are O(0, 0), A(5, 0) and C(0, 5). The intersection (10, 0) is rejected because 3·10 + 0 = 30 > 15, and (0, 15) is rejected because 0 + 2·15 = 30 > 10. The feasible region is the quadrilateral OABC.

Graph of the solution region on the Oxy plane12348910248101214xyd₁: x = 0d₂: y = 0d₃: x + 2y = 10d₄: 3x + y = 15O(0, 0)A(5, 0)B(4, 3)C(0, 5)
The feasible region is the quadrilateral OABC.

Linear programming and the Corner Point Theorem

A linear programming problem asks for the maximum or minimum of a linear objective function F(x, y) = ax + by over the feasible region of a system of linear constraints.

Corner Point Theorem. If the feasible region is a bounded convex polygon (edges included), the maximum and the minimum of F both exist and each occurs at a corner point. If two adjacent corners give the same optimal value, every point of the edge joining them is optimal too.

For an unbounded feasible region, an optimum may not exist: if the region extends without limit in a direction along which F increases, F has no maximum (and similarly for the minimum). When the optimum does exist, it still occurs at a corner point. The calculator checks these directions exactly and tells you which case applies.

  1. Define the variables, write the constraints and the objective function.
  2. Graph the feasible region and find its corner points.
  3. Evaluate F at every corner point; the largest value is the maximum and the smallest is the minimum.

Example 3: maximizing profit

A farmer plans to grow beans and eggplants on at most 8 hectares. One hectare of beans needs 20 workdays and earns a profit of 3 million VND; one hectare of eggplants needs 30 workdays and earns 4 million VND. At most 180 workdays are available. With x, y hectares of beans and eggplants, maximize F(x, y) = 3x + 4y subject to

x ≥ 0, y ≥ 0, x + y ≤ 8, 20x + 30y ≤ 180

The feasible region is the quadrilateral OABC with O(0, 0), A(8, 0), B(6, 2) (where x + y = 8 meets 2x + 3y = 18) and C(0, 6):

Corner pointO(0, 0)A(8, 0)B(6, 2)C(0, 6)
F = 3x + 4y0242624

The maximum profit is 26 million VND, reached by planting 6 hectares of beans and 2 hectares of eggplants. Press “Example 3: Profit optimization” in the calculator to see this table with B circled in green on the graph.

Graph of the solution region on the Oxy plane1234567−1123456789xyd₁: x = 0d₂: y = 0d₃: x + y = 8d₄: 20x + 30y = 180O(0, 0)A(8, 0)B(6, 2): max F = 26C(0, 6)
Quadrilateral OABC; F = 3x + 4y is largest at the corner B(6, 2).

Practice problems (with answers)

  1. y − 2x ≤ 2: solid boundary through (−1, 0) and (0, 2); the origin satisfies 0 ≤ 2, so shade the side containing O.
  2. 2x + y > 4: dashed boundary through (2, 0) and (0, 4); 0 > 4 is false, so the solution set is the side away from O.
  3. x + 3y ≥ 0: c = 0, so the boundary passes through O and (3, −1); test (0, 1): 3 ≥ 0 is true.
  4. 3x − 2y < 6: dashed boundary through (2, 0) and (0, −3); 0 < 6 is true, so keep the side containing O.

Common mistakes

  1. Wrong line style: a solid line for <, > or a dashed line for ≤, ≥. Boundary points are solutions only with an equality sign.
  2. Testing the origin when it lies on the line (c = 0). Use (0, 1) or (1, 0) instead.
  3. Mixing up shading conventions: this calculator (like the Vietnamese textbook) hatches the rejected side; many US textbooks shade the solution side instead. Always read the legend.
  4. Forgetting to reverse the sign when dividing by a negative number to write y ≥ … or x ≤ ….
  5. Accepting an intersection point that violates another constraint as a corner point.
  6. Reporting a maximum on an unbounded region without checking whether F grows without bound.

Frequently asked questions

When is the boundary line solid and when is it dashed?

For ≤ or ≥ the points on the boundary line are solutions, so the line is solid. For < or > (strict inequalities) the points on the line are not solutions, so the line is dashed.

Why is the origin usually chosen as the test point?

When c ≠ 0 the origin (0, 0) is not on the line ax + by = c, and substituting it is trivial because the left-hand side becomes 0. When c = 0 the line passes through the origin, so a different point such as (0, 1) or (1, 0) must be used.

What is the feasible region of a system of linear inequalities?

It is the intersection of the half-planes of all the inequalities, i.e. the set of points that satisfy every inequality at once. It is usually a convex polygon, but it can also be unbounded or empty.

How do you find the corner points of the feasible region?

Each corner point is the intersection of two boundary lines. Solve the pair of linear equations for every two lines, then check each intersection against all inequalities; only the points that satisfy every constraint are corner points.

What does the Corner Point Theorem say?

If the feasible region is a bounded convex polygon, the maximum and minimum of a linear objective function F(x, y) = ax + by occur at corner points. Evaluate F at every corner and compare the values. On an unbounded region the maximum or minimum may not exist.

Can I enter fractions, decimals or a system with no solution?

Yes. Coefficients may be integers, decimals or fractions p/q, and corner points are computed exactly as reduced fractions. If no point satisfies every inequality, the calculator reports that the system has no solution and the whole plane is hatched.