Mathwords logoMathwords

Quadratic Form — Definition, Formula & Examples

A quadratic form is a scalar-valued expression built from a vector and a symmetric matrix, where every term is degree two in the vector's components. It generalizes the idea of a quadratic expression like ax2+2bxy+cy2ax^2 + 2bxy + cy^2 to any number of variables using matrix notation.

A quadratic form on Rn\mathbb{R}^n is a function Q:RnRQ: \mathbb{R}^n \to \mathbb{R} defined by Q(x)=xTAxQ(\mathbf{x}) = \mathbf{x}^T A\, \mathbf{x}, where AA is an n×nn \times n symmetric matrix and x\mathbf{x} is a column vector in Rn\mathbb{R}^n. The matrix AA is called the matrix of the quadratic form.

Key Formula

Q(x)=xTAxQ(\mathbf{x}) = \mathbf{x}^T A\, \mathbf{x}
Where:
  • Q(x)Q(\mathbf{x}) = The scalar value of the quadratic form
  • x\mathbf{x} = A column vector in \mathbb{R}^n
  • AA = An n × n symmetric matrix

How It Works

To evaluate a quadratic form, place your variables into a column vector x\mathbf{x}, then compute xTAx\mathbf{x}^T A\, \mathbf{x}. The result is a single real number (a scalar). Any quadratic form can always be associated with a unique symmetric matrix AA by requiring A=ATA = A^T. The eigenvalues of AA determine the form's classification: if all eigenvalues are positive, the form is positive definite; if all are negative, it is negative definite; if mixed, it is indefinite.

Worked Example

Problem: Let A = [[2, 1], [1, 3]] and x = [1, -1]^T. Compute the quadratic form Q(x) = x^T A x.
Step 1: Compute the matrix-vector product A x.
Ax=[2113][11]=[2(1)+1(1)1(1)+3(1)]=[12]A\mathbf{x} = \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix}\begin{bmatrix} 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 2(1)+1(-1) \\ 1(1)+3(-1) \end{bmatrix} = \begin{bmatrix} 1 \\ -2 \end{bmatrix}
Step 2: Compute x^T times the result from Step 1.
Q(x)=xT(Ax)=[11][12]=1(1)+(1)(2)=3Q(\mathbf{x}) = \mathbf{x}^T(A\mathbf{x}) = \begin{bmatrix} 1 & -1 \end{bmatrix}\begin{bmatrix} 1 \\ -2 \end{bmatrix} = 1(1) + (-1)(-2) = 3
Answer: Q(x) = 3. In expanded form, this equals 2x₁² + 2x₁x₂ + 3x₂², which gives 2(1)² + 2(1)(−1) + 3(−1)² = 3.

Why It Matters

Quadratic forms appear when you classify conic sections, test optimization conditions in multivariable calculus (via the Hessian matrix), and analyze stability in differential equations. In statistics, the sum of squared residuals in regression is a quadratic form, making this concept essential for anyone studying data science or econometrics.

Common Mistakes

Mistake: Using a non-symmetric matrix and treating it as the unique matrix of the quadratic form.
Correction: Any matrix B can define the same quadratic form as the symmetric matrix A = (B + B^T)/2. Always symmetrize first so that the matrix representation is unique.