Enter the coefficients (a, b, c) of your quadratic inequality in the form ax² + bx + c <op> 0, select the inequality type, and click "Calculate" to find the solution set.
x² +
x +
">>
<option value="<
=">≥
<option value="≤
0
Solution:
function calculateQuadraticInequality() {
var a = parseFloat(document.getElementById("coeffA").value);
var b = parseFloat(document.getElementById("coeffB").value);
var c = parseFloat(document.getElementById("coeffC").value);
var inequalityType = document.getElementById("inequalityType").value;
var resultDiv = document.getElementById("quadraticInequalityResult");
var resultText = "";
if (isNaN(a) || isNaN(b) || isNaN(c)) {
resultDiv.innerHTML = "Please enter valid numbers for all coefficients.";
return;
}
if (a === 0) {
resultDiv.innerHTML = "Coefficient 'a' cannot be zero for a quadratic inequality. This is a linear inequality.";
return;
}
var discriminant = b * b – 4 * a * c;
if (discriminant 0) { // Parabola opens up, always positive
if (inequalityType === ">" || inequalityType === ">=") {
resultText = "(-∞, ∞) (All real numbers)";
} else { // < or <=
resultText = "No real solution (Empty set)";
}
} else { // a < 0, Parabola opens down, always negative
if (inequalityType === "<" || inequalityType === " or >=
resultText = "No real solution (Empty set)";
}
}
} else if (discriminant === 0) {
// One real root (repeated root)
var x0 = -b / (2 * a);
var x0_fixed = x0.toFixed(4);
if (a > 0) { // Parabola opens up, non-negative
if (inequalityType === ">") {
resultText = "(-∞, " + x0_fixed + ") U (" + x0_fixed + ", ∞) (All real numbers except " + x0_fixed + ")";
} else if (inequalityType === ">=") {
resultText = "(-∞, ∞) (All real numbers)";
} else if (inequalityType === "<") {
resultText = "No real solution (Empty set)";
} else { // <=
resultText = "x = " + x0_fixed;
}
} else { // a ") {
resultText = "No real solution (Empty set)";
} else if (inequalityType === ">=") {
resultText = "x = " + x0_fixed;
} else if (inequalityType === "<") {
resultText = "(-∞, " + x0_fixed + ") U (" + x0_fixed + ", ∞) (All real numbers except " + x0_fixed + ")";
} else { // 0) { // Parabola opens up
if (inequalityType === ">") {
resultText = "(-∞, " + x1_fixed + ") U (" + x2_fixed + ", ∞)";
} else if (inequalityType === ">=") {
resultText = "(-∞, " + x1_fixed + "] U [" + x2_fixed + ", ∞)";
} else if (inequalityType === "<") {
resultText = "(" + x1_fixed + ", " + x2_fixed + ")";
} else { // <=
resultText = "[" + x1_fixed + ", " + x2_fixed + "]";
}
} else { // a ") {
resultText = "(" + x1_fixed + ", " + x2_fixed + ")";
} else if (inequalityType === ">=") {
resultText = "[" + x1_fixed + ", " + x2_fixed + "]";
} else if (inequalityType === "<") {
resultText = "(-∞, " + x1_fixed + ") U (" + x2_fixed + ", ∞)";
} else { // <=
resultText = "(-∞, " + x1_fixed + "] U [" + x2_fixed + ", ∞)";
}
}
}
resultDiv.innerHTML = resultText;
}
.calculator-container {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f9f9f9;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
max-width: 700px;
margin: 20px auto;
border: 1px solid #ddd;
}
.calculator-container h2 {
color: #333;
text-align: center;
margin-bottom: 20px;
font-size: 24px;
}
.calculator-container p {
color: #555;
line-height: 1.6;
margin-bottom: 15px;
}
.calculator-inputs {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
margin-bottom: 20px;
background-color: #fff;
padding: 15px;
border-radius: 5px;
border: 1px solid #eee;
}
.calculator-inputs label {
flex: 1 1 100px;
color: #333;
font-weight: bold;
text-align: right;
padding-right: 10px;
}
.calculator-inputs input[type="number"],
.calculator-inputs select {
flex: 2 1 120px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
max-width: 150px; /* Limit width for number inputs */
}
.calculator-inputs select {
max-width: 100px; /* Smaller width for select */
}
.calculator-inputs .inline-text {
flex: 0 0 auto;
margin: 0 5px;
font-size: 18px;
font-weight: bold;
color: #666;
}
.calculator-inputs label:nth-of-type(1),
.calculator-inputs label:nth-of-type(2),
.calculator-inputs label:nth-of-type(3) {
flex: 0 0 auto; /* Don't grow, don't shrink, just take content width */
text-align: left;
padding-right: 0;
}
button {
background-color: #007bff;
color: white;
padding: 12px 25px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 18px;
display: block;
width: 100%;
max-width: 250px;
margin: 20px auto;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
.calculator-result {
background-color: #e9f7ef;
border: 1px solid #d4edda;
border-radius: 5px;
padding: 15px;
margin-top: 20px;
text-align: center;
}
.calculator-result h3 {
color: #28a745;
margin-top: 0;
font-size: 20px;
}
#quadraticInequalityResult {
font-size: 1.2em;
color: #333;
font-weight: bold;
word-wrap: break-word;
}
.example-section {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.example-section h3 {
color: #333;
font-size: 20px;
margin-bottom: 15px;
}
.example-section ul {
list-style-type: disc;
margin-left: 20px;
color: #555;
}
.example-section li {
margin-bottom: 10px;
}
@media (max-width: 600px) {
.calculator-inputs {
flex-direction: column;
align-items: stretch;
}
.calculator-inputs label {
text-align: left;
padding-right: 0;
}
.calculator-inputs input[type="number"],
.calculator-inputs select {
max-width: 100%;
}
}
Understanding Quadratic Inequalities
A quadratic inequality is a mathematical statement that compares a quadratic expression to zero using an inequality sign. The general form is ax² + bx + c <op> 0, where a, b, and c are real numbers, a ≠ 0, and <op> can be > (greater than), < (less than), ≥ (greater than or equal to), or ≤ (less than or equal to).
Unlike quadratic equations, which typically have one or two specific solutions, quadratic inequalities usually have a range of solutions, often expressed as intervals on the number line.
How to Solve Quadratic Inequalities
Solving quadratic inequalities involves a few key steps:
Convert to an Equation: First, replace the inequality sign with an equals sign to form the associated quadratic equation: ax² + bx + c = 0.
Find the Roots: Solve this quadratic equation for x. You can use factoring, completing the square, or the quadratic formula: x = [-b ± √(b² - 4ac)] / 2a. These roots are called critical points.
Analyze the Discriminant (b² – 4ac):
If b² - 4ac > 0: There are two distinct real roots. These roots divide the number line into three intervals.
If b² - 4ac = 0: There is exactly one real root (a repeated root). This root divides the number line into two intervals.
If b² - 4ac < 0: There are no real roots. The quadratic expression is either always positive or always negative.
Test Intervals or Use Parabola Shape:
Test Points: Choose a test value from each interval created by the roots and substitute it into the original inequality. If the inequality holds true for the test value, then that entire interval is part of the solution.
Parabola Shape: The graph of a quadratic function y = ax² + bx + c is a parabola.
If a > 0, the parabola opens upwards. The function is positive outside the roots and negative between the roots.
If a < 0, the parabola opens downwards. The function is negative outside the roots and positive between the roots.
Write the Solution: Express the solution set using interval notation. Remember to use parentheses () for strict inequalities (<, >) and brackets [] for inclusive inequalities (≤, ≥).
Using the Quadratic Inequality Calculator
Our calculator simplifies this process:
Input Coefficients: Enter the values for a, b, and c from your quadratic inequality ax² + bx + c <op> 0.
Select Inequality Type: Choose the correct inequality symbol (>, <, ≥, or ≤) from the dropdown menu.
Calculate: Click the "Calculate Solution" button.
View Result: The calculator will instantly display the solution set in interval notation.
Examples of Quadratic Inequalities and Their Solutions
Example 1: Two Distinct Real Roots (a > 0)
Inequality:x² - 5x + 6 > 0
Coefficients: a=1, b=-5, c=6
Associated Equation: x² - 5x + 6 = 0
Roots: (x-2)(x-3) = 0, so x=2 and x=3.
Since a > 0, the parabola opens upwards. The expression is positive when x is outside the roots.