A quadratic form is a homogeneous polynomial of degree two in several variables. Over the real numbers, it can be written as
where is a symmetric matrix and is a column vector. Familiar examples include , which measures squared distance from the origin, and , which takes both positive and negative values. More generally, quadratic forms are defined on vector spaces over fields, with a formulation that remains meaningful when division by two is impossible.
Quadratic forms provide a common language for squared lengths, conic sections, second-order approximations, energy, and arithmetic representation problems. Their classification depends fundamentally on the allowed changes of variables and on the number system containing the coefficients. Over the real numbers, the decisive information is the number of positive, negative, and zero squares in a diagonal expression. Over the integers or rational numbers, divisibility and local arithmetic introduce substantially finer distinctions.
Algebraic definition and matrix representation
Let be a finite-dimensional vector space over a field . A quadratic form is a map satisfying for every , such that
is a bilinear form. This means that is linear separately in each argument. The pair is called a quadratic space. When the characteristic of is not two, it is often more convenient to use the normalized associated form
Then is symmetric and . Thus quadratic forms and symmetric bilinear forms determine one another in this setting.
Choosing a basis identifies with and gives , where is symmetric. The coefficient of is , whereas the coefficient of , for , is . For example,
has matrix
Any matrix over a field of characteristic other than two defines the same quadratic polynomial as its symmetric part , because the skew-symmetric part contributes zero.
An invertible linear change of variables transforms the matrix according to
This relation is called congruence. It differs from matrix similarity, where the transformation is . Similarity describes one linear operator in different bases; congruence describes one quadratic form in different bases. Eigenvalues need not be preserved by congruence, although rank is preserved. For example, the one-variable forms and are equivalent over the real numbers through .
The radical of the associated bilinear form consists of vectors satisfying for every . In coordinates it is the null space of . A form is nondegenerate if this radical is zero, equivalently if . Over a field of characteristic other than two, every quadratic form can be diagonalized by congruence:
Completing squares gives a constructive proof, although an initial change of basis may be needed if every diagonal entry initially vanishes. Which nonzero coefficients can then be removed by rescaling depends on which elements of are squares.
Classification over the real and complex numbers
For a real quadratic form, the spectral theorem gives an orthogonal matrix such that
The are the real eigenvalues of . An orthogonal change of variables therefore removes mixed terms while preserving ordinary Euclidean lengths. Rescaling each coordinate whose eigenvalue is nonzero produces
with unused coordinates.
Sylvester’s law of inertia, established in the nineteenth century and associated with James Joseph Sylvester, states that the numbers are independent of the invertible real change of coordinates used. They are the positive index, negative index, and nullity. The triple is called the inertia; “signature” may mean either the pair or the difference , depending on convention. Two real quadratic forms of the same dimension are congruent exactly when their inertias agree.
A form is positive definite if for every nonzero , positive semidefinite if , and indefinite if it takes both positive and negative values. Negative definite and negative semidefinite forms are defined with the inequalities reversed. Positive definiteness is equivalent to all eigenvalues being positive and to the representing matrix being a positive-definite matrix. Sylvester’s criterion gives another test: every leading principal minor must be positive. Positive semidefiniteness instead requires all principal minors to be nonnegative; checking only the leading ones is insufficient.
For example,
is positive definite. Its leading principal minors are and . By contrast, has inertia and vanishes on the two lines , despite being nondegenerate. Nondegeneracy therefore does not mean that only the zero vector has value zero.
Over the complex numbers, every nonzero scalar has a square root. Consequently, every symmetric quadratic form of rank is congruent to ; rank alone classifies such forms. There is no corresponding positive-versus-negative distinction. Complex quadratic forms must also be distinguished from Hermitian forms , which use complex conjugation and can define positive lengths. Indeed, vanishes at the nonzero vector , whereas the positive Hermitian expression does not.
Geometric interpretation and transformation groups
A positive-definite real quadratic form defines an inner product by polarization and a norm by
Its unit level set is an ellipsoid. In orthonormal eigenvector coordinates, its principal semiaxes have lengths . Thus eigenvectors describe the directions of the axes, while eigenvalues describe their relative scales. The form , for instance, gives an ellipse with semiaxes and .
Indefinite forms produce different level sets. The equation defines a hyperbola, while defines a double cone. More generally, a degree-two algebraic locus is called a quadric. An affine quadratic equation has the form
If is invertible, translating removes the linear term and yields
Its geometry is then controlled by the inertia of and the remaining constant. If is singular, some linear terms may survive every translation, producing parabolic rather than central quadrics.
In projective geometry, a quadratic form defines a locus in homogeneous coordinates. Multiplying by a nonzero scalar does not change this locus, so projective classification is not identical to classification of forms themselves. A nondegenerate form defines a nonsingular projective quadric when the characteristic is not two. A positive-definite real form has no real projective zeros, although its complexification can have many.
Vectors satisfying are called isotropic; a form with a nonzero such vector is isotropic. Otherwise it is anisotropic. Positive-definite real forms are anisotropic, but anisotropy is not synonymous with positivity over general fields. The rational form is anisotropic over the rationals because is irrational, although it is isotropic over the real numbers.
The invertible transformations preserving form its orthogonal group:
For the ordinary sum of squares this is ; for a nondegenerate real form of inertia , it is denoted . These groups preserve the geometry selected by the form rather than necessarily preserving Euclidean distance. Reflections provide basic examples: when ,
preserves . Over fields of characteristic other than two, every isometry of a nondegenerate finite-dimensional quadratic space is a product of such reflections.
Optimization, curvature, and numerical computation
Quadratic forms describe the local curvature of differentiable functions. For a twice continuously differentiable real function , the second-order Taylor expansion at is
where is the Hessian matrix. At a stationary point, a positive-definite Hessian implies a strict local minimum, a negative-definite Hessian implies a strict local maximum, and an indefinite Hessian implies a saddle point. A semidefinite Hessian does not settle the question: and have the same zero Hessian at the origin but different local behavior.
A quadratic objective is commonly written
with symmetric. Its gradient is , and its Hessian is . If is positive definite, the unique minimizer solves . If is positive semidefinite, a minimum exists precisely when belongs to the image of ; the minimizing set is then an affine translate of its null space. If has a negative eigenvalue, the unconstrained objective is unbounded below along a corresponding direction.
Quadratic programming adds constraints, often linear equalities and inequalities. Positive-semidefinite gives a convex problem, whereas indefinite quadratic programs may possess multiple local minima and are generally much harder. In equality-constrained optimization, curvature need only be positive on feasible directions. For constraints , these directions satisfy , so a reduced quadratic form on determines whether a stationary point is a constrained minimum.
The Rayleigh quotient
connects optimization directly with spectral theory. Its minimum and maximum are the smallest and largest eigenvalues of a real symmetric matrix. Restricting the quotient to subspaces leads to min–max characterizations of intermediate eigenvalues. These principles underlie vibration analysis and many numerical eigenvalue algorithms.
Computation usually avoids explicitly inverting . A positive-definite form admits a Cholesky decomposition , giving . Symmetric indefinite matrices are commonly handled by pivoted factorizations, with and diagonal blocks. Their block inertias recover the inertia of the original form. Near-zero eigenvalues make definiteness tests sensitive to roundoff, so numerical classification requires tolerances related to matrix scale and conditioning rather than exact comparisons with zero.
Probability, statistical inference, and data geometry
Quadratic forms arise naturally when squared deviations are combined across correlated variables. If a random vector has mean and covariance matrix , then for a fixed symmetric matrix ,
This identity requires finite second moments but not a normal distribution. It follows by writing , expanding, and using the fact that the centered vector has expectation zero. The trace term measures the contribution from random variation, while the second term measures displacement of the mean.
For nonsingular , the quantity
is squared Mahalanobis distance. Unlike ordinary Euclidean distance, it accounts for unequal variances and correlations. If , transforming to converts this expression to an ordinary sum of squares. This operation is called whitening. The density of a multivariate normal distribution is proportional to , so its equal-density surfaces are ellipsoids defined by the covariance structure.
If has independent standard normal coordinates and , orthogonal invariance gives
where the are independent standard normal variables. For a symmetric idempotent matrix of rank , the nonzero eigenvalues are all one, and the result has a chi-squared distribution with degrees of freedom. A general positive-semidefinite form yields a weighted sum of independent chi-squared variables, not ordinarily a single chi-squared distribution. An indefinite form can take either sign.
For a Gaussian , the variance has the explicit expression
Higher moments of non-Gaussian vectors need not satisfy this formula. In the centered standard-normal case, two symmetric quadratic forms and are independent exactly when , a result connecting probabilistic independence to orthogonality of the subspaces on which the forms act.
In ordinary least squares, the residual sum of squares is a quadratic form , where is the orthogonal projection onto the design matrix’s column space. Under the Gaussian linear model with error variance and design rank , its ratio to has a chi-squared distribution with degrees of freedom. Orthogonal decompositions of such forms also supply the exact distributional foundations of classical analysis of variance.
Integral forms, representation problems, and historical development
The arithmetic theory asks which integers are represented by a form with integer coefficients and how such forms should be classified. A form represents an integer if has an integer solution. Equivalence usually means an invertible integral change of variables, represented by a matrix in , whose determinant is or . This is much more restrictive than real or rational equivalence: a real rescaling that simplifies coefficients may not preserve integer points.
A binary quadratic form is
with discriminant . Under an integral change of variables, the discriminant is unchanged. A form is primitive when . Proper equivalence restricts changes of variables to determinant , an important distinction in the composition theory. If and , the form is positive definite; positive nonsquare gives an indefinite form.
For positive-definite binary forms, reduction theory selects representatives satisfying inequalities such as
together with boundary conventions. Since , these inequalities imply , leaving only finitely many reduced possibilities for a fixed negative discriminant. Indefinite reduction has a different structure, with cycles related to periodic continued fractions and Pell-type equations. Reduction makes equivalence and representation questions computationally accessible without reducing arithmetic classification to real diagonalization.
Work on sums of squares long predates the general theory. Fermat’s two-square theorem states that an odd prime is a sum of two integer squares exactly when it is congruent to modulo . Joseph-Louis Lagrange proved in 1770 that every nonnegative integer is a sum of four squares. Adrien-Marie Legendre’s three-square theorem identifies the excluded nonnegative integers as those of the form . These results concern specific forms, but they exemplify the interaction between polynomial identities and congruence obstructions.
Carl Friedrich Gauss gave binary quadratic forms a systematic treatment in Disquisitiones Arithmeticae in 1801. His composition law makes proper equivalence classes of primitive forms of a fixed discriminant into an abelian group. This construction later became closely connected with ideal classes in quadratic number fields. In higher dimensions, the 1993 Conway–Schneeberger fifteen theorem and the 2005 Bhargava–Hanke 290 theorem supplied finite tests for positive-definite forms to represent every positive integer. Their different bounds reflect different integrality conventions: integer-valued quadratic polynomials need not have integer entries in their symmetric representing matrices.
Rational forms and the local–global principle
Over the rational numbers, diagonalization is possible, but nonzero coefficients cannot generally all be changed to or . A rescaling alters a diagonal coefficient only by a rational square. For a nondegenerate form, the determinant therefore gives an invariant in
This determinant square class and the real signature are important but are not sufficient by themselves to classify rational quadratic forms.
The additional information is organized by considering the real numbers and the p-adic numbers , one field for each prime . These are the completions of for its archimedean and prime-adic absolute values. Over , quadratic forms are classified by dimension, determinant square class, and a Hasse invariant. For a diagonal form , the latter is built from the pairwise Hilbert symbols , which encode local norm and solvability conditions.
The Hasse–Minkowski theorem, completed through work of Hermann Minkowski and Helmut Hasse, states that a rational quadratic form has a nonzero rational zero if and only if it has a nonzero zero over the real numbers and over every . Equivalently, two nondegenerate rational forms are isometric if and only if they are isometric over all these completions. This is a particularly strong local–global principle: a global question over is determined by a collection of local questions.
For example, consider
A nonzero rational solution could be cleared of denominators and divided by a common factor to give a primitive integer solution. Reducing modulo forces both and to be divisible by , since the only square residues are and . The equation then forces to be divisible by , contradicting primitivity. The corresponding obstruction is also visible over ; real solvability alone is insufficient.
Integral representation is subtler. A nondegenerate integral form represents locally if it represents over the real numbers and over every ring of -adic integers. These conditions are necessary but need not be sufficient for representation by a specified integral form. Distinct integral classes may belong to the same genus, meaning that they become equivalent over every such local ring and over the reals. Thus rational equivalence, integral equivalence, and membership in a genus are different classification problems. The local–global theorem for rational quadratic forms does not erase these integral distinctions.
Characteristic two, Witt decomposition, and associated algebras
Characteristic two requires a separate formulation because , so polarization cannot be divided by two. The polar form remains
but now satisfies for every : it is alternating. It no longer determines . For example, over , the forms
have the same polar form. Yet has nonzero isotropic vectors, while takes value at every nonzero vector.
A symmetric matrix expression in characteristic two contains no mixed terms, since the two off-diagonal contributions cancel. General quadratic polynomials can instead be encoded using an upper-triangular coefficient matrix, but this does not restore the characteristic-not-two correspondence with symmetric bilinear forms. Also, a nondegenerate alternating bilinear form has even dimension. Terminology concerning regularity and nonsingularity of quadratic forms in characteristic two therefore needs care, especially in odd dimensions.
Over a field of characteristic other than two, a nondegenerate isotropic form contains a hyperbolic plane, represented by or equivalently by a nonzero scalar multiple of . Splitting off such planes repeatedly gives a Witt decomposition
where is anisotropic. The integer , called the Witt index, is the maximal dimension of a totally isotropic subspace. The anisotropic part is unique up to isometry. Ernst Witt developed this structural theory in his 1937 work on quadratic forms.
The Witt group records forms after hyperbolic summands are discarded. Orthogonal direct sum supplies addition, and replacing by supplies its additive inverse. Tensor products extend this structure to the Witt ring. Over the real numbers, the difference between positive and negative indices identifies the Witt group with . Over other fields, it retains arithmetic information that is invisible to rank alone.
A different construction associates a Clifford algebra to . It is generated by the vectors of , subject to
With normalized polarization in characteristic other than two, this implies
Clifford algebras encode reflections and lead to spin groups, which are closely related to special orthogonal groups. They connect quadratic-form theory with representation theory, geometry, and the algebraic structures used to describe spinors.
Energy, differential geometry, and infinite-dimensional forms
In classical mechanics, kinetic energy is a positive quadratic form in velocity. For particles with fixed masses,
In generalized coordinates it becomes
where the mass matrix depends on configuration and is positive definite when the coordinates describe independent physical degrees of freedom. Near a stable equilibrium, the potential energy has a quadratic approximation with stiffness matrix . Normal-mode frequencies then satisfy the generalized eigenvalue equation
In differential geometry, a Riemannian metric assigns a smoothly varying positive-definite quadratic form to each tangent space. The coordinate expression
specifies infinitesimal squared length, and the matrix transforms by congruence under coordinate changes. An indefinite nondegenerate metric gives a pseudo-Riemannian geometry. In spacetime models, a Lorentzian metric has one sign different from the other three; its zero set determines null directions rather than a unit sphere. The distinction between positive, negative, and zero values acquires a geometric interpretation tied to the metric’s signature.
Quadratic forms also determine the principal type of many second-order partial differential equations. For an operator with principal part
the principal symbol is the quadratic form
up to a conventional overall sign. Positive or negative definiteness gives ellipticity. A Lorentzian signature is the basic pattern for wave-type hyperbolic equations. The heat equation requires a parabolic classification that treats the time derivative differently from the second-order spatial derivatives, rather than simply assigning the full operator a nondegenerate signature.
In infinite-dimensional analysis, quadratic forms need not be defined on an entire Hilbert space. The energy
is naturally defined on a suitable Sobolev space, with boundary conditions encoded in its domain. A densely defined, closed, semibounded symmetric form determines a unique associated self-adjoint operator. This permits the rigorous construction of Laplacians and Schrödinger operators even when directly specifying an operator domain is difficult.
A Dirichlet form is a closed nonnegative symmetric form with an additional contraction property. Such forms connect energy minimization with Markov semigroups and diffusion processes. A finite-dimensional analogue appears on a weighted undirected graph:
Here is the graph Laplacian and each edge is counted once. The form is nonnegative, and its null space consists of vectors constant on each connected component, linking algebraic degeneracy directly to graph connectivity.