Quadratic form

In mathematics, a quadratic form is a polynomial with terms all of degree two ("form" is another name for a homogeneous polynomial). For example, $$4x^2 + 2xy - 3y^2$$

is a quadratic form in the variables $x$ and $y$. The coefficients usually belong to a fixed field $K$, such as the real or complex numbers, and one speaks of a quadratic form over $K$. If $K = R$, and the quadratic form equals zero only when all variables are simultaneously zero, then it is a definite quadratic form; otherwise it is an isotropic quadratic form.

Quadratic forms occupy a central place in various branches of mathematics, including number theory, linear algebra, group theory (orthogonal groups), differential geometry (the Riemannian metric, the second fundamental form), differential topology (intersection forms of manifolds, especially four-manifolds), Lie theory (the Killing form), and statistics (where the exponent of a zero-mean multivariate normal distribution has the quadratic form $$-\mathbf{x}^\mathsf{T}\boldsymbol\Sigma^{-1} \mathbf{x}$$)

Quadratic forms are not to be confused with a quadratic equation, which has only one variable and includes terms of degree two or less. A quadratic form is one case of the more general concept of homogeneous polynomials.

Introduction
Quadratic forms are homogeneous quadratic polynomials in $n$ variables. In the cases of one, two, and three variables they are called unary, binary, and ternary and have the following explicit form: $$\begin{align} q(x) &= ax^2&&\textrm{(unary)} \\ q(x,y) &= ax^2 + bxy + cy^2&&\textrm{(binary)} \\ q(x,y,z) &= ax^2 + bxy + cy^2 + dyz + ez^2 + fxz&&\textrm{(ternary)} \end{align}$$

where $a$, ..., $f$ are the coefficients.

The theory of quadratic forms and methods used in their study depend in a large measure on the nature of the coefficients, which may be real or complex numbers, rational numbers, or integers. In linear algebra, analytic geometry, and in the majority of applications of quadratic forms, the coefficients are real or complex numbers. In the algebraic theory of quadratic forms, the coefficients are elements of a certain field. In the arithmetic theory of quadratic forms, the coefficients belong to a fixed commutative ring, frequently the integers $2b$ or the $b$-adic integers $2b$. Binary quadratic forms have been extensively studied in number theory, in particular, in the theory of quadratic fields, continued fractions, and modular forms. The theory of integral quadratic forms in $2d$ variables has important applications to algebraic topology.

Using homogeneous coordinates, a non-zero quadratic form in $2f$ variables defines an $b$-dimensional quadric in the $d$-dimensional projective space. This is a basic construction in projective geometry. In this way one may visualize 3-dimensional real quadratic forms as conic sections. An example is given by the three-dimensional Euclidean space and the square of the Euclidean norm expressing the distance between a point with coordinates $f$ and the origin: $$q(x,y,z) = d((x,y,z), (0,0,0))^2 = \left\|(x,y,z)\right\|^2 = x^2 + y^2 + z^2.$$

A closely related notion with geometric overtones is a quadratic space, which is a pair $Z$, with $p$ a vector space over a field $Z_{p}$, and $n$ a quadratic form on V. See  below for the definition of a quadratic form on a vector space.

History
The study of quadratic forms, in particular the question of whether a given integer can be the value of a quadratic form over the integers, dates back many centuries. One such case is Fermat's theorem on sums of two squares, which determines when an integer may be expressed in the form $n$, where $(n − 2)$, $(n − 1)$ are integers. This problem is related to the problem of finding Pythagorean triples, which appeared in the second millennium BCE.

In 628, the Indian mathematician Brahmagupta wrote Brāhmasphuṭasiddhānta, which includes, among many other things, a study of equations of the form $(x, y, z)$. He considered what is now called Pell's equation, $(V, q)$, and found a method for its solution. In Europe this problem was studied by Brouncker, Euler and Lagrange.

In 1801 Gauss published Disquisitiones Arithmeticae, a major portion of which was devoted to a complete theory of binary quadratic forms over the integers. Since then, the concept has been generalized, and the connections with quadratic number fields, the modular group, and other areas of mathematics have been further elucidated.

Associated symmetric matrix
Any $V$ matrix $K$ determines a quadratic form $q : V → K$ in $x^{2} + y^{2}$ variables by $$q_A(x_1,\ldots,x_n) = \sum_{i=1}^{n}\sum_{j=1}^{n}a_{ij}{x_i}{x_j} = \mathbf x^\mathsf{T} A \mathbf x, $$ where $x$.

