Linear Inequalities & System of Inequalities (2 Variables) Calculator
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.
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
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)
- 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 <, >.
- Choose a test point M0 ∉ d: the origin O(0, 0) when c ≠ 0, otherwise (0, 1) or (1, 0).
- Substitute the test point into ax + by and compare with c.
- 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).
| Sign | Boundary line | Points on the line |
|---|---|---|
| ≤, ≥ | Solid | Included (closed half-plane) |
| <, > | Dashed | Excluded (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.
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.
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.
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:
- Graph every inequality on the same axes and hatch out the half-plane it rejects.
- 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.
- 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 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.
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:
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.
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.
- Define the variables, write the constraints and the objective function.
- Graph the feasible region and find its corner points.
- 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
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 point | O(0, 0) | A(8, 0) | B(6, 2) | C(0, 6) |
|---|---|---|---|---|
| F = 3x + 4y | 0 | 24 | 26 | 24 |
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.
Practice problems (with answers)
- y − 2x ≤ 2: solid boundary through (−1, 0) and (0, 2); the origin satisfies 0 ≤ 2, so shade the side containing O.
- 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.
- x + 3y ≥ 0: c = 0, so the boundary passes through O and (3, −1); test (0, 1): 3 ≥ 0 is true.
- 3x − 2y < 6: dashed boundary through (2, 0) and (0, −3); 0 < 6 is true, so keep the side containing O.
Common mistakes
- Wrong line style: a solid line for <, > or a dashed line for ≤, ≥. Boundary points are solutions only with an equality sign.
- Testing the origin when it lies on the line (c = 0). Use (0, 1) or (1, 0) instead.
- 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.
- Forgetting to reverse the sign when dividing by a negative number to write y ≥ … or x ≤ ….
- Accepting an intersection point that violates another constraint as a corner point.
- Reporting a maximum on an unbounded region without checking whether F grows without bound.
🎯 Practice quiz: linear inequalities and systems of inequalities in two variables
Ten multiple-choice questions with four options each, following the theory above section by section: the definition, the boundary line style, choosing a test point, finding the solution half-plane, vertical boundaries, solutions and corner points of a system, optimizing F(x, y) = ax + by, writing constraints from a word problem and unbounded feasible regions. Pick an answer: the correct option turns green, a wrong one turns red, and the solution appears right below with a ⚠️ Trap note explaining why the distractors are tempting. You can enter any inequality or system from a question into the calculator above to check it on the graph.
1️⃣ Definition Question 1. Which of the following is a linear inequality in two variables:
Correct answer: B. x − 4y > 1
A linear inequality in two variables has the form ax + by < c (or >, ≤, ≥), where a and b are not both zero and x, y appear only to the first power and are never multiplied together.
Enter a = 1, b = −4, c = 1 with the sign > in the Single Inequality tab above to see its solution region.
⚠️ Trap
- A: the term y² makes it quadratic in y.
- C: xy is a product of the two variables, a term of degree 2.
- D: a = b = 0, which breaks the condition that a and b are not both zero; the left side is always 0, so this is just the statement 0 < 3.
2️⃣ Boundary line style Question 2. When graphing the inequality x − 2y < 4, how is the boundary line d: x − 2y = 4 drawn:
Correct answer: A. Dashed; points on d are not solutions
The sign < is strict. A point on d gives x − 2y = 4, and 4 < 4 is false, so it is not a solution. The solution set is therefore an open half-plane and d is drawn dashed.
General rule: ≤, ≥ give a solid line (boundary included); <, > give a dashed line (boundary excluded). Change the sign in the calculator above to watch the line style switch.
⚠️ Trap
- B: correct for x − 2y ≤ 4, not for the strict sign <.
- C, D: the line style and whether the boundary is included always go together: dashed means excluded, solid means included. These two options contradict themselves.
3️⃣ Choosing the test point Question 3. To graph the inequality 3x + 2y ≥ 0 with the test point method, which test point should you use:
Correct answer: C. (1, 0)
The test point must not lie on the boundary line d: 3x + 2y = 0. Here c = 0, so d passes through the origin; (2, −3) and (−2, 3) also give 3x + 2y = 0, so they lie on d as well.
Use M0(1, 0): 3·1 + 2·0 = 3 ≠ 0, so it is off the line. Since 3 ≥ 0 is true, the solution set is the closed half-plane containing (1, 0).
⚠️ Trap
- A: the origin is a good test point only when c ≠ 0. Substituting it gives 0 ≥ 0, which is true but says nothing about either side, because O lies on the line.
- B, D: 3·2 + 2·(−3) = 0 and 3·(−2) + 2·3 = 0, so both points lie on d. They help you draw the line but cannot serve as test points.
4️⃣ Solution half-plane Question 4. The solution set of the inequality 3x − 2y > 6 is the half-plane bounded by d: 3x − 2y = 6 that:
Correct answer: D. does not contain the origin, boundary excluded
Follow the four steps:
- d meets the x-axis at (2, 0) and the y-axis at (0, −3). The sign > is strict, so draw d dashed.
- c = 6 ≠ 0, so test the origin O(0, 0).
- Substitute: 3·0 − 2·0 = 0, and 0 > 6 is false.
- The solution set is the half-plane that does not contain O, with the boundary excluded.
Check with a point on the other side, for example (3, 0): 9 > 6 is true. To practise finding the intercepts of a line, try the equation of a line calculator.
⚠️ Trap
- A, B: substituting O gives 0 > 6, which is false, so O is on the hatched side. The solution region does not always contain the origin.
- C: right side, but > is strict; a point on d gives 6 > 6, which is false, so the boundary is excluded.
5️⃣ Vertical boundary, reversing the sign Question 5. The inequality −4x < 8 has the same solution region as which inequality:
Correct answer: A. x > −2
This is still a linear inequality in two variables, with a = −4 and b = 0. Dividing both sides by the negative number −4 reverses the inequality sign:
The boundary x = −2 is a vertical line, drawn dashed; the solution set is the open half-plane to its right. Testing O: −4·0 = 0 < 8 is true, and O is indeed to the right of x = −2.
⚠️ Trap
- B: forgetting to reverse the sign when dividing by a negative number, mistake 4 in the Common mistakes list.
- C: sign reversed correctly, but an equality was added; −4x < 8 is strict, so x = −2 is not a solution.
- D: b = 0, so the inequality only restricts x; the boundary is a vertical line, not a horizontal one.
6️⃣ Solutions of a system Question 6. Which point lies in the feasible region of the system x ≥ 0, y ≥ 0, x + 2y ≤ 10, 3x + y ≤ 15:
Correct answer: B. (2, 4)
The feasible region is the intersection of the half-planes, just like the intersection of two sets: a point belongs to it exactly when it satisfies every inequality. For (2, 4):
(2, 4) lies exactly on the line x + 2y = 10, but the sign ≤ includes equality, so the boundary belongs to the region. This is the system of Example 2 above, whose feasible region is the quadrilateral OABC.
⚠️ Trap
- A (5, 1): x + 2y = 7 ≤ 10 holds, but 3·5 + 1 = 16 > 15. Violating a single constraint is enough to rule a point out.
- C (−1, 2): violates x ≥ 0, even though the other two inequalities hold.
- D (1, 5): 1 + 2·5 = 11 > 10.
7️⃣ Corner points Question 7. Consider the system x ≥ 0, y ≥ 0, 2x + y ≤ 8, x + 3y ≤ 9. Which point is not a corner point of its feasible region:
Correct answer: D. (9, 0)
A corner point is an intersection of two boundary lines that also satisfies the whole system. (9, 0) is where the x-axis meets x + 3y = 9, but
so it violates 2x + y ≤ 8 and is rejected. Solving 2x + y = 8 together with x + 3y = 9 gives x = 3, y = 2 (you can check it with the system of linear equations calculator). The feasible region is a quadrilateral with corners O(0, 0), A(4, 0), B(3, 2) and C(0, 3). Enter this system in the System & Linear Programming tab to see every pair of lines, including the rejected intersections.
⚠️ Trap
- A (4, 0): the x-axis meets 2x + y = 8 here; 4 + 3·0 = 4 ≤ 9, so it is a genuine corner.
- B (3, 2): the intersection of the two slanted lines satisfies every constraint. This is the corner most often missed.
- C (0, 3): the y-axis meets x + 3y = 9 here; 2·0 + 3 = 3 ≤ 8, so it is a corner. By contrast, (0, 8), where the y-axis meets 2x + y = 8, is rejected because 0 + 3·8 = 24 > 9.
8️⃣ Maximum of F(x, y) on a polygon Question 8. The maximum of F(x, y) = 3x + 2y over the feasible region of x ≥ 0, y ≥ 0, 2x + y ≤ 8, x + 3y ≤ 9 is:
Correct answer: A. 13
By the Corner Point Theorem, the maximum of F over a bounded convex polygon occurs at a corner point. The feasible region is the quadrilateral OABC from the previous question, so evaluate F at its four corners:
| Corner point | O(0, 0) | A(4, 0) | B(3, 2) | C(0, 3) |
|---|---|---|---|---|
| F = 3x + 2y | 0 | 12 | 13 | 6 |
The maximum is 13, reached at B(3, 2). Tick the optimization option in the calculator and enter F = 3x + 2y to see this table with B circled on the graph.
⚠️ Trap
- B (12): only the corners on the axes were checked; B(3, 2), where the two slanted lines meet, was missed.
- C (27): F was evaluated at (9, 0), an intersection rejected because it violates 2x + y ≤ 8.
- D (16): F was evaluated at (0, 8), also rejected because 0 + 3·8 = 24 > 9.
9️⃣ Writing constraints from a word problem Question 9. A bakery makes two kinds of cake. Each batch of cake I needs 2 kg of flour and 1 kg of sugar; each batch of cake II needs 1 kg of flour and 3 kg of sugar. The bakery has at most 10 kg of flour and 12 kg of sugar. Let x and y be the numbers of batches of cake I and cake II. Which system describes the constraints:
Correct answer: B. x ≥ 0, y ≥ 0, 2x + y ≤ 10, x + 3y ≤ 12
Write one inequality per ingredient:
- Flour: x batches of cake I use 2x kg and y batches of cake II use y kg, at most 10 kg in total: 2x + y ≤ 10.
- Sugar: x + 3y ≤ 12.
- The numbers of batches cannot be negative: x ≥ 0, y ≥ 0.
This is step 1 of solving a linear programming problem. Enter the system in the calculator to see that the feasible region is a quadrilateral with corners O(0, 0), (5, 0), (18/5, 14/5) and (0, 4).
⚠️ Trap
- A: “at most” means ≤, not ≥.
- C: the limits are swapped: 10 kg is the flour supply, so it belongs with the flour expression 2x + y.
- D: the conditions x ≥ 0, y ≥ 0 are missing. Without them the feasible region would contain points with a negative number of batches.
🔟 Unbounded feasible region Question 10. Consider F(x, y) = 2x + 3y over the feasible region of the system x ≥ 0, y ≥ 0, x + y ≥ 4. Which statement is true:
Correct answer: C. The minimum of F is 8, at (4, 0), and F has no maximum
The feasible region is the part of the first quadrant above the line x + y = 4. It is unbounded and has two corner points, (4, 0) and (0, 4), where F(4, 0) = 8 and F(0, 4) = 12.
- Minimum: for every point of the region, F = 2x + 3y ≥ 2(x + y) ≥ 8, with equality at (4, 0). So the minimum is 8.
- Maximum: every point (0, t) with t ≥ 4 lies in the region and F = 3t grows without bound, so F has no maximum.
The idea is the same as finding the maximum and minimum values of a function in calculus: you must also check where the expression can grow or decrease without limit.
⚠️ Trap
- A: comparing the corner values as if the region were a bounded polygon, forgetting that it is unbounded in a direction where F increases (mistake 6 in the Common mistakes list).
- B: O(0, 0) is not in the region, because 0 + 0 = 0 ≥ 4 is false.
- D: 12 is the value at the corner (0, 4), which is larger than F(4, 0) = 8, so it cannot be the minimum.
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.
🔗 Related tools
- System of linear equations calculator: find where two boundary lines intersect
- Equation of a line calculator: standard, slope-intercept and parametric form
- Set operations calculator: union, intersection, difference and complement
- Linear equation calculator ax + b = 0 with steps
- Domain of a function calculator: solving conditions with inequalities
- Maximum and minimum value calculator on an interval
- Fraction calculator: simplify and compute with fractions (exact corner coordinates)