Quadratic Regression Calculator

Fit Y = aX² + bX + c to data with R², vertex, roots, discriminant, residual analysis, and comparison to linear fit.

Quadratic Regression Calculator

Comma-separated
Comma-separated
Equation
Y = -0.7952X² + 40.3571X − 138.5714
Quadratic regression: Y = aX² + bX + c
a (X² coeff)
-0.795238
Parabola opens downward (concave down)
b (X coeff)
40.357143
Linear component
c (intercept)
-138.571429
Y-intercept at X=0
0.997688
vs. Linear R²=0.2478, improvement: 74.99pts
Adjusted R²
0.996763
Penalized for 2 predictors (X, X²)
Standard Error
6.3994
Typical prediction error in Y-units
Vertex
(25.374, 373.445)
Maximum point
Prediction: Y(22) = -0.7952·(22+ 40.3571·(22) 138.5714 = 364.3905

Data & Residuals

XYPredictedResidual|Residual|
5.0050.000043.33336.6667
10.00180.0000185.4762-5.4762
15.00280.0000287.8571-7.8571
20.00350.0000350.4762-0.4762
25.00380.0000373.33336.6667
30.00360.0000356.42863.5714
35.00300.0000299.76190.2381
40.00200.0000203.3333-3.3333

Parabola Properties

PropertyValueMeaning
DirectionOpens Down (∩)Has a maximum
Vertex(25.374, 373.445)Maximum Y value
Axis of symmetryX = 25.374Parabola is symmetric about this X
Y-intercept-138.5714Y when X = 0
Discriminant1,187.90992 real roots
X-intercepts3.7040, 47.0445Where Y = 0
R² improvement over linear74.99 percentage pointsQuadratic significantly better
Planning notes, formulas, and examples

About the Quadratic Regression Calculator

When data follows a curved pattern rather than a straight-line trend, quadratic regression can capture that curvature with a model of the form Y = aX² + bX + c.

This calculator fits the three coefficients, reports R² and adjusted R², and then summarizes the features that usually matter in practice: the vertex, the axis of symmetry, the discriminant, and the real roots when they exist. It also compares the fit against a linear model so you can see whether the quadratic term is actually earning its keep.

That makes the page useful for optimization problems, curved physical relationships, and any dataset where a straight line visibly misses the pattern.

When This Page Helps

Quadratic regression is often useful when the practical question is not just "is there a relationship?" but "where is the peak or trough?" The vertex often matters more than the coefficients themselves.

Seeing the fitted equation beside the vertex, the roots, and the linear-model comparison makes it easier to judge whether the curve is meaningful or whether a simpler model would be enough.

How to Use the Inputs

  1. Enter X and Y values (comma-separated, minimum 3 points).
  2. Or click a preset for common quadratic relationships.
  3. Review the fitted equation Y = aX² + bX + c.
  4. Check R² and compare to the linear R² — big improvement means quadratic is justified.
  5. Find the vertex — it gives the optimal or extreme X value.
  6. Enter a value in "Predict Y at X" for point prediction.
  7. Check residuals to verify the quadratic model fits well.
Formula used
Y = aX² + bX + c (least squares via normal equations). Vertex: (−b/2a, f(−b/2a)). Discriminant: Δ = b²−4ac. Roots: X = (−b±√Δ)/2a.

Example Calculation

Result: Y = −0.6488X² + 28.5595X − 62.5000, R² = 0.9958, Vertex: (22.01, 251.85), Linear R² = 0.5816

Revenue peaks at a price of ~22 with predicted revenue of 252. The quadratic model (R²=0.996) vastly outperforms linear (R²=0.582), confirming the data is genuinely curved.

Tips & Best Practices

  • If R² barely improves over linear (<2 percentage points), stick with the simpler linear model.
  • The vertex X-coordinate is the practical answer in optimization problems (optimal price, best temperature, etc.).
  • Negative a (downward parabola) means there's a maximum — positive a means a minimum.
  • The discriminant tells you if Y can be zero, which matters for break-even analysis.
  • Residuals should scatter randomly — a pattern means even the quadratic model is wrong.
  • Consider cubic regression if the quadratic residuals still curve.

Solving the Normal Equations

Quadratic regression minimizes Σ(yᵢ − axᵢ² − bxᵢ − c)². Taking partial derivatives with respect to a, b, c and setting them to zero yields three simultaneous equations (the normal equations). These involve sums of x, x², x³, x⁴, y, xy, and x²y. Solving the 3×3 system (Cramer's rule, LU decomposition, or matrix inversion) gives exact coefficients.

When Quadratic Isn't Enough

If residuals from the quadratic fit still show a systematic pattern, consider: cubic regression (degree 3) for S-shaped curves, logarithmic regression for rapid initial growth followed by leveling, or exponential regression for unlimited acceleration. Always use the simplest model that adequately fits the data — adding unnecessary polynomial terms overfits.

Applications: Optimization via the Vertex

In economics, quadratic regression is the backbone of revenue optimization: R(p) = ap² + bp + c, where p is price. Optimal price = −b/(2a). In agriculture, yield response to fertilizer is often quadratic — too much reduces yield. In pharmacology, the effective dose is the vertex of a quadratic dose-response curve. The vertex is the practical answer; the equation is just the means to find it.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Use quadratic when (1) a scatter plot shows curvature, (2) residuals from linear regression show a U or inverted-U pattern, (3) domain knowledge suggests a peak/trough (e.g., optimal dosage, price optimization), or (4) R² improves substantially over linear.