Linear Inequality Graph Analyzer
Enter the coefficients and constant for a linear inequality in the form Ax + By < D (or ≤, >, ≥) to analyze its graph. The calculator will determine the boundary line equation, its slope, y-intercept, line type (solid or dashed), and the shading region.
0 ' + operator + ' ' + constantD + '.' +
'The entire coordinate plane satisfies the inequality.';
} else {
resultDiv.innerHTML = 'Result:' +
'This inequality simplifies to 0 ' + operator + ' ' + constantD + '.' +
'No points satisfy the inequality (empty set).';
}
return;
}
// Case 1: Vertical Line (B = 0)
if (coeffB === 0) {
if (coeffA === 0) { // Should be caught by A=0, B=0 case, but for robustness
resultDiv.innerHTML = 'Invalid inequality: Both A and B cannot be zero unless D is also zero.';
return;
}
var xIntercept = constantD / coeffA;
boundaryLineEq = 'x = ' + xIntercept.toFixed(2);
slope = 'Undefined';
yIntercept = 'None';
if (coeffA > 0) {
if (operator === '>' || operator === '>=') {
shadingRegion = 'To the right of the line.';
examplePoint = '(' + (xIntercept + 1).toFixed(2) + ', 0)';
} else { // < or <=
shadingRegion = 'To the left of the line.';
examplePoint = '(' + (xIntercept – 1).toFixed(2) + ', 0)';
}
} else { // coeffA ' || operator === '>=') { // Ax > D becomes x < D/A
shadingRegion = 'To the left of the line.';
examplePoint = '(' + (xIntercept – 1).toFixed(2) + ', 0)';
} else { // Ax D/A
shadingRegion = 'To the right of the line.';
examplePoint = '(' + (xIntercept + 1).toFixed(2) + ', 0)';
}
}
}
// Case 2: Horizontal Line (A = 0) or General Case (A != 0, B != 0)
else {
var m = -coeffA / coeffB;
var b = constantD / coeffB;
slope = m.toFixed(2);
yIntercept = b.toFixed(2);
boundaryLineEq = 'y = ' + slope + 'x';
if (b >= 0) {
boundaryLineEq += ' + ' + yIntercept;
} else {
boundaryLineEq += ' – ' + Math.abs(yIntercept).toFixed(2);
}
// Determine shading region
if (coeffB > 0) {
if (operator === '>' || operator === '>=') {
shadingRegion = 'Above the line.';
examplePoint = '(0, ' + (b + 1).toFixed(2) + ')';
} else { // < or <=
shadingRegion = 'Below the line.';
examplePoint = '(0, ' + (b – 1).toFixed(2) + ')';
}
} else { // coeffB ' || operator === '>=') { // By > D becomes y < D/B
shadingRegion = 'Below the line.';
examplePoint = '(0, ' + (b – 1).toFixed(2) + ')';
} else { // By D/B
shadingRegion = 'Above the line.';
examplePoint = '(0, ' + (b + 1).toFixed(2) + ')';
}
}
}
resultDiv.innerHTML = 'Analysis for: ' + coeffA + 'x + ' + coeffB + 'y ' + operator + ' ' + constantD + '' +
'Boundary Line Equation: ' + boundaryLineEq + '' +
'Slope (m): ' + slope + " +
'Y-intercept (b): ' + yIntercept + " +
'Line Type: ' + lineType + " +
'Shading Region: ' + shadingRegion + " +
'Example Point (satisfies inequality): ' + examplePoint + ";
}
.inequality-calculator-wrapper {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
border: 1px solid #ddd;
padding: 20px;
border-radius: 8px;
max-width: 600px;
margin: 20px auto;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.inequality-calculator-wrapper h2 {
text-align: center;
color: #333;
margin-top: 0;
margin-bottom: 15px;
}
.inequality-calculator-wrapper p {
line-height: 1.6;
color: #555;
margin-bottom: 10px;
}
.calculator-inputs {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-bottom: 20px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.input-group input[type="number"],
.input-group select {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
width: 100%;
box-sizing: border-box;
}
.calculator-inputs button {
grid-column: span 2;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.calculator-inputs button:hover {
background-color: #0056b3;
}
.calculator-result {
background-color: #e9f7ef;
border: 1px solid #d4edda;
padding: 15px;
border-radius: 4px;
color: #155724;
min-height: 100px;
}
.calculator-result p {
margin: 5px 0;
color: #155724;
}
.calculator-result p strong {
color: #0a3614;
}
.calculator-result .error {
color: #721c24;
background-color: #f8d7da;
border-color: #f5c6cb;
padding: 10px;
border-radius: 4px;
}
code {
background-color: #eee;
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
}
Understanding Linear Inequality Graphs
Linear inequalities are mathematical statements that compare two expressions using an inequality symbol (<, ≤, >, ≥). Unlike linear equations, which represent a single line on a graph, linear inequalities represent a region of the coordinate plane.
The Anatomy of an Inequality Graph
Every linear inequality graph consists of two main components:
- The Boundary Line: This line is derived from the associated linear equation (e.g., for
2x + 3y < 6, the boundary line is2x + 3y = 6). - The Shaded Region: This region represents all the points
(x, y)that satisfy the inequality.
Determining the Boundary Line
To graph the boundary line, you can convert the inequality into its slope-intercept form (y = mx + b) or use the x and y-intercepts. For example, if you have Ax + By = D:
- Slope (m): If
B ≠ 0, the slope is-A/B. IfB = 0, the line is vertical, and the slope is undefined. - Y-intercept (b): If
B ≠ 0, the y-intercept isD/B. IfA = 0, the line is horizontal, and the y-intercept isD/B. IfB = 0, there is no y-intercept (unless the line isx=0, the y-axis itself).
Solid vs. Dashed Lines
The type of boundary line depends on the inequality operator:
- Solid Line: Used for
≤(less than or equal to) or≥(greater than or equal to). This indicates that points on the line itself are included in the solution set. - Dashed Line: Used for
<(less than) or>(greater than). This indicates that points on the line are NOT included in the solution set.
Shading the Correct Region
After drawing the boundary line, you need to determine which side of the line to shade. This region contains all the points that satisfy the inequality. A common method is to use a "test point":
- Choose a point not on the boundary line (
(0,0)is often the easiest, unless the line passes through the origin). - Substitute the coordinates of the test point into the original inequality.
- If the inequality holds true, shade the region containing the test point.
- If the inequality is false, shade the region on the opposite side of the line.
Our calculator simplifies this by directly indicating whether to shade above/below (for non-vertical lines) or left/right (for vertical lines), based on the inequality and coefficients.
Using the Linear Inequality Graph Analyzer
This calculator helps you quickly understand the properties of a linear inequality graph without manual calculation. Simply input the coefficients A and B, select the inequality operator, and provide the constant D for an inequality in the form Ax + By Operator D. The tool will instantly provide:
- The equation of the boundary line.
- Its slope and y-intercept.
- Whether the line should be solid or dashed.
- A description of the region to be shaded.
- An example point that satisfies the inequality.
Example: 2x + 3y < 6
Let's use the example provided in the calculator's default values:
- A: 2
- B: 3
- Operator:
< - D: 6
When you click "Analyze Inequality", the calculator will output:
- Boundary Line Equation:
y = -0.67x + 2.00(derived from3y = -2x + 6) - Slope (m): -0.67
- Y-intercept (b): 2.00
- Line Type: Dashed Line (because of
<) - Shading Region: Below the line (testing
(0,0):0 < 6is true, so shade the side containing(0,0), which is below the line for this orientation). - Example Point: (0, 1.00) (a point below the line
y = -0.67x + 2.00)
This information allows you to accurately sketch the graph of the inequality, showing the boundary line and the correct shaded region.