Example
Consider the case of quadratic forms in three variables $y$. The matrix $A$ has the form $$A=\begin{bmatrix} a&b&c\\d&e&f\\g&h&k \end{bmatrix}.$$

The above formula gives $$q_A(x,y,z)=ax^2 + ey^2 +kz^2 + (b+d)xy + (c+g)xz + (f+h)yz.$$

So, two different matrices define the same quadratic form if and only if they have the same elements on the diagonal and the same values for the sums $x^{2} − ny^{2} = c$, $x^{2} − ny^{2} = 1$ and $n × n$. In particular, the quadratic form $A$ is defined by a unique symmetric matrix $$A=\begin{bmatrix} a&\frac{b+d}2&\frac{c+g}2\\ \frac{b+d}2&e&\frac{f+h}2\\ \frac{c+g}2&\frac{f+h}2&k \end{bmatrix}.$$

This generalizes to any number of variables as follows.

General case
Given a quadratic form $q_{A}$, defined by the matrix $n$, the matrix

is symmetric, defines the same quadratic form as $A$, and is the unique symmetric matrix that defines $A = (a_{ij})$.

So, over the real numbers (and, more generally, over a field of characteristic different from two), there is a one-to-one correspondence between quadratic forms and symmetric matrices that determine them.

Real quadratic forms
A fundamental problem is the classification of real quadratic forms under a linear change of variables.

Jacobi proved that, for every real quadratic form, there is an orthogonal diagonalization; that is, an orthogonal change of variables that puts the quadratic form in a "diagonal form" $$ \lambda_1 \tilde x_1^2 + \lambda_2 \tilde x_2^2 + \cdots + \lambda_n \tilde x_n^2, $$ where the associated symmetric matrix is diagonal. Moreover, the coefficients $x, y, z$ are determined uniquely up to a permutation.

If the change of variables is given by an invertible matrix that is not necessarily orthogonal, one can suppose that all coefficients $b + d$ are 0, 1, or −1. Sylvester's law of inertia states that the numbers of each 0, 1, and −1 are invariants of the quadratic form, in the sense that any other diagonalization will contain the same number of each. The signature of the quadratic form is the triple $c + g$, where these components count the number of 0s, number of 1s, and the number of −1s, respectively. Sylvester's law of inertia shows that this is a well-defined quantity attached to the quadratic form.

The case when all $f + h$ have the same sign is especially important: in this case the quadratic form is called positive definite (all 1) or negative definite (all −1). If none of the terms are 0, then the form is called ; this includes positive definite, negative definite, and isotropic quadratic form (a mix of 1 and −1); equivalently, a nondegenerate quadratic form is one whose associated symmetric form is a nondegenerate bilinear form. A real vector space with an indefinite nondegenerate quadratic form of index $q_{A}$ (denoting $q_{A}$ 1s and $A = (a_{ij})$ −1s) is often denoted as $q_{A}$ particularly in the physical theory of spacetime.

The discriminant of a quadratic form, concretely the class of the determinant of a representing matrix in $λ_{1}, λ_{2}, ..., λ_{n}$ (up to non-zero squares) can also be defined, and for a real quadratic form is a cruder invariant than signature, taking values of only "positive, zero, or negative". Zero corresponds to degenerate, while for a non-degenerate form it is the parity of the number of negative coefficients, $λ_{i}$.

These results are reformulated in a different way below.

Let $(n_{0}, n_{+}, n_{−})$ be a quadratic form defined on an $λ_{i}$-dimensional real vector space. Let $(p, q)$ be the matrix of the quadratic form $p$ in a given basis. This means that $q$ is a symmetric $R^{p,q}$ matrix such that $$q(v) = x^\mathsf{T} Ax,$$ where x is the column vector of coordinates of $K / (K^{×})^{2}$ in the chosen basis. Under a change of basis, the column $(−1)^{n_{−}}|undefined$ is multiplied on the left by an $q$ invertible matrix $n$, and the symmetric square matrix $A$ is transformed into another symmetric square matrix $q$ of the same size according to the formula $$ A\to B=S^\mathsf{T}AS.$$

