Calculate the roots (x-intercepts), vertex, and axis of symmetry for a quadratic function of the form ax² + bx + c = 0.
Results
Roots: –
Vertex: –
Axis of Symmetry: –
Understanding Quadratic Functions
A quadratic function is a polynomial function of degree two, meaning it has the form: f(x) = ax² + bx + c, where 'a', 'b', and 'c' are constants, and importantly, 'a' cannot be zero. If 'a' were zero, the x² term would vanish, and the function would become linear (bx + c).
The graph of a quadratic function is a parabola, which is a symmetrical U-shaped or inverted U-shaped curve. The shape and direction of the parabola depend on the coefficients 'a', 'b', and 'c':
If a > 0, the parabola opens upwards (like a smile).
If a < 0, the parabola opens downwards (like a frown).
The coefficient 'b' influences the position of the vertex and the slope of the parabola.
The coefficient 'c' is the y-intercept, meaning it's the point where the parabola crosses the y-axis (when x = 0).
Key Properties of a Parabola:
Our calculator helps you find three fundamental properties of a parabola:
1. Roots (x-intercepts):
The roots of a quadratic function are the values of 'x' for which f(x) = 0. These are the points where the parabola intersects the x-axis. For the equation ax² + bx + c = 0, the roots can be found using the quadratic formula:
x = [-b ± √(b² – 4ac)] / 2a
The expression inside the square root, Δ = b² – 4ac, is called the discriminant. It tells us about the nature of the roots:
If Δ > 0, there are two distinct real roots.
If Δ = 0, there is exactly one real root (a repeated root).
If Δ < 0, there are no real roots (but two complex conjugate roots).
2. Vertex:
The vertex is the minimum or maximum point of the parabola. If the parabola opens upwards (a > 0), the vertex is the minimum point. If it opens downwards (a < 0), the vertex is the maximum point.
The x-coordinate of the vertex is given by: x_vertex = -b / 2a.
To find the y-coordinate, substitute this x_vertex value back into the original quadratic function: y_vertex = a(x_vertex)² + b(x_vertex) + c.
3. Axis of Symmetry:
The axis of symmetry is a vertical line that passes through the vertex, dividing the parabola into two mirror-image halves. Its equation is always:
x = x_vertex, which is x = -b / 2a.
Use Cases:
Quadratic functions and their properties are used in various fields:
Physics: Modeling projectile motion (e.g., the path of a ball thrown into the air).
Engineering: Designing parabolic reflectors, antennas, and suspension bridges.
Economics: Determining profit maximization or cost minimization points.
Statistics: Curve fitting and regression analysis.
function calculateQuadratic() {
var a = parseFloat(document.getElementById("coefficientA").value);
var b = parseFloat(document.getElementById("coefficientB").value);
var c = parseFloat(document.getElementById("coefficientC").value);
var rootsResult = document.getElementById("roots");
var vertexResult = document.getElementById("vertex");
var axisOfSymmetryResult = document.getElementById("axisOfSymmetry");
// Clear previous results
rootsResult.innerHTML = "Roots: -";
vertexResult.innerHTML = "Vertex: -";
axisOfSymmetryResult.innerHTML = "Axis of Symmetry: -";
// Input validation
if (isNaN(a) || isNaN(b) || isNaN(c)) {
alert("Please enter valid numbers for all coefficients.");
return;
}
if (a === 0) {
alert("Coefficient 'a' cannot be zero for a quadratic function.");
return;
}
// Calculate Discriminant
var discriminant = b * b – 4 * a * c;
// Calculate Roots
var root1, root2;
var rootsText = "";
if (discriminant > 0) {
root1 = (-b + Math.sqrt(discriminant)) / (2 * a);
root2 = (-b – Math.sqrt(discriminant)) / (2 * a);
rootsText = "Roots: x₁ = " + root1.toFixed(4) + ", x₂ = " + root2.toFixed(4);
} else if (discriminant === 0) {
root1 = -b / (2 * a);
rootsText = "Roots: x = " + root1.toFixed(4) + " (repeated)";
} else {
var realPart = -b / (2 * a);
var imaginaryPart = Math.sqrt(-discriminant) / (2 * a);
rootsText = "Roots: x₁ = " + realPart.toFixed(4) + " + " + imaginaryPart.toFixed(4) + "i, x₂ = " + realPart.toFixed(4) + " – " + imaginaryPart.toFixed(4) + "i (complex)";
}
rootsResult.innerHTML = rootsText;
// Calculate Vertex
var vertexX = -b / (2 * a);
var vertexY = a * vertexX * vertexX + b * vertexX + c;
vertexResult.innerHTML = "Vertex: (" + vertexX.toFixed(4) + ", " + vertexY.toFixed(4) + ")";
// Calculate Axis of Symmetry
axisOfSymmetryResult.innerHTML = "Axis of Symmetry: x = " + vertexX.toFixed(4);
}