📚 Quadratic Forms: Canonical Form and Matrix Representation | 二次型:标准形与矩阵表示
A quadratic form is a homogeneous polynomial of degree two in several variables. In linear algebra and its applications — from geometry to optimization — understanding how to represent and simplify quadratic forms is essential. This article explores the matrix representation of quadratic forms and their reduction to canonical (standard) forms.
二次型是多个变量的二次齐次多项式。在线性代数及其应用中——从几何到优化——理解如何表示和简化二次型至关重要。本文将探讨二次型的矩阵表示以及将其化为标准形(规范形)的方法。
1. Definition and Matrix Representation | 定义与矩阵表示
A quadratic form in n variables x₁, x₂, …, xₙ is an expression of the form Q(x) = Σᵢⱼ aᵢⱼ xᵢ xⱼ, where i and j run from 1 to n. By combining symmetric terms, every quadratic form can be written uniquely as Q(x) = xᵀ A x, where x is the column vector (x₁, …, xₙ)ᵀ and A is a symmetric matrix.
n 个变量 x₁, x₂, …, xₙ 的二次型是形如 Q(x) = Σᵢⱼ aᵢⱼ xᵢ xⱼ 的表达式,其中 i 和 j 从 1 到 n。通过合并对称项,每个二次型都可以唯一地写成 Q(x) = xᵀ A x,其中 x 是列向量 (x₁, …, xₙ)ᵀ,A 是对称矩阵。
Q(x) = xᵀ A x = Σᵢ₌₁ⁿ Σⱼ₌₁ⁿ aᵢⱼ xᵢ xⱼ, with aᵢⱼ = aⱼᵢ
For example, the quadratic form Q(x, y) = 3x² + 4xy + 2y² can be represented by the symmetric matrix A = [[3, 2], [2, 2]] because xᵀ A x = [x y] [[3, 2], [2, 2]] [x; y] = 3x² + 4xy + 2y². The off-diagonal entries are half the coefficient of the corresponding cross term.
例如,二次型 Q(x, y) = 3x² + 4xy + 2y² 可以用对称矩阵 A = [[3, 2], [2, 2]] 表示,因为 xᵀ A x = [x y] [[3, 2], [2, 2]] [x; y] = 3x² + 4xy + 2y²。非对角元素是对应交叉项系数的一半。
2. Why Symmetric Matrices | 为什么使用对称矩阵
Although any matrix B satisfying xᵀ B x = Q(x) works, the representation is not unique if B is not symmetric. However, for every B, the symmetric part A = (B + Bᵀ)/2 gives the same quadratic form. Therefore we always choose A symmetric, which ensures uniqueness and allows us to use the powerful spectral theorem.
虽然任何满足 xᵀ B x = Q(x) 的矩阵 B 都可以,但如果 B 不对称,表示并不唯一。然而,对于任何 B,其对称部分 A = (B + Bᵀ)/2 给出相同的二次型。因此我们总是选择对称矩阵 A,这保证了唯一性,并允许我们使用强大的谱定理。
Symmetry also guarantees that all eigenvalues of A are real and that there exists an orthogonal basis of eigenvectors. This property is the key to simplifying quadratic forms through orthogonal diagonalization.
对称性还保证 A 的所有特征值都是实数,并且存在由特征向量组成的正交基。这一性质是通过正交对角化简化二次型的关键。
3. Change of Variables | 变量替换
A linear change of variables x = P y, where P is an invertible matrix, transforms the quadratic form as follows: Q(x) = xᵀ A x = (P y)ᵀ A (P y) = yᵀ (Pᵀ A P) y. The new matrix representing the quadratic form in the y variables is therefore Pᵀ A P.
线性变量替换 x = P y(其中 P 是可逆矩阵)将二次型变换如下:Q(x) = xᵀ A x = (P y)ᵀ A (P y) = yᵀ (Pᵀ A P) y。因此,在 y 变量下表示二次型的新矩阵是 Pᵀ A P。
Two matrices A and B are called congruent if there exists an invertible matrix P such that B = Pᵀ A P. Congruence preserves the quadratic form up to a change of variables. Our goal is to choose P so that B becomes as simple as possible — ideally diagonal.
如果存在可逆矩阵 P 使得 B = Pᵀ A P,则称矩阵 A 和 B 相合。相合保持二次型在变量替换下的形式。我们的目标是选择 P 使得 B 尽可能简单——理想情况下是对角矩阵。
4. Diagonalization by Orthogonal Transformations | 正交变换对角化
Since A is symmetric, the spectral theorem tells us that A can be diagonalized by an orthogonal matrix P: Pᵀ A P = D, where D = diag(λ₁, λ₂, …, λₙ) and λᵢ are the eigenvalues of A. The columns of P are the corresponding orthonormal eigenvectors.
由于 A 是对称矩阵,谱定理告诉我们 A 可以通过正交矩阵 P 对角化:Pᵀ A P = D,其中 D = diag(λ₁, λ₂, …, λₙ),λᵢ 是 A 的特征值。P 的列是对应的标准正交特征向量。
Under the orthogonal change x = P y, the quadratic form becomes Q = λ₁ y₁² + λ₂ y₂² + … + λₙ yₙ². This is called the principal axis form. The coefficients are the eigenvalues, and the new variables are coordinates along the principal axes of the quadric surface defined by Q(x) = 1.
在正交变换 x = P y 下,二次型变为 Q = λ₁ y₁² + λ₂ y₂² + … + λₙ yₙ²。这称为主轴形式。系数是特征值,新变量是沿二次曲面 Q(x) = 1 的主轴的坐标。
Q(x) = xᵀ A x → Q(y) = λ₁ y₁² + λ₂ y₂² + … + λₙ yₙ²
5. Example: Two-Variable Quadratic Form | 示例:二元二次型
Consider Q(x, y) = 2x² + 4xy + 5y². The matrix is A = [[2, 2], [2, 5]]. The characteristic polynomial is det(A − λI) = (2 − λ)(5 − λ) − 4 = λ² − 7λ + 6 = (λ − 6)(λ − 1). Thus the eigenvalues are λ₁ = 6 and λ₂ = 1.
考虑 Q(x, y) = 2x² + 4xy + 5y²。矩阵为 A = [[2, 2], [2, 5]]。特征多项式为 det(A − λI) = (2 − λ)(5 − λ) − 4 = λ² − 7λ + 6 = (λ − 6)(λ − 1)。因此特征值为 λ₁ = 6 和 λ₂ = 1。
For λ₁ = 6, an eigenvector is (1, 2)ᵀ; normalized to (1/√5, 2/√5)ᵀ. For λ₂ = 1, an eigenvector is (−2, 1)ᵀ; normalized to (−2/√5, 1/√5)ᵀ. With P = [[1/√5, −2/√5], [2/√5, 1/√5]], we obtain Pᵀ A P = diag(6, 1). Hence Q = 6u² + v² in the new coordinates.
对于 λ₁ = 6,特征向量为 (1, 2)ᵀ;归一化为 (1/√5, 2/√5)ᵀ。对于 λ₂ = 1,特征向量为 (−2, 1)ᵀ;归一化为 (−2/√5, 1/√5)ᵀ。取 P = [[1/√5, −2/√5], [2/√5, 1/√5]],得到 Pᵀ A P = diag(6, 1)。因此在新坐标下 Q = 6u² + v²。
6. Canonical Form via Completing the Square | 配方法求标准形
An alternative to eigenvalue decomposition is the method of completing the square. This method uses elementary congruence operations (performing the same row and column operations) to transform A into a diagonal matrix. It does not require orthogonality and is often simpler for hand calculation.
特征值分解的替代方法是配方法。该方法使用初等相合变换(同时对行和列进行相同的操作)将 A 化为对角矩阵。它不需要正交性,通常手算更简单。
For example, Q = x² + 4xy + 3y². Rewrite as Q = (x + 2y)² − y². Let u = x + 2y and v = y. Then Q = u² − v². The diagonal matrix in this basis is diag(1, −1). Note that the transformation is not orthogonal; it is a triangular change of variables.
例如,Q = x² + 4xy + 3y²。改写为 Q = (x + 2y)² − y²。令 u = x + 2y,v = y。则 Q = u² − v²。该基下的对角矩阵为 diag(1, −1)。注意此变换不是正交的;它是三角变量替换。
7. Canonical Form and Rank | 标准形与秩
The canonical form of a quadratic form is usually written as d₁ y₁² + d₂ y₂² + … + dₙ yₙ², where dᵢ are nonzero constants. By scaling the variables further, we can reduce each coefficient to ±1. The number of positive coefficients is the positive index of inertia p, and the number of negative coefficients is the negative index of inertia q. The rank of the quadratic form is p + q, which equals the rank of the matrix A.
二次型的标准形通常写成 d₁ y₁² + d₂ y₂² + … + dₙ yₙ²,其中 dᵢ 是非零常数。通过进一步缩放变量,我们可以将每个系数化为 ±1。正系数的个数称为正惯性指数 p,负系数的个数称为负惯性指数 q。二次型的秩为 p + q,等于矩阵 A 的秩。
Sylvester’s law of inertia states that p and q are invariant under any nonsingular change of variables. Thus the canonical form is unique up to the signs of the coefficients, regardless of the method used to diagonalize the form.
西尔维斯特惯性定律指出,p 和 q 在任何非奇异变量替换下保持不变。因此,无论采用何种对角化方法,标准形在系数的符号意义下是唯一的。
8. Definiteness and Eigenvalues | 定性与特征值
The signs of the eigenvalues of A determine the definiteness of the quadratic form. If all eigenvalues are positive, Q is positive definite (Q(x) > 0 for all x ≠ 0). If all are negative, Q is negative definite. If some are positive and some negative, Q is indefinite. If some eigenvalues are zero, Q is semidefinite.
A 的特征值符号决定了二次型的定性。如果所有特征值均为正,则 Q 正定(对所有 x ≠ 0,Q(x) > 0)。如果所有特征值均为负,则 Q 负定。如果既有正又有负,则 Q 不定。如果有零特征值,则 Q 半定。
For a 2×2 symmetric matrix A = [[a, b], [b, c]], positive definiteness holds iff a > 0 and ac − b² > 0. This is a special case of Sylvester’s criterion, which uses the signs of leading principal minors.
对于 2×2 对称矩阵 A = [[a, b], [b, c]],正定当且仅当 a > 0 且 ac − b² > 0。这是西尔维斯特判据的特殊情形,该判据使用顺序主子式的符号。
9. Geometric Interpretation | 几何解释
The equation Q(x) = 1 represents a central quadric surface. For n = 2, it is a conic: an ellipse if both eigenvalues are positive, a hyperbola if they have opposite signs, and a parabola-like degenerate case if one eigenvalue is zero. The eigenvectors give the directions of the principal axes, and the eigenvalues determine the lengths of the semiaxes: the semiaxis along eigenvector i has length 1/√|λᵢ|.
方程 Q(x) = 1 表示中心二次曲面。当 n = 2 时,它是圆锥曲线:若两个特征值均为正则表示椭圆,若符号相反则表示双曲线,若一个特征值为零则表示退化的抛物线情形。特征向量给出了主轴方向,特征值决定了半轴长度:沿特征向量 i 的半轴长度为 1/√|λᵢ|。
For example, Q = 2x² + 4xy + 5y² = 1 becomes 6u² + v² = 1 in principal coordinates, representing an ellipse with semiaxes 1/√6 and 1. The principal axes are rotated relative to the original axes.
例如,Q = 2x² + 4xy + 5y² = 1 在主轴坐标下变为 6u² + v² = 1,表示半轴为 1/√6 和 1 的椭圆。主轴相对于原轴旋转了一个角度。
10. Lagrange’s Reduction | 拉格朗日配方法
Lagrange’s method provides a systematic algorithm for reducing a quadratic form to a sum of squares without computing eigenvalues. It proceeds by repeatedly selecting a variable whose square appears, completing the square, and then applying the process to the remaining variables. If no square term exists but a cross term exists, a preliminary substitution u = xᵢ + xⱼ, v = xᵢ − xⱼ is used to create squares.
拉格朗日方法提供了一种无需计算特征值即可将二次型化为平方和的系统算法。它通过反复选择含有平方项的变量,配方,然后对剩余变量继续该过程。如果没有平方项但有交叉项,则先做替换 u = xᵢ + xⱼ,v = xᵢ − xⱼ 以产生平方项。
This method always yields a canonical form with coefficients 0, +1, or −1 after scaling. It is particularly useful in number theory and when only the signature (p, q) is required.
该方法在缩放后总是得到系数为 0、+1 或 −1 的标准形。它在数论中以及只需要符号差 (p, q) 时特别有用。
11. Applications in Optimization and Convexity | 在优化与凸性中的应用
In multivariable calculus, the Hessian matrix H of a function f at a critical point determines whether that point is a local minimum, maximum, or saddle. The quadratic form vᵀ H v is the second-order directional derivative. Local minima require H to be positive semidefinite; strict minima require positive definiteness.
在多变量微积分中,函数 f 在临界点处的黑塞矩阵 H 决定了该点是局部极小值、极大值还是鞍点。二次型 vᵀ H v 是二阶方向导数。局部极小值要求 H 半正定;严格极小值要求正定。
Similarly, a twice-differentiable function is convex on a domain iff its Hessian is positive semidefinite everywhere. Therefore, analyzing the definiteness of quadratic forms is a central tool in nonlinear optimization and machine learning.
类似地,一个二阶可微函数在某个区域上是凸的,当且仅当其黑塞矩阵处处半正定。因此,分析二次型的定性是非线性优化和机器学习中的核心工具。
12. Summary and Key Formulas | 总结与关键公式
The matrix representation Q(x) = xᵀ A x with A symmetric is the foundation of the theory of quadratic forms. Orthogonal diagonalization gives the principal axis form with eigenvalues as coefficients. The canonical form, obtained by any congruence transformation, has coefficients 0 or ±1, and Sylvester’s law guarantees that the signature (p, q) is invariant.
矩阵表示 Q(x) = xᵀ A x(A 对称)是二次型理论的基础。正交对角化给出以特征值为系数的主轴形式。通过任何相合变换得到的标准形,其系数为 0 或 ±1,并且西尔维斯特定律保证了符号差 (p, q) 不变。
- Matrix representation: Q(x) = xᵀ A x, Aᵀ = A
- Orthogonal diagonalization: Pᵀ A P = diag(λ₁, …, λₙ)
- Canonical form: Σ dᵢ yᵢ² → after scaling: Σ εᵢ yᵢ², εᵢ ∈ {−1, 0, 1}
- Sylvester’s law: signature (p, q) is invariant
- Definiteness: positive definite iff all eigenvalues > 0
矩阵表示:Q(x) = xᵀ A x,Aᵀ = A
正交对角化:Pᵀ A P = diag(λ₁, …, λₙ)
标准形:Σ dᵢ yᵢ² → 缩放后:Σ εᵢ yᵢ²,εᵢ ∈ {−1, 0, 1}
西尔维斯特定律:符号差 (p, q) 不变
定性:正定当且仅当所有特征值 > 0
Mastering these ideas enables you to simplify complex quadratic forms, classify conics and quadrics, and solve optimization problems with confidence.
掌握这些概念,你就能简化复杂的二次型、对圆锥曲线和二次曲面进行分类,并自信地解决优化问题。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply