Linear algebra underpins nodal circuit solvers, finite-element stiffness systems, principal component analysis, and linear regression. Treating matrices simultaneously as rectangular arrays of coefficients and as geometric transformations of vector spaces makes algebraic rules—such as transpose reversal, determinant area scaling, and orthogonality—far easier to verify under time pressure.
Matrix Operations, Transpose, and Algebraic Identities
Let A be an m × n matrix (m rows, n columns) and B be an n × p matrix. Their product C = AB has size m × p with entries c_ij = Σ_{k=1}^n a_ik · b_kj. Equivalently, each column j of AB is a linear combination of the columns of A weighted by column j of B.
| Operation / Property | Formula or Condition | Key Caution |
|---|---|---|
| Multiplication dimensions | (m × n)(n × p) → (m × p) |
Inner dimensions must match; AB ≠ BA in general |
| Transpose of a product | (AB)ᵀ = Bᵀ Aᵀ |
Order reverses |
| Inverse of a product | (AB)⁻¹ = B⁻¹ A⁻¹ |
Order reverses; requires both A and B invertible |
| Transpose of an inverse | (A⁻¹)ᵀ = (Aᵀ)⁻¹ |
Valid whenever A is invertible |
Dot (inner) product in ℝⁿ |
`u · v = uᵀ v = | |
Cross product in ℝ³ |
` | |
Orthogonal matrix Q |
Qᵀ Q = Q Qᵀ = I (Q⁻¹ = Qᵀ) |
Preserves lengths ` |
Symmetric matrix S |
Sᵀ = S |
All eigenvalues are real; eigenvectors for distinct λ are orthogonal |
Determinants, Inverses, and Rank-Nullity
For a 2 × 2 matrix A = [[a, b], [c, d]], the determinant is det(A) = ad − bc, and when det(A) ≠ 0, the closed-form inverse is:
A⁻¹ = [1 / (ad − bc)] · [[ d, −b ],
[ −c, a ]]
For a 3 × 3 matrix, cofactor expansion along any row i gives det(A) = Σ_{j=1}^3 (−1)^(i+j) a_ij M_ij, where M_ij is the 2 × 2 minor determinant after deleting row i and column j. Choosing a row or column containing zeros cuts calculation time sharply.
| Determinant Rule | Identity | Row / Geometric Effect |
|---|---|---|
| Product / Inverse | det(AB) = det(A)det(B), det(A⁻¹) = 1/det(A) |
Volume scale factors multiply |
Scalar multiple (n×n) |
det(kA) = kⁿ det(A) |
Scales all n axes by k |
| Transpose | det(Aᵀ) = det(A) |
Row rank equals column rank |
| Row swap / Row addition | Swap flips sign; adding c·R_i to R_j keeps det |
Orientation flip vs. area-preserving shear |
| Triangular matrix | det(A) = Π a_ii |
Product of diagonal pivots |
For any m × n matrix A of rank r (number of nonzero pivots in row-echelon form), the four fundamental subspaces partition ℝⁿ and ℝᵐ cleanly:
| Subspace | Ambient Space | Dimension | Orthogonality Partner |
|---|---|---|---|
Column space C(A) |
ℝᵐ |
r |
Left nullspace N(Aᵀ) |
Left nullspace N(Aᵀ) |
ℝᵐ |
m − r |
Column space C(A) |
Row space C(Aᵀ) |
ℝⁿ |
r |
Nullspace N(A) |
Nullspace N(A) |
ℝⁿ |
n − r |
Row space C(Aᵀ) |
The Rank-Nullity Theorem follows immediately: rank(A) + nullity(A) = n (number of columns). Solving multi-loop or multi-node engineering networks—like those encountered in Ohm’s law and AC circuit analysis—requires full column rank r = n so that Ax = b has a unique solution.
Eigenvalues, Eigenvectors, and Matrix Decompositions
A nonzero vector v is an eigenvector of square matrix A with eigenvalue λ if A v = λ v, or equivalently (A − λI) v = 0. Solving the characteristic equation det(A − λI) = 0 yields the eigenvalues; substituting each λ back into (A − λI) v = 0 yields the corresponding eigenspace.
- Two quick verification identities:
tr(A) = Σ λ_ianddet(A) = Π λ_i. - Diagonalization: If
Ahasnlinearly independent eigenvectors collected as columns ofP, thenA = P D P⁻¹whereD = diag(λ₁, …, λ_n), allowing fast matrix powersA^k = P D^k P⁻¹and matrix exponentialse^(At) = P e^(Dt) P⁻¹. - Singular Value Decomposition (SVD): Every
m × nreal matrix factors asA = U Σ Vᵀ, whereU(m × m) andV(n × n) are orthogonal andΣholds nonnegative singular valuesσ₁ ≥ σ₂ ≥ ··· ≥ 0(square roots of nonzero eigenvalues ofAᵀA). - QR Decomposition: Any
m × nmatrix with independent columns factors asA = Q R(orthonormal columnsQ, upper triangularR), providing a numerically stable route to least squares:R x̂ = Qᵀ b.
Worked Linear Algebra Examples
Example 1: Inverse, Linear System, and Eigenpairs of a 2 × 2 Matrix
Problem: Given A = [[4, 1], [2, 3]] and b = [9, 7]ᵀ, (a) compute det(A), A⁻¹, and solve Ax = b, and (b) find the eigenvalues and eigenvectors of A.
Part (a) — Determinant, inverse, and solution:
det(A) = (4)(3) − (1)(2) = 12 − 2 = 10 (≠ 0, so A is invertible)
A⁻¹ = (1/10) · [[ 3, −1 ],
[ −2, 4 ]]
x = A⁻¹ b = (1/10) · [ 3(9) + (−1)(7), (−2)(9) + 4(7) ]ᵀ
= (1/10) · [ 20, 10 ]ᵀ = [ 2, 1 ]ᵀ
Check: 4(2) + 1(1) = 9 and 2(2) + 3(1) = 7.
Part (b) — Eigenvalues and eigenvectors:
det(A − λI) = (4 − λ)(3 − λ) − (1)(2) = λ² − 7λ + 10 = (λ − 5)(λ − 2) = 0
Eigenvalues: λ₁ = 5, λ₂ = 2
Verification: λ₁ + λ₂ = 7 = tr(A) = 4 + 3; λ₁·λ₂ = 10 = det(A)
For λ₁ = 5: (A − 5I)v = [[-1, 1], [2, -2]] v = 0 → v₁ = [1, 1]ᵀ
For λ₂ = 2: (A − 2I)v = [[ 2, 1], [2, 1]] v = 0 → v₂ = [1, −2]ᵀ
Example 2: Least-Squares Line Fit via Normal Equations
Problem: Fit the best straight line y = c₀ + c₁ x in the least-squares sense to the three data points (0, 1), (1, 2), and (2, 5).
Step 1 — Assemble design matrix A and target vector b:
A = [[1, 0], b = [1,
[1, 1], 2,
[1, 2]] 5]ᵀ
Step 2 — Form and solve the Normal Equations AᵀA x̂ = Aᵀb:
AᵀA = [[3, 3], Aᵀb = [1 + 2 + 5, 0 + 2 + 10]ᵀ = [8, 12]ᵀ
[3, 5]]
det(AᵀA) = (3)(5) − (3)(3) = 6
x̂ = (AᵀA)⁻¹ (Aᵀb) = (1/6) [[5, −3], [−3, 3]] [8, 12]ᵀ
= (1/6) [40 − 36, −24 + 36]ᵀ = (1/6) [4, 12]ᵀ = [2/3, 2]ᵀ
The least-squares line is ŷ = 2/3 + 2x. Its predicted values [2/3, 8/3, 14/3] leave residual vector e = b − A x̂ = [1/3, −2/3, 1/3]ᵀ. Checking orthogonality Aᵀ e = [0, 0]ᵀ confirms the residual is strictly perpendicular to the column space of A—a clean geometric check that aligns with both calculus optimization rules and technical problem-solving verification gates.