linear algebra calculators

Quadratic Form Calculator

Evaluate a 2-variable quadratic form Q(x₁, x₂) and analyze its definiteness. Useful in optimization, geometry, and studying conic sections.

About this calculator

A quadratic form in two variables is an expression Q(x₁, x₂) = a₁₁x₁² + 2a₁₂x₁x₂ + a₂₂x₂², where the coefficients form a symmetric 2×2 matrix A = [[a₁₁, a₁₂], [a₁₂, a₂₂]]. The formula used here is Q = a₁₁·x₁² + 2·a₁₂·x₁·x₂ + a₂₂·x₂². Definiteness is determined by Sylvester's criterion: if a₁₁ > 0 and det(A) = a₁₁·a₂₂ − a₁₂² > 0, the form is positive definite (always > 0 for non-zero inputs). If both leading minors are negative in alternating sign, it is negative definite. Otherwise it may be indefinite or semi-definite. Quadratic forms appear in second-derivative tests, ellipse/hyperbola classification, and principal component analysis.

How to use

Suppose a₁₁ = 2, a₁₂ = 1, a₂₂ = 3, and you evaluate at x₁ = 2, x₂ = 1. Plug into Q = a₁₁·x₁² + 2·a₁₂·x₁·x₂ + a₂₂·x₂²: Q = 2·(4) + 2·(1)·(2)·(1) + 3·(1) = 8 + 4 + 3 = 15. To check definiteness: det(A) = (2)(3) − (1)² = 6 − 1 = 5 > 0 and a₁₁ = 2 > 0, so the form is positive definite.

Frequently asked questions

How do you determine whether a quadratic form is positive definite?

A quadratic form Q with symmetric matrix A is positive definite if Q(x) > 0 for every non-zero vector x. By Sylvester's criterion, this happens when all leading principal minors of A are positive: a₁₁ > 0 and det(A) = a₁₁·a₂₂ − a₁₂² > 0 for the 2×2 case. Positive definiteness is important in optimization because it guarantees a function has a strict local minimum at a critical point.

What is the relationship between a quadratic form and a symmetric matrix?

Every quadratic form Q(x) can be written as Q(x) = xᵀAx, where A is a symmetric matrix whose diagonal entries are the squared coefficients and off-diagonal entries are half the cross-term coefficients. This matrix representation makes it easy to apply eigenvalue analysis: the form is positive definite if and only if all eigenvalues of A are positive. The symmetry of A ensures real eigenvalues and an orthogonal diagonalization.

Why are quadratic forms used in multivariable calculus and optimization?

In multivariable calculus, the second-order behavior of a smooth function near a critical point is captured by its Hessian matrix, which defines a quadratic form. If that quadratic form is positive definite, the critical point is a local minimum; negative definite means a local maximum; indefinite means a saddle point. This test generalizes the second-derivative test from single-variable calculus to any number of dimensions.