Linear Inequalities Calculator

.calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #ddd; border-radius: 12px; background-color: #f9f9f9; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .calc-header { text-align: center; margin-bottom: 30px; } .calc-header h2 { color: #2c3e50; margin-bottom: 10px; } .input-row { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; justify-content: center; margin-bottom: 25px; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #eee; } .input-group { display: flex; flex-direction: column; } .input-group label { font-size: 14px; font-weight: 600; margin-bottom: 5px; color: #444; } .calc-input { padding: 10px; border: 2px solid #ddd; border-radius: 6px; font-size: 18px; width: 80px; text-align: center; } .calc-select { padding: 10px; border: 2px solid #ddd; border-radius: 6px; font-size: 18px; background: white; cursor: pointer; } .math-symbol { font-size: 24px; font-weight: bold; padding-top: 20px; } .calc-btn { background-color: #3498db; color: white; border: none; padding: 15px 30px; font-size: 18px; border-radius: 6px; cursor: pointer; width: 100%; transition: background 0.3s; font-weight: bold; } .calc-btn:hover { background-color: #2980b9; } .result-box { margin-top: 25px; padding: 20px; background-color: #e8f4fd; border-left: 5px solid #3498db; border-radius: 4px; display: none; } .result-box h3 { margin-top: 0; color: #2c3e50; } .step-box { background: #fff; padding: 15px; margin-top: 15px; border-radius: 5px; font-family: "Courier New", Courier, monospace; font-size: 15px; line-height: 1.6; } .article-section { margin-top: 40px; line-height: 1.6; color: #333; } .article-section h3 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 5px; margin-top: 25px; } .example-box { background: #f1f1f1; padding: 15px; border-radius: 5px; margin: 10px 0; }

Linear Inequalities Solver

Solve for x in the form ax + b [op] c

x +
<option value="< <option value="≤ ">> =">≥

Solution:

Understanding Linear Inequalities

A linear inequality is a mathematical statement that relates two expressions using an inequality symbol. Unlike linear equations, which have a specific numerical solution, linear inequalities often result in a range or "set" of values that make the statement true.

The standard form solved by this calculator is ax + b < c (or using other symbols like ≤, >, or ≥). Solving these is very similar to solving regular equations, with one crucial rule: If you multiply or divide both sides by a negative number, you must flip the inequality sign.

How to Use This Calculator

  • Coefficient (a): The number multiplied by x.
  • Constant (b): The number added to or subtracted from the x term on the left side.
  • Operator: Choose whether the left side is less than, greater than, or equal to the right side.
  • Result (c): The constant value on the right side of the inequality.

Step-by-Step Example

Example: Solve -2x + 5 > 11
  1. Subtract 5 from both sides: -2x > 6
  2. Divide by -2. Since -2 is negative, we flip the sign: x < (6 / -2)
  3. Final Result: x < -3
  4. Interval Notation: (-∞, -3)

Common Inequality Symbols

< : Less than (open circle on a graph)
: Less than or equal to (closed circle)
> : Greater than (open circle)
: Greater than or equal to (closed circle)

function solveInequality() { var a = parseFloat(document.getElementById('coeff_a').value); var b = parseFloat(document.getElementById('const_b').value); var op = document.getElementById('operator').value; var c = parseFloat(document.getElementById('const_c').value); var resultArea = document.getElementById('result_area'); var solutionText = document.getElementById('solution_text'); var stepsArea = document.getElementById('steps_area'); var intervalArea = document.getElementById('interval_notation'); if (isNaN(a) || isNaN(b) || isNaN(c)) { alert("Please enter valid numbers for all fields."); return; } resultArea.style.display = "block"; // Case where a is 0 (not a linear inequality in x) if (a === 0) { var isTrue = false; if (op === "<") isTrue = b < c; else if (op === "<=") isTrue = b ") isTrue = b > c; else if (op === ">=") isTrue = b >= c; if (isTrue) { solutionText.innerHTML = "All Real Numbers"; stepsArea.innerHTML = "Step 1: 0x + " + b + " " + op + " " + c + "Step 2: " + b + " " + op + " " + c + " is always TRUE.Result: x can be any value."; intervalArea.innerHTML = "Interval: (-∞, ∞)"; } else { solutionText.innerHTML = "No Solution"; stepsArea.innerHTML = "Step 1: 0x + " + b + " " + op + " " + c + "Step 2: " + b + " " + op + " " + c + " is always FALSE.Result: No value of x satisfies this."; intervalArea.innerHTML = "Interval: ∅"; } return; } // Step 1: Subtract b var rhs = c – b; var step1 = a + "x " + op + " " + rhs + " (Subtracted " + b + " from both sides)"; // Step 2: Divide by a var finalVal = rhs / a; finalVal = Math.round(finalVal * 1000) / 1000; // Round to 3 decimals var finalOp = op; var flipMsg = ""; if (a < 0) { flipMsg = "Note: Inequality sign flipped because we divided by a negative number (" + a + ")."; if (op === ""; else if (op === "="; else if (op === ">") finalOp = "=") finalOp = "<="; } solutionText.innerHTML = "x " + finalOp + " " + finalVal; stepsArea.innerHTML = "Step 1: " + step1 + "Step 2: x " + finalOp + " " + rhs + " / " + a + flipMsg; // Interval Notation var interval = ""; if (finalOp === "<") interval = "(-∞, " + finalVal + ")"; else if (finalOp === "") interval = "(" + finalVal + ", ∞)"; else if (finalOp === ">=") interval = "[" + finalVal + ", ∞)"; intervalArea.innerHTML = "Interval Notation: " + interval; }

Leave a Comment