Graphing Inequalities Calculator

Enter a linear inequality to visualize it on a number line.

Supports simple (e.g., x < 2) and compound (e.g., -3 <= y < 3) inequalities.

Enter a simple or compound inequality.

Examples

Click on an example to see how different inequalities are graphed.

Simple Inequality (Greater Than)

simple

A simple inequality with a variable greater than a number.

Inequality: x > 2

Simple Inequality (Less Than or Equal To)

simple

A simple inequality where the variable is less than or equal to a number.

Inequality: y <= -1

Compound Inequality (AND)

compound

A compound inequality representing a range between two numbers.

Inequality: -3 < z <= 4

Compound Inequality (OR - Not Supported Yet)

compound

A compound inequality representing two separate ranges (Note: OR conditions are complex and will be supported in a future version).

Inequality: x < -2 or x > 2

Other Titles
Understanding the Graphing Inequalities on a Number Line Calculator: A Comprehensive Guide
A deep dive into the concepts, applications, and mathematics behind graphing inequalities.

What is Graphing Inequalities on a Number Line?

  • Representing a range of solutions visually
  • The role of boundary points and intervals
  • Distinguishing between strict and inclusive inequalities
Graphing an inequality on a number line is a way to visually represent all the possible solutions to that inequality. Unlike an equation, which typically has one or a few specific solutions, an inequality represents an entire range of numbers. The number line graph makes this abstract concept concrete and easy to understand.
Key Components of the Graph
A graph of an inequality has two main components: the boundary point(s) and the shaded region. The boundary point, marked with a circle, is the number from the inequality. The shaded region, represented by an arrow, indicates the direction of all the numbers that are valid solutions.
A critical distinction is made between strict inequalities (<, >) and inclusive inequalities (<=, >=). Strict inequalities use an open circle (○) to show the boundary point is not a solution, while inclusive inequalities use a closed circle (●) to show it is a solution.

Visual Examples

  • x > 1: An open circle at 1, with shading to the right.
  • x <= -2: A closed circle at -2, with shading to the left.

Step-by-Step Guide to Using the Calculator

  • Entering your inequality correctly
  • Interpreting the visual graph
  • Understanding the interval notation
Our calculator is designed for simplicity and accuracy. Follow these steps to get your result:
1. Input the Inequality
In the 'Inequality' input field, type the complete mathematical expression. The calculator is flexible and can parse various formats. For example, you can enter 'x > 5', 'y <= -1.5', or a compound inequality like '-3 < z <= 3'.
2. Interpret the Graph
After clicking 'Graph Inequality', the tool will generate a number line. Observe the circle at the boundary point: an open circle (○) means the point is not included, while a closed circle (●) means it is. The arrow indicates the range of all possible solutions.
3. Read the Interval Notation
The calculator also provides the solution in interval notation. Parentheses, like ( or ), are used for exclusive boundaries (corresponding to open circles), and square brackets, like [ or ], are for inclusive boundaries (corresponding to closed circles). The symbol for infinity (∞) always uses a parenthesis.

Input and Output Examples

  • Input: 'x >= 0' -> Output Graph: Closed circle at 0, arrow to the right. Interval: [0, ∞)
  • Input: '-10 < y < -2' -> Output Graph: Open circles at -10 and -2, shading in between. Interval: (-10, -2)

Real-World Applications of Inequalities

  • Managing budgets and finance
  • Following regulations and safety standards
  • Optimizing processes in science and engineering
Inequalities are not just an academic exercise; they are used to model constraints and limits in the real world.
Finance and Budgeting
If you have a gift card with $50, the amount you can spend, 's', is represented by the inequality 0 <= s <= 50. This defines the acceptable range for your spending.
Speed Limits
A sign that says 'Speed Limit 65' means your speed 'v' must be v <= 65. A minimum speed limit might create a compound inequality, like 45 <= v <= 65.
Engineering and Science
In manufacturing, a component's length 'L' might need to be within a certain tolerance, such as 4.98 cm <= L <= 5.02 cm. In chemistry, the pH of a solution might need to be kept within a certain range for a reaction to occur, for example, pH < 7 for an acidic solution.

Scenario Examples

  • Temperature for water to be liquid: 0 < T < 100 (Celsius)
  • Age to vote in the US: Age >= 18

Common Misconceptions and Correct Methods

  • Confusing the direction of the inequality
  • Incorrectly using open vs. closed circles
  • Misinterpreting compound inequalities
Avoiding common pitfalls is key to mastering inequalities.
Misconception 1: Flipping the Sign
A very common error is forgetting to flip the inequality symbol when multiplying or dividing both sides by a negative number. For example, to solve -2x < 6, you must divide by -2 and flip the symbol, resulting in x > -3.
Misconception 2: Circle Type
Always remember the rule: '<' and '>' use open circles (○). '<=' and '>=' use closed circles (●). This indicates whether the boundary point itself is part of the solution set.
Misconception 3: Compound 'AND' vs 'OR'
An 'AND' inequality like -2 < x < 5 represents a single, continuous interval where x must satisfy both conditions simultaneously. An 'OR' inequality like x < -2 or x > 5 represents two separate, disconnected intervals. Our calculator currently focuses on 'AND' compound inequalities as they are more common in introductory algebra.

Mistake vs. Correction

  • Solving -3x >= 9: Incorrectly gives x >= -3. Correctly gives x <= -3.
  • Graphing x < 5: Incorrectly using a closed circle. Correctly use an open circle.

Mathematical Derivation and Formulas

  • The logic of parsing inequality strings
  • Converting inequalities to interval notation
  • Generating the number line data
The calculator works by parsing the input string into a structured format that can be mathematically evaluated.
1. Parsing Logic
The tool first uses regular expressions to identify the variable, the inequality operator(s), and the numerical value(s). For a simple inequality like 'x >= 5', it extracts { variable: 'x', operator: '>=', value: 5 }. For a compound one like '-2 < y <= 10', it extracts { value1: -2, operator1: '<', variable: 'y', operator2: '<=', value2: 10 }.
2. Conversion to Interval Notation
Once parsed, the data is converted to interval notation based on these rules:
  • '>' corresponds to (value, ∞)
  • '>=' corresponds to [value, ∞)
  • '<' corresponds to (-∞, value)
  • '<=' corresponds to (-∞, value]
  • 'a < x < b' corresponds to (a, b)
  • 'a <= x <= b' corresponds to [a, b]
  • 'a < x <= b' corresponds to (a, b]
  • 'a <= x < b' corresponds to [a, b)
3. Generating Graph Data
Finally, the tool generates data for the visual graph. It determines the boundary points and whether each requires an open or closed circle. It then defines the shaded segment(s). For example, for 'x > 5', it creates a data object like { points: [{value: 5, type: 'open'}], segments: [{start: 5, end: 'infinity'}] }. This data is then used by a rendering component to draw the final graph.

Behind the Scenes

  • Input: 'x <= 100' -> Parsed: {var: 'x', op: '<=', val: 100} -> Interval: (-∞, 100] -> Graph: {points: [{val: 100, type: 'closed'}], segments: [{start: -∞, end: 100}]}
  • Input: '-5 < t < 5' -> Parsed: {val1: -5, op1: '<', ..., val2: 5} -> Interval: (-5, 5) -> Graph: {points: [{val: -5, type: 'open'}, {val: 5, type: 'open'}], segments: [{start: -5, end: 5}]}