What Is a Quadratic Approximation?
The quadratic approximation of a function of two variables is its second-order Taylor polynomial: the best paraboloid that hugs the surface at a point. Building on the linear (tangent-plane) approximation, it adds curvature information from the second derivatives:
Q(x, y) = f + fxΔx + fyΔy + ½(fxxΔx² + 2fxyΔxΔy + fyyΔy²)
where everything is evaluated at the base point (x₀, y₀) and Δx = x − x₀, Δy = y − y₀. The linear part is the tangent plane; the quadratic part, driven by the Hessian matrix of second partials, bends that plane into a paraboloid that matches the surface's concavity. This makes Q far more accurate than the tangent plane over a small neighborhood, and it is the foundation of the second-derivative test and of Newton's method in optimization. This calculator assembles the gradient and Hessian at your point, writes out the quadratic model, and tests its accuracy against the true function nearby.
How to Use the Quadratic Approximation Calculator
Enter a function f(x, y) and a center point (x₀, y₀). The steps compute the value, the gradient (fx, fy), and the three distinct Hessian entries (fxx, fxy, fyy), then assemble the quadratic model Q. An accuracy table evaluates f and Q at several offsets from the center, showing the error shrinking cubically as you approach the point. The graph slices the surface through the center and overlays the quadratic. This extends the linear approximation and tangent plane to second order, using the same second partials as the Hessian matrix calculator.
Worked Example
Approximate f(x, y) = excos y at the origin. The value is f(0,0) = 1. The gradient is (excos y, −exsin y) = (1, 0). The Hessian entries are fxx = excos y = 1, fxy = −exsin y = 0, fyy = −excos y = −1. Assembling,
Q(x, y) = 1 + x + ½(x² − y²)
This paraboloid saddles, curving up in the x-direction (positive fxx) and down in the y-direction (negative fyy), exactly matching how excos y rises with x and dips with y near the origin. At the point (0.2, 0.3), the true value is e0.2cos(0.3) ≈ 1.1665, the tangent plane gives 1 + 0.2 = 1.2 (off by 3%), and the quadratic gives 1 + 0.2 + ½(0.04 − 0.09) = 1.175 (off by less than 1%). The quadratic model's error shrinks like the cube of the distance, versus the square for the tangent plane, a decisive improvement close to the point.
Why the Hessian Governs the Curvature
The quadratic term ½(fxxΔx² + 2fxyΔxΔy + fyyΔy²) is a quadratic form in the displacement, and its matrix is the Hessian H = [[fxx, fxy], [fxy, fyy]]. The nature of this form, whether it opens upward (positive definite), downward (negative definite), or saddles (indefinite), determines the local shape of the surface, and this is precisely the content of the second-derivative test for critical points. When the gradient is zero at the point (a critical point), the linear part vanishes and Q reduces to the constant plus the pure quadratic form, so the Hessian alone decides whether the point is a local minimum (bowl up), maximum (dome down), or saddle. The discriminant D = fxxfyy − fxy² is the determinant of the Hessian, and its sign is the classification rule. Beyond critical points, the quadratic model is the engine of Newton's method for optimization: at each step, you replace the true function by its local quadratic and jump to that paraboloid's exact minimum, which converges far faster than gradient descent because it accounts for curvature.
Common Mistakes to Avoid
- Forgetting the factor of ½ and the 2 on the cross term. The quadratic form is ½(fxxΔx² + 2fxyΔxΔy + fyyΔy²); the coefficient of the mixed term is fxy (the ½ and the 2 cancel), a common source of error.
- Evaluating derivatives at the wrong point. All partials are evaluated at the base point (x₀, y₀), producing constants; the variables appear only in the Δx, Δy displacements. Leaving x and y inside the derivatives is a frequent slip.
- Using it far from the center. The quadratic model is a local approximation; its accuracy degrades away from the base point. It excels within a small neighborhood, not across the whole domain.
- Assuming fxy = fyx always. They are equal (Clairaut's theorem) for functions with continuous second partials, which covers essentially all elementary functions, but the symmetry is a theorem, not an axiom.
- Confusing the quadratic approximation with the second-derivative test. The test is a special case, applied at a critical point where the gradient vanishes; the quadratic approximation works at any point, critical or not.
Real-World Applications
The quadratic approximation is the mathematical core of second-order optimization, which powers much of computational science and machine learning. Newton's method and its practical variants (quasi-Newton methods like BFGS, and trust-region methods) all model the objective function locally as a quadratic and step toward that model's minimum, achieving the fast convergence that gradient descent lacks; training large models, calibrating physical simulations, and solving engineering design problems rely on these curvature-aware methods. In statistics, the quadratic approximation of a log-likelihood function around its maximum yields the normal approximation to the posterior (the Laplace approximation) and the Fisher information matrix that quantifies estimation precision, the Hessian's role in inference.
Frequently Asked Questions
What is a quadratic approximation of a two-variable function?
It is the second-order Taylor polynomial: the tangent plane plus a quadratic correction built from the second partial derivatives (the Hessian). It is the paraboloid that best matches the surface's value, slope, and curvature at a point, more accurate than the tangent plane nearby.
How is it better than the tangent plane?
The tangent plane matches only value and slope, so its error grows like the square of the distance. The quadratic adds curvature, matching the surface to second order, so its error shrinks like the cube of the distance, dramatically better in a small neighborhood of the point.
What is the Hessian matrix?
The matrix of second partial derivatives, [[fxx, fxy], [fxy, fyy]]. It encodes the surface's curvature in all directions and forms the quadratic term of the approximation. Its determinant and eigenvalues classify critical points as minima, maxima, or saddles.
Why is the cross-term coefficient fxy and not ½fxy?
The quadratic form is ½(fxxΔx² + 2fxyΔxΔy + fyyΔy²). The mixed term has both a factor of 2 (from the two ways to pick the cross partial) and the overall ½, which cancel, leaving fxy as the coefficient of ΔxΔy.
How does this relate to the second-derivative test?
At a critical point the gradient is zero, so the quadratic approximation reduces to a constant plus the Hessian's quadratic form. The form's sign (from the discriminant D = fxxfyy − fxy²) then classifies the point, which is exactly the second-derivative test.
What does the quadratic model reveal about a critical point?
Its shape: a positive-definite Hessian makes Q a bowl (local minimum), negative-definite makes it a dome (local maximum), and indefinite makes it a saddle. Reading the Hessian's definiteness at a critical point tells you the local behavior without examining the function further.
How is the quadratic approximation used in Newton's method?
Newton's method for optimization replaces the objective by its local quadratic model and steps to that paraboloid's exact minimum, using the Hessian to account for curvature. This gives much faster (quadratic) convergence than gradient descent, at the cost of computing second derivatives.
Does the approximation work at any point?
Yes, at any point where f has continuous second derivatives, not only at critical points. The tool centers the model wherever you choose. The quadratic captures both slope and curvature there; at a critical point the slope part vanishes, isolating the curvature.
What is the harmonic approximation in physics?
The quadratic approximation of a potential energy surface about an equilibrium, where the linear term vanishes and the Hessian's quadratic form dominates. Its eigenvalues give the squared frequencies of small oscillations (normal modes), the basis of molecular vibration analysis and phonon theory.
How does it extend to more than two variables?
The same structure holds: Q = f + ∇f · Δr + ½ΔrᵀHΔr, where ∇f is the gradient vector and H is the full Hessian matrix. In n variables the Hessian is n×n, and its definiteness classifies critical points and drives Newton's method identically.