Matrices and linear algebra
A matrix is a table of numbers that represents a system of equations or a linear transformation (rotating, stretching, projecting). This topic explains matrix operations, the determinant, the inverse, the rank and row reduction, and eigenvalues and eigenvectors, which is how linear algebra is used in structures, circuits, vibrations and control.
Operations
Matrices of the same size are added element by element. The product exists if has as many columns as has rows; element is row of times column of :
The product is not commutative: in general . The identity (ones on the diagonal) satisfies , and the transpose swaps rows and columns, with .
Determinant and inverse
The determinant of a square matrix is a number that says how much the transformation scales areas (or volumes); if it is 0, it squashes space into a lower dimension and the matrix has no inverse. For , ; in general it is expanded by cofactors of a row or column, or the matrix is reduced to echelon form and the pivots are multiplied.
For larger sizes the inverse is found by writing and row-reducing to . With it, the system has the unique solution .
| For a square matrix, these are equivalent: |
|---|
| has an inverse |
| the columns are linearly independent |
| has a unique solution for every |
| 0 is not an eigenvalue of |
Rank and row reduction
The reduced row echelon form is reached with row operations (the same as for systems): each nonzero row starts with a 1 (pivot) that is the only nonzero entry of its column. The rank is the number of pivots: how many rows (or columns) are truly independent. Columns without a pivot correspond to free variables.
Eigenvalues and eigenvectors
An eigenvector is a direction the matrix does not turn, it only stretches it by a factor (its eigenvalue): . The eigenvalues are the roots of the characteristic polynomial:
For each , the eigenvectors are the nonzero solutions of . If there are independent eigenvectors, is diagonalizable: , with the vectors in the columns of and the values on the diagonal of . This is how powers are computed (), systems of ODEs are decoupled and vibration modes are found.
Common mistakes
- Multiplying element by element instead of row times column, or assuming .
- Forgetting the sign of the cofactors.
- Writing : the order reverses, .
- Giving the zero vector as an eigenvector, or believing every matrix is diagonalizable.
Worked examples
Example 1Matrix product
Solution
- , , , .
- Multiplying by on the right swaps the columns of . In contrast swaps the rows: .
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «A · B · …»: type A and B in the cells and press Compute. The Answer is .
Example 23 × 3 determinant
Solution
- By cofactors of the first row: .
- . Since it is not 0, the matrix is invertible.
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Determinant»: type the matrix in the cells and press Compute. The Answer is .
Example 32 × 2 inverse
Solution
- .
- . Check: ✓.
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Inverse»: type the matrix in the cells and press Compute. The Answer is with those values; the steps do it by Gauss-Jordan on .
Example 4Rank
Solution
- leaves row 2 as zeros: it is twice the first.
- gives , nonzero. Two pivots remain: rank 2, and therefore .
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Rank»: type the matrix in the cells and press Compute. The Answer is .
Example 5Eigenvalues and eigenvectors
Solution
- .
- : → → .
- : → → . Check: ✓.
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Eigenvalues and eigenvectors»: type the matrix in the cells and press Compute. The Answer is .
- The steps factor the characteristic polynomial and give the algebraic and geometric multiplicities of each value.
Example 6A matrix that cannot be diagonalized
Solution
- : a single eigenvalue, , double (algebraic multiplicity 2).
- → : only the direction (geometric multiplicity 1).
- 2 independent eigenvectors are needed and there is only 1: it is not diagonalizable (it is a shear).
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Diagonalize (A = PDP⁻¹)»: type the matrix in the cells and press Compute. The Answer is «Not diagonalizable (not enough eigenvectors)».
Example 7Determinant with a parameter
Solution
- .
- , which vanishes at and .
Solve it in Simuveliq
- In Math → Symbolic calculator, tab Matrices, Operation = «Determinant»: type the matrix, with
kon the diagonal in the cells and press Compute. The Answer is (invertible if ).