Quadratic Function Calculator
Enter the coefficients for the quadratic equation: ax² + bx + c = 0
Results:
Enter coefficients and click "Calculate Quadratic" to see the roots, vertex, and other properties of your quadratic function.
Results:
'; if (isNaN(a) || isNaN(b) || isNaN(c)) { resultDiv.innerHTML = 'Results:
Please enter valid numbers for all coefficients.'; return; } if (a === 0) { if (b === 0) { if (c === 0) { output += 'This is the trivial equation 0 = 0, which has infinite solutions.'; } else { output += 'This is a contradiction (e.g., ' + c + ' = 0), which has no solution.'; } } else { var x_linear = -c / b; output += 'This is a linear equation (not quadratic) because a = 0.'; output += 'Linear Solution (x): ' + x_linear.toFixed(4) + "; } resultDiv.innerHTML = output; return; } var delta = b * b – 4 * a * c; output += 'Equation: ' + a + 'x² + ' + b + 'x + ' + c + ' = 0'; // Roots if (delta >= 0) { var x1 = (-b + Math.sqrt(delta)) / (2 * a); var x2 = (-b – Math.sqrt(delta)) / (2 * a); if (delta === 0) { output += 'Roots (x-intercepts): One real root (repeated): x = ' + x1.toFixed(4) + "; } else { output += 'Roots (x-intercepts): Two distinct real roots:'; output += 'x₁ = ' + x1.toFixed(4) + "; output += 'x₂ = ' + x2.toFixed(4) + "; } } else { var realPart = -b / (2 * a); var imaginaryPart = Math.sqrt(Math.abs(delta)) / (2 * a); output += 'Roots (x-intercepts): Two complex conjugate roots:'; output += 'x₁ = ' + realPart.toFixed(4) + ' + ' + imaginaryPart.toFixed(4) + 'i'; output += 'x₂ = ' + realPart.toFixed(4) + ' – ' + imaginaryPart.toFixed(4) + 'i'; } // Vertex var vertexX = -b / (2 * a); var vertexY = a * vertexX * vertexX + b * vertexX + c; output += 'Vertex: (' + vertexX.toFixed(4) + ', ' + vertexY.toFixed(4) + ')'; // Axis of Symmetry output += 'Axis of Symmetry: x = ' + vertexX.toFixed(4) + "; // Y-intercept output += 'Y-intercept: (0, ' + c.toFixed(4) + ')'; resultDiv.innerHTML = output; }Understanding Quadratic Functions and Their Calculator
A quadratic function is a polynomial function of the form f(x) = ax² + bx + c, where 'a', 'b', and 'c' are real numbers, and 'a' is not equal to zero. The graph of a quadratic function is a parabola, a U-shaped curve that can open either upwards (if a > 0) or downwards (if a < 0).
Key Components of a Quadratic Function:
- Coefficient 'a': Determines the direction and width of the parabola. If 'a' is positive, the parabola opens upwards; if 'a' is negative, it opens downwards. A larger absolute value of 'a' makes the parabola narrower.
- Coefficient 'b': Influences the position of the vertex and the axis of symmetry.
- Coefficient 'c': Represents the y-intercept of the parabola, which is the point where the graph crosses the y-axis (when x = 0, f(0) = c).
What This Calculator Determines:
Our Quadratic Function Calculator helps you analyze the properties of any quadratic equation in the standard form ax² + bx + c = 0 by providing the following key results:
1. Roots (x-intercepts)
The roots of a quadratic equation are the values of 'x' for which the function equals zero (f(x) = 0). These are also known as the x-intercepts, where the parabola crosses the x-axis. The calculator uses the famous quadratic formula to find these roots:
x = [-b ± √(b² – 4ac)] / 2a
The term (b² – 4ac) is called the discriminant (Δ), and its value determines the nature of the roots:
- If Δ > 0: There are two distinct real roots. The parabola intersects the x-axis at two different points.
- If Δ = 0: There is exactly one real root (a repeated root). The parabola touches the x-axis at its vertex.
- If Δ < 0: There are two complex conjugate roots. The parabola does not intersect the x-axis.
2. Vertex
The vertex is the turning point of the parabola. It's either the lowest point (minimum) if the parabola opens upwards (a > 0) or the highest point (maximum) if it opens downwards (a < 0). The coordinates of the vertex (h, k) are calculated as:
- h = -b / 2a
- k = f(h) = a(h)² + b(h) + c
3. Axis of Symmetry
The axis of symmetry is a vertical line that passes through the vertex of the parabola, dividing it into two mirror images. Its equation is simply:
x = -b / 2a
4. Y-intercept
The y-intercept is the point where the parabola crosses the y-axis. This occurs when x = 0. For a quadratic function f(x) = ax² + bx + c, the y-intercept is always (0, c).
Real-World Applications:
Quadratic functions are fundamental in many fields:
- Physics: Describing projectile motion (e.g., the path of a thrown ball or a rocket).
- Engineering: Designing parabolic antennas, bridges, and architectural structures.
- Economics: Modeling profit maximization, cost minimization, and supply/demand curves.
- Sports: Analyzing the trajectory of a golf ball or a basketball shot.
By using this calculator, you can quickly understand the behavior and key features of any quadratic function, making it a valuable tool for students, educators, and professionals alike.