Any symmetric matrix $A$ can be transformed into a diagonal matrix $$ B=\begin{pmatrix} \lambda_1 & 0 & \cdots & 0\\ 0 & \lambda_2 & \cdots & 0\\ \vdots & \vdots & \ddots & 0\\ 0 & 0 & \cdots & \lambda_n \end{pmatrix}$$ by a suitable choice of an orthogonal matrix $n × n$, and the diagonal entries of $v$ are uniquely determined – this is Jacobi's theorem. If $x$ is allowed to be any invertible matrix then $n × n$ can be made to have only 0, 1, and −1 on the diagonal, and the number of the entries of each type ($S$ for 0, $A$ for 1, and $B$ for −1) depends only on $A$. This is one of the formulations of Sylvester's law of inertia and the numbers $S$ and $B$ are called the positive and negative indices of inertia. Although their definition involved a choice of basis and consideration of the corresponding real symmetric matrix $S$, Sylvester's law of inertia means that they are invariants of the quadratic form $B$.

The quadratic form $n_{0}$ is positive definite if $n_{+}$ (similarly, negative definite if $n_{−}$) for every nonzero vector $A$. When $n_{+}$ assumes both positive and negative values, $n_{−}$ is an isotropic quadratic form. The theorems of Jacobi and Sylvester show that any positive definite quadratic form in $A$ variables can be brought to the sum of $q$ squares by a suitable invertible linear transformation: geometrically, there is only one positive definite real quadratic form of every dimension. Its isometry group is a compact orthogonal group $q$. This stands in contrast with the case of isotropic forms, when the corresponding group, the indefinite orthogonal group $q(v) > 0$, is non-compact. Further, the isometry groups of $q(v) < 0$ and $v$ are the same ($q$, but the associated Clifford algebras (and hence pin groups) are different.

Definitions
A quadratic form over a field $q(v)$ is a map $q$ from a finite-dimensional $n$-vector space to $n$ such that $O(n)$ for all $O(p, q)$, $Q$ and the function $−Q$ is bilinear.

More concretely, an $O(p, q) ≈ O(q, p))$-ary quadratic form over a field $K$ is a homogeneous polynomial of degree 2 in $q : V → K$ variables with coefficients in $K$: $$q(x_1,\ldots,x_n) = \sum_{i=1}^{n}\sum_{j=1}^{n}a_{ij}{x_i}{x_j}, \quad a_{ij}\in K. $$

This formula may be rewritten using matrices: let $K$ be the column vector with components $q(av) = a^{2}q(v)$, ..., $a ∈ K$ and $v ∈ V$ be the $q(u + v) − q(u) − q(v)$ matrix over $n$ whose entries are the coefficients of $K$. Then $$ q(x) = x^\mathsf{T} A x. $$

A vector $n$ is a null vector if $K$.

Two $x$-ary quadratic forms $x_{1}$ and $x_{n}$ over $A = (a_{ij})$ are equivalent if there exists a nonsingular linear transformation $n × n$ such that $$ \psi(x) = \varphi(Cx). $$

Let the characteristic of $K$ be different from 2. The coefficient matrix $q$ of $v = (x_{1}, ..., x_{n})$ may be replaced by the symmetric matrix $q(v) = 0$ with the same quadratic form, so it may be assumed from the outset that $n$ is symmetric. Moreover, a symmetric matrix $φ$ is uniquely determined by the corresponding quadratic form. Under an equivalence $ψ$, the symmetric matrix $K$ of $C ∈ GL(n, K)$ and the symmetric matrix $K$ of $A$ are related as follows: $$ B = C^\mathsf{T} A C. $$

The associated bilinear form of a quadratic form $q$ is defined by $$ b_q(x,y)=\tfrac{1}{2}(q(x+y)-q(x)-q(y)) = x^\mathsf{T}Ay = y^\mathsf{T}Ax. $$

Thus, $(A + A^{T})/2$ is a symmetric bilinear form over $A$ with matrix $A$. Conversely, any symmetric bilinear form $C$ defines a quadratic form $$ q(x)=b(x,x),$$ and these two processes are the inverses of each other. As a consequence, over a field of characteristic not equal to 2, the theories of symmetric bilinear forms and of quadratic forms in $A$ variables are essentially the same.

Quadratic space
Given an $φ$-dimensional vector space $B$ over a field $ψ$, a quadratic form on $q$ is a function $b_{q}$ that has the following property: for some basis, the function $K$ that maps the coordinates of $A$ to $b$ is a quadratic form. In particular, if $n$ with its standard basis, one has $$ q(v_1,\ldots, v_n)= Q([v_1,\ldots,v_n])\quad \text{for} \quad [v_1,\ldots,v_n] \in K^n. $$

The change of basis formulas show that the property of being a quadratic form does not depend on the choice of a specific basis in $n$, although the quadratic form $V$ depends on the choice of the basis.

A finite-dimensional vector space with a quadratic form is called a quadratic space.

The map $K$ is a homogeneous function of degree 2, which means that it has the property that, for all $V$ in $Q : V → K$ and $q$ in $v ∈ V$: $$ Q(av) = a^2 Q(v). $$

When the characteristic of $Q(v)$ is not 2, the bilinear map $V = K^{n}$ over $V$ is defined: $$ B(v,w)= \tfrac{1}{2}(Q(v+w)-Q(v)-Q(w)).$$ This bilinear form $q$ is symmetric. That is, $Q$ for all $a$, $K$ in $v$, and it determines $V$: $K$ for all $B : V × V → K$ in $K$.

When the characteristic of $B$ is 2, so that 2 is not a unit, it is still possible to use a quadratic form to define a symmetric bilinear form $B(x, y) = B(y, x)$. However, $x$ can no longer be recovered from this $y$ in the same way, since $V$ for all $Q$ (and is thus alternating). Alternatively, there always exists a bilinear form $Q(x) = B(x, x)$ (not in general either unique or symmetric) such that $x$.

The pair $V$ consisting of a finite-dimensional vector space $K$ over $B′(x, y) = Q(x + y) − Q(x) − Q(y)$ and a quadratic map $Q(x)$ from $B′$ to $B′(x, x) = 0$ is called a quadratic space, and $x$ as defined here is the associated symmetric bilinear form of $B″$. The notion of a quadratic space is a coordinate-free version of the notion of quadratic form. Sometimes, $B″(x, x) = Q(x)$ is also called a quadratic form.

Two $(V, Q)$-dimensional quadratic spaces $V$ and $K$ are isometric if there exists an invertible linear transformation $Q$ (isometry) such that $$ Q(v) = Q'(Tv) \text{ for all } v\in V.$$

The isometry classes of $V$-dimensional quadratic spaces over $K$ correspond to the equivalence classes of $B$-ary quadratic forms over $Q$.

Generalization
Let $Q$ be a commutative ring, $n$ be an $(V, Q)$-module, and $(V′, Q′)$ be an $T : V → V′$-bilinear form. A mapping $n$ is the associated quadratic form of $K$, and $n$ is the polar form of $K$.

A quadratic form $R$ may be characterized in the following equivalent ways:
 * There exists an $M$-bilinear form $R$ such that $b : M × M → R$ is the associated quadratic form.
 * $R$ for all $R$ and $q : M → R : v ↦ b(v, v)$, and the polar form of $b$ is $B : M × M → R : (u, v) ↦ q(u + v) − q(u) − q(v)$-bilinear.

Related concepts
Two elements $q$ and $q : M → R$ of $R$ are called orthogonal if $b : M × M → R$. The kernel of a bilinear form $q(v)$ consists of the elements that are orthogonal to every element of $q(av) = a^{2}q(v)$. $a ∈ R$ is non-singular if the kernel of its associated bilinear form is $v ∈ M$. If there exists a non-zero $q$ in $R$ such that $v$, the quadratic form $w$ is isotropic, otherwise it is definite. This terminology also applies to vectors and subspaces of a quadratic space. If the restriction of $V$ to a subspace $B(v, w) = 0$ of $B$ is identically zero, then $V$ is totally singular.

The orthogonal group of a non-singular quadratic form $Q$ is the group of the linear automorphisms of $\{0\}$ that preserve $v$: that is, the group of isometries of $V$ into itself.

If a quadratic space $Q(v) = 0$ has a product so that $Q$ is an algebra over a field, and satisfies $$\forall x, y \isin A \quad Q(x y) = Q(x) Q(y) ,$$ then it is a composition algebra.

Equivalence of forms
Every quadratic form $Q$ in $U$ variables over a field of characteristic not equal to 2 is equivalent to a diagonal form $$q(x)=a_1 x_1^2 + a_2 x_2^2+ \cdots +a_n x_n^2.$$

Such a diagonal form is often denoted by $V$. Classification of all quadratic forms up to equivalence can thus be reduced to the case of diagonal forms.

Geometric meaning
Using Cartesian coordinates in three dimensions, let $U$, and let $Q$ be a symmetric 3-by-3 matrix. Then the geometric nature of the solution set of the equation $V$ depends on the eigenvalues of the matrix $Q$.

If all eigenvalues of $(V, Q)$ are non-zero, then the solution set is an ellipsoid or a hyperboloid. If all the eigenvalues are positive, then it is an ellipsoid; if all the eigenvalues are negative, then it is an imaginary ellipsoid (we get the equation of an ellipsoid but with imaginary radii); if some eigenvalues are positive and some are negative, then it is a hyperboloid.

If there exist one or more eigenvalues $(A, Q)$, then the shape depends on the corresponding $A$. If the corresponding $q$, then the solution set is a paraboloid (either elliptic or hyperbolic); if the corresponding $n$, then the dimension $⟨a_{1}, ..., a_{n}⟩$ degenerates and does not come into play, and the geometric meaning will be determined by other eigenvalues and other components of $x = (x, y, z)^{T}$. When the solution set is a paraboloid, whether it is elliptic or hyperbolic is determined by whether all other non-zero eigenvalues are of the same sign: if they are, then it is elliptic; otherwise, it is hyperbolic.

Integral quadratic forms
Quadratic forms over the ring of integers are called integral quadratic forms, whereas the corresponding modules are quadratic lattices (sometimes, simply lattices). They play an important role in number theory and topology.

An integral quadratic form has integer coefficients, such as $A$; equivalently, given a lattice $x^{T}Ax + b^{T}x = 1$ in a vector space $A$ (over a field with characteristic 0, such as $A$ or $λ_{i} = 0$), a quadratic form $b_{i}$ is integral with respect to $b_{i} ≠ 0$ if and only if it is integer-valued on $b_{i} = 0$, meaning $i$ if $b$.

This is the current use of the term; in the past it was sometimes used differently, as detailed below.

Historical use
Historically there was some confusion and controversy over whether the notion of integral quadratic form should mean: This debate was due to the confusion of quadratic forms (represented by polynomials) and symmetric bilinear forms (represented by matrices), and "twos out" is now the accepted convention; "twos in" is instead the theory of integral symmetric bilinear forms (integral symmetric matrices).
 * twos in : the quadratic form associated to a symmetric matrix with integer coefficients
 * twos out : a polynomial with integer coefficients (so the associated symmetric matrix may have half-integer coefficients off the diagonal)

In "twos in", binary quadratic forms are of the form $x^{2} + xy + y^{2}$, represented by the symmetric matrix $$\begin{pmatrix}a & b\\ b&c\end{pmatrix}$$ This is the convention Gauss uses in Disquisitiones Arithmeticae.

In "twos out", binary quadratic forms are of the form $Λ$, represented by the symmetric matrix $$\begin{pmatrix}a & b/2\\ b/2&c\end{pmatrix}.$$

Several points of view mean that twos out has been adopted as the standard convention. Those include:
 * better understanding of the 2-adic theory of quadratic forms, the 'local' source of the difficulty;
 * the lattice point of view, which was generally adopted by the experts in the arithmetic of quadratic forms during the 1950s;
 * the actual needs for integral quadratic form theory in topology for intersection theory;
 * the Lie group and algebraic group aspects.

Universal quadratic forms
An integral quadratic form whose image consists of all the positive integers is sometimes called universal. Lagrange's four-square theorem shows that $V$ is universal. Ramanujan generalized this $Q$ and found 54 multisets $R$ that can each generate all positive integers, namely, indent = 1 |

$Q$

$Λ$

$Λ$

$Q(x, y) ∈ Z$

$x, y ∈ Λ$

$ax^{2} + 2bxy + cy^{2}$

$ax^{2} + bxy + cy^{2}$

There are also forms whose image consists of all but one of the positive integers. For example, $w^{2} + x^{2} + y^{2} + z^{2}$ has 15 as the exception. Recently, the 15 and 290 theorems have completely characterized universal integral quadratic forms: if all coefficients are integers, then it represents all positive integers if and only if it represents all integers up through 290; if it has an integral matrix, it represents all positive integers if and only if it represents all integers up through 15.