Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Operations on Matrices






Manipulating Matrices

Matrices support a family of operations — addition, scalar multiplication, matrix multiplication, transposition, and exponentiation — each with its own rules and dimension requirements. Matrix multiplication stands apart from the rest: it is not commutative, it demands compatible dimensions, and it admits several geometric and algebraic interpretations that make it one of the richest operations in all of mathematics.



Matrix Addition

Two matrices of the same size can be added entry by entry. If AA and BB are both m×nm \times n, their sum is the m×nm \times n matrix with entries

Matrix Addition
(A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij}

For example,

(142305)+(316024)=(434321)\begin{pmatrix} 1 & 4 \\ -2 & 3 \\ 0 & 5 \end{pmatrix} + \begin{pmatrix} 3 & -1 \\ 6 & 0 \\ 2 & -4 \end{pmatrix} = \begin{pmatrix} 4 & 3 \\ 4 & 3 \\ 2 & 1 \end{pmatrix}


If the dimensions do not match, the sum is undefined — there is no way to add a 2×32 \times 3 matrix to a 3×23 \times 2 matrix.

Addition is commutative (A+B=B+AA + B = B + A) and associative ((A+B)+C=A+(B+C)(A + B) + C = A + (B + C)). The zero matrix OO of the same size serves as the additive identity (A+O=AA + O = A), and the additive inverse of AA is A=(aij)-A = (-a_{ij}), so A+(A)=OA + (-A) = O.
A2×3a1,1a1,2a1,3a2,1a2,2a2,3+B2×3b1,1b1,2b1,3b2,1b2,2b2,3=C2×3a1,1+b1,1a1,2+b1,2a1,3+b1,3a2,1+b2,1a2,2+b2,2a2,3+b2,3
A + B, every entry settled

Each entry of the result came from the one pair sitting in the same position, and from nothing else. That is why the two matrices must have identical shapes and why the sum keeps that shape — there is no mechanism here for a row to reach a different row. Run it entry by entry, or switch to subtraction, on the matrix addition visualizer.

Subtraction and scaling in the next two sections work the same way, one position at a time, which is why they share addition's shape rules.

Matrix Notation

Notation

Matrix Notation

Capital letters, double subscripts in a fixed order, multiplication with no symbol at all — and the two reserved letters every matrix equation leans on.
Bold vectors and their components — vector notation; ATA^{T} in row-times-column form — dot product notation.
A=(aij)A = (a_{ij}), an m×nm \times n matrix
The matrix A with entries a-i-j; m by n
Capital letter for the whole array, lowercase with a double subscript for one entry — row first, column second, always: a23a_{23} sits in row 22, column 33. The size m×nm \times n reads “mm by nn” and obeys the same order: rows, then columns.
CasesSubscripts extract from any matrix expression: (A+B)ij(A + B)_{ij} names one entry of the sum, the device the definitions on this page are written in. The ×\times in m×nm \times n is a dimension separator — a third job for the glyph, after arithmetic and the cross product, and this one multiplies nothing.
Also written[aij][a_{ij}] with square brackets — many American texts; this site sets matrices in parentheses. The two bracket styles are pure typography.
Do not confuseReversed subscripts. aija_{ij} and ajia_{ji} name different entries unless the matrix is symmetric — and the transpose is exactly the operation that swaps them.
ABAB
A times B — written with no symbol
Matrix multiplication is written by juxtaposition — no dot, no cross. The bare notation hides a shape contract: (m×n)(n×p)(m \times n)(n \times p) works only because the inner dimensions agree, and delivers m×pm \times p.
CasesOrder is load-bearing: ABBAAB \neq BA in general, so the language splits into premultiplying and postmultiplying. Powers stack the juxtaposition: AnA^n for square AA, with A0=IA^0 = I by convention — the identity II (subscripted InI_n when size matters) is the matrix world's 11, and OO its 00, as in Matrix Addition above.
Also writtenABA \cdot B with an explicit dot, in some European school texts — never with ×\times, which would collide with dimensions and cross products.
Do not confuseScalar habits. From AB=ACAB = AC nothing cancels; (A+B)2(A+B)^2 is A2+AB+BA+B2A^2 + AB + BA + B^2, four terms — the notation looks like ordinary algebra and refuses to behave like it.
ATA^{T}
A transpose
The superscript TT is a label, not an exponent: flip rows and columns, so (AT)ij=aji(A^{T})_{ij} = a_{ji}. The operation itself is The Transpose below.
CasesIt reverses products — (AB)T=BTAT(AB)^{T} = B^{T}A^{T}, order flipped — and characterizes whole matrix types in one equation: A=ATA = A^{T} is symmetry, AT=AA^{T} = -A skew-symmetry, QTQ=IQ^{T}Q = I orthogonality.
Also writtenAA^{\top} with the sans-serif glyph; AA' in econometrics and older texts — the prime again, moonlighting far from derivatives.
Do not confuseA power. ATA^{T} multiplies nothing TT times; the same corner of the symbol carries AnA^{n} (a genuine power), A1A^{-1} (the inverse) and ATA^{T} (a flip) — three superscripts, three unrelated jobs.

Matrix Subtraction

Subtraction is defined as addition of the negative:

Matrix Subtraction
AB=A+(B)A - B = A + (-B)

Entry by entry, (AB)ij=aijbij(A - B)_{ij} = a_{ij} - b_{ij}. The same dimension requirement applies — both matrices must have identical shapes. There is nothing deeper here than combining addition and negation, but it appears often enough to warrant its own notation.

Scalar Multiplication

Multiplying a matrix by a scalar cc scales every entry:

Scalar Multiplication of Matrices
(cA)ij=caij(cA)_{ij} = c \cdot a_{ij}

For example,

2(134052)=(2680104)-2 \begin{pmatrix} 1 & 3 & -4 \\ 0 & 5 & 2 \end{pmatrix} = \begin{pmatrix} -2 & -6 & 8 \\ 0 & -10 & -4 \end{pmatrix}


Scalar multiplication distributes over matrix addition (c(A+B)=cA+cBc(A + B) = cA + cB), distributes over scalar addition ((c+d)A=cA+dA(c + d)A = cA + dA), associates with itself (c(dA)=(cd)Ac(dA) = (cd)A), and has 11 as its identity (1A=A1 \cdot A = A). Multiplying by 00 produces the zero matrix.

Linear Combinations of Matrices

Given matrices A1,A2,,AkA_1, A_2, \dots, A_k of the same size and scalars c1,c2,,ckc_1, c_2, \dots, c_k, the expression

c1A1+c2A2++ckAkc_1 A_1 + c_2 A_2 + \cdots + c_k A_k


is a linear combination of matrices. Addition and scalar multiplication together give the set of all m×nm \times n matrices the structure of a vector space. The dimension of this space is mnmn — one degree of freedom for each entry. The standard basis consists of the mnmn matrices that have a single 11 in one position and zeros everywhere else.

Matrix Multiplication — Definition

For AA of size m×nm \times n and BB of size n×pn \times p, the product ABAB is an m×pm \times p matrix whose (i,j)(i,j) entry is the dot product of row ii of AA with column jj of BB:

Matrix Multiplication
(AB)ij=k=1naikbkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}

The number of columns of AA must equal the number of rows of BB. If this compatibility condition fails, the product is undefined.

Worked Example


(103214)(512306)\begin{pmatrix} 1 & 0 & 3 \\ 2 & -1 & 4 \end{pmatrix} \begin{pmatrix} 5 & 1 \\ 2 & -3 \\ 0 & 6 \end{pmatrix}


The left matrix is 2×32 \times 3 and the right is 3×23 \times 2, so the product is 2×22 \times 2. Computing each entry:

(1)(5)+(0)(2)+(3)(0)=5,(1)(1)+(0)(3)+(3)(6)=19(1)(5) + (0)(2) + (3)(0) = 5, \quad (1)(1) + (0)(-3) + (3)(6) = 19


(2)(5)+(1)(2)+(4)(0)=8,(2)(1)+(1)(3)+(4)(6)=29(2)(5) + (-1)(2) + (4)(0) = 8, \quad (2)(1) + (-1)(-3) + (4)(6) = 29


AB=(519829)AB = \begin{pmatrix} 5 & 19 \\ 8 & 29 \end{pmatrix}


Each entry required n=3n = 3 multiplications and n1=2n - 1 = 2 additions. The full product required m×p=4m \times p = 4 such computations.
A2×3a1,1a1,2a1,3a2,1a2,2a2,3×B3×2b1,1b1,2b2,1b2,2b3,1b3,2=C2×2c1,1c1,2c2,1c2,2
One entry of AB, from a row and a column

The highlighted entry is being built by pairing the marked row of A with the marked column of B, multiplying term by term and summing. Every entry of the product costs one such pass, which is where the shape rule comes from: the row and the column have to be the same length or the pairing runs out. Switch between the row-column, column, and outer-product readings on the matrix multiplication visualizer.

This single-entry view is the definition; the column and row readings later on the page are the same arithmetic grouped differently.

Matrix Multiplication — Properties

Matrix multiplication obeys several familiar algebraic rules and violates one that is deeply ingrained from scalar arithmetic.

Associativity holds whenever all products are defined:

Matrix Multiplication Associativity
(AB)C=A(BC)(AB)C = A(BC)

Distribution holds on both sides:

Matrix Multiplication Distributivity
A(B+C)=AB+AC,(A+B)C=AC+BCA(B + C) = AB + AC, \quad (A + B)C = AC + BC

Scalars pass through freely: c(AB)=(cA)B=A(cB)c(AB) = (cA)B = A(cB). The identity matrix satisfies AI=IA=AAI = IA = A whenever the dimensions are compatible.

Commutativity, however, fails:

Matrix Multiplication Non-Commutativity
ABBA in generalAB \neq BA \text{ in general}

Even when both products happen to be defined, they generally produce different results. For a concrete counterexample, take A=(1200)A = \begin{pmatrix} 1 & 2 \\ 0 & 0 \end{pmatrix} and B=(0034)B = \begin{pmatrix} 0 & 0 \\ 3 & 4 \end{pmatrix}. Then AB=(6800)AB = \begin{pmatrix} 6 & 8 \\ 0 & 0 \end{pmatrix} while BA=(0036)BA = \begin{pmatrix} 0 & 0 \\ 3 & 6 \end{pmatrix}.

Two further properties distinguish matrix multiplication from scalar multiplication. The product of two nonzero matrices can be zero: if A=(1224)A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} and B=(2412)B = \begin{pmatrix} 2 & -4 \\ -1 & 2 \end{pmatrix}, then AB=OAB = O even though neither AA nor BB is zero. Cancellation also fails: AB=ACAB = AC does not imply B=CB = C unless AA is invertible.
Matrix · multiplication

Which laws survive the product

Matrix multiplication inherits most of scalar arithmetic and breaks four rules that are deeply ingrained from it. Every entry states its condition; every failure exhibits the pair that breaks it.

08laws
Unconditional5
i
Associativity(AB)C=A(BC)(AB)C = A(BC)
Lets you drop parentheses entirely in a chain of products — the reason matrix powers are well…
Unconditional
Requires
all products defined

Lets you drop parentheses entirely in a chain of products — the reason matrix powers are well defined without bracketing.

ii
Left distributionA(B+C)=AB+ACA(B + C) = AB + AC
Unconditional
Requires
B,CB, C same shape
iii
Right distribution(A+B)C=AC+BC(A + B)C = AC + BC
Left and right distribution are separate statements and each must be checked, precisely because…
Unconditional
Requires
A,BA, B same shape

Left and right distribution are separate statements and each must be checked, precisely because the product does not commute.

iv
Scalar passagec(AB)=(cA)B=A(cB)c(AB) = (cA)B = A(cB)
Unconditional
Requires
any scalar cc
v
IdentityAI=IA=AAI = IA = A
The one place commutativity is guaranteed — I commutes with everything its shape allows.
Unconditional
Requires
conformable dimensions

The one place commutativity is guaranteed — II commutes with everything its shape allows.

Fails or undefined3
vi
CommutativityABBAAB \neq BA in general
The most consequential failure in the subject.
Fails
Holds when
both diagonal, or B=A1B = A^{-1}, or B=IB = I

The most consequential failure in the subject. It is why the transpose reverses order and why similarity rather than equality is the working notion of "same transformation".

WitnessA = [[1, 2], [0, 0]], B = [[0, 0], [3, 4]]
AB = [[6, 8], [0, 0]]
BA = [[0, 0], [3, 6]]
vii
Zero-product lawAB=OA=OAB = O \nRightarrow A = O or B=OB = O
Matrices are not an integral domain.
Fails
Holds when
either factor invertible

Matrices are not an integral domain. Two nonzero matrices can annihilate each other — which is what a nontrivial null space means at the level of the whole product.

WitnessA = [[1, 2], [2, 4]], B = [[2, −4], [−1, 2]]
AB = O, with neither factor zero
viii
CancellationAB=ACB=CAB = AC \nRightarrow B = C
Fails
Holds when
AA invertible
Fails when
AA singular
WitnessA = [[1, 0], [0, 0]]
B = [[1, 1], [1, 1]], C = [[1, 1], [2, 2]]
AB = AC = [[1, 1], [0, 0]] but B ≠ C
Unconditional
Fails or undefined
AssociativityUnconditional
(AB)C=A(BC)(AB)C = A(BC)
Requires
all products defined
Lets you drop parentheses entirely in a chain of products — the reason matrix powers are well defined without bracketing.
Left distributionUnconditional
A(B+C)=AB+ACA(B + C) = AB + AC
Requires
B,CB, C same shape
Right distributionUnconditional
(A+B)C=AC+BC(A + B)C = AC + BC
Requires
A,BA, B same shape
Left and right distribution are separate statements and each must be checked, precisely because the product does not commute.
Scalar passageUnconditional
c(AB)=(cA)B=A(cB)c(AB) = (cA)B = A(cB)
Requires
any scalar cc
IdentityUnconditional
AI=IA=AAI = IA = A
Requires
conformable dimensions
The one place commutativity is guaranteed — II commutes with everything its shape allows.
CommutativityFails
ABBAAB \neq BA in general
Holds when
both diagonal, or B=A1B = A^{-1}, or B=IB = I
The most consequential failure in the subject. It is why the transpose reverses order and why similarity rather than equality is the working notion of "same transformation".
WitnessA = [[1, 2], [0, 0]], B = [[0, 0], [3, 4]]
AB = [[6, 8], [0, 0]]
BA = [[0, 0], [3, 6]]
Zero-product lawFails
AB=OA=OAB = O \nRightarrow A = O or B=OB = O
Holds when
either factor invertible
Matrices are not an integral domain. Two nonzero matrices can annihilate each other — which is what a nontrivial null space means at the level of the whole product.
WitnessA = [[1, 2], [2, 4]], B = [[2, −4], [−1, 2]]
AB = O, with neither factor zero
CancellationFails
AB=ACB=CAB = AC \nRightarrow B = C
Holds when
AA invertible
Fails when
AA singular
WitnessA = [[1, 0], [0, 0]]
B = [[1, 1], [1, 1]], C = [[1, 1], [2, 2]]
AB = AC = [[1, 1], [0, 0]] but B ≠ C
Four of eight fail. Each failure traces back to the same root — a matrix can collapse directions, and a collapsed direction cannot be recovered. That is what invertibility restores, and why every "holds when" below names it.
Which laws survive the product·/linear-algebra/matrix/operationsLearn Math Class

Matrix Multiplication — Column and Row Interpretations

The entry-by-entry formula is the most common way to define matrix multiplication, but two alternative viewpoints often provide sharper insight.

The column interpretation says that column jj of ABAB is obtained by multiplying AA times column jj of BB:

AB=(Ab1Ab2Abp)AB = \begin{pmatrix} A\mathbf{b}_1 & A\mathbf{b}_2 & \cdots & A\mathbf{b}_p \end{pmatrix}


Each column of the product is a linear combination of the columns of AA, with weights given by the corresponding column of BB. This is the view that connects matrix multiplication to linear transformations: the product ABAB applies the transformation AA to each column of BB independently.

The row interpretation says that row ii of ABAB equals row ii of AA times the entire matrix BB. Each row of the product is a linear combination of the rows of BB, weighted by the entries in the corresponding row of AA.

A third perspective writes the product as a sum of rank-one outer products:

AB=k=1n(column k of A)(row k of B)AB = \sum_{k=1}^{n} (\text{column } k \text{ of } A)(\text{row } k \text{ of } B)


Each term is an m×pm \times p matrix of rank at most one, and their sum is the full product. This decomposition appears in low-rank approximation theory and in the analysis of the singular value decomposition.
Matrix · multiplication

Four ways to read the same product

Every row computes ABAB and every row gives the same answer. What differs is the unit being assembled — a scalar, a column, a row, or a whole rank-one matrix — and each unit makes a different fact obvious.

4readings
One number at a time1
Entry view§ 5the definition
assembled froma single scalar (AB)ij(AB)_{ij}
formula(AB)ij=kaikbkj(AB)_{ij} = \sum_k a_{ik}b_{kj}
natural wherehand computation, proofs
Row ii of AA dotted with column jj of BB. Correct and unilluminating — it says how to get a number out but not what the product is, which is why the three readings below exist.
One vector at a time2
Column view§ 7read BB column by column
assembled froma column of ABAB
formulacolumn jj of AB=AbjAB = A\mathbf{b}_j
natural wherecolumn space, transformations
Each column of the product is AA applied to the corresponding column of BB — so every column of ABAB is a linear combination of the columns of AA. This is why Col(AB)Col(A)\operatorname{Col}(AB) \subseteq \operatorname{Col}(A), and hence why the rank of a product is bounded.
Row view§ 7read AA row by row
assembled froma row of ABAB
formularow ii of AB=aiBAB = \mathbf{a}_i B
natural whererow space, elimination
The mirror statement: every row of ABAB is a combination of the rows of BB. This is the reading that explains why row operations — which are left multiplications — preserve the row space.
One matrix at a time1
Outer product sum§ 7pair column kk of AA with row kk of BB
assembled froma rank-one matrix
formulaAB=kakbkTAB = \sum_k \mathbf{a}_k \mathbf{b}_k^{\mathsf{T}}
natural whereSVD, low-rank approximation
The product as a sum of rank-one pieces. Truncating that sum is exactly what low-rank approximation does, which makes this the reading that matters most in practice and the one taught last.
The definition is the entry view, but it is the one that explains least. Each of the other three is the same sum regrouped, and each is the natural reading somewhere else in the subject — the column view for linear combinations, the outer product for low-rank approximation.
Four ways to read the same product·/linear-algebra/matrix/operationsLearn Math Class
The two vector readings are worth holding together, because between them they explain the rank bound. Every column of ABAB is a combination of the columns of AA, so the column space of the product sits inside that of AA; every row is a combination of the rows of BB, so the row space sits inside that of BB. Rank is the dimension of either, so rank(AB)\operatorname{rank}(AB) cannot exceed the smaller of the two — which is the inequality stated without proof on the rank page.

The Transpose

The transpose of an m×nm \times n matrix AA is the n×mn \times m matrix ATA^T obtained by converting rows into columns:

Transpose Definition
(AT)ij=aji(A^T)_{ij} = a_{ji}

For example,

A=(123456)AT=(142536)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \quad \Longrightarrow \quad A^T = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}


Applying the transpose twice recovers the original matrix:

Transpose Involution
(AT)T=A(A^T)^T = A

The transpose distributes over addition:

Transpose of Sum
(A+B)T=AT+BT(A + B)^T = A^T + B^T

and commutes with scalar multiplication:

Transpose of Scalar Multiple
(cA)T=cAT(cA)^T = c\, A^T

The product rule reverses the order:

Transpose of Product
(AB)T=BTAT(AB)^T = B^T A^T

This reversal is a frequent source of errors and is worth memorizing as a pattern: transposing a product is like reading it backward.

A matrix satisfying A=ATA = A^T is called symmetric. For any matrix AA of any shape, the products ATAA^T A and AATAA^T are both symmetric — this is immediate from the product rule, since (ATA)T=AT(AT)T=ATA(A^T A)^T = A^T (A^T)^T = A^T A.
A3×4a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4AT4×3a1,1a2,1a3,1a1,2a2,2a3,2a1,3a2,3a3,3a1,4a2,4a3,4
Reflection across the main diagonal

Every entry has swapped places with its mirror image across the diagonal, and the entries sitting on the diagonal have not moved at all. Read that way the transpose is one reflection rather than a rule about indices, and it explains at a glance why transposing twice returns the original. Watch it run cell by cell instead on the transpose visualizer.

Because the diagonal is fixed, a matrix equal to its own transpose is exactly one that is symmetric about that line.

Matrix Powers

For a square matrix AA, powers are defined by repeated multiplication:

Matrix Power
A0=I,A1=A,Ak=AAAk factorsA^0 = I, \quad A^1 = A, \quad A^k = \underbrace{A \cdot A \cdots A}_{k \text{ factors}}

The usual exponent laws hold: AjAk=Aj+kA^j A^k = A^{j+k} and (Aj)k=Ajk(A^j)^k = A^{jk}. When AA is invertible, negative powers are defined as Ak=(A1)kA^{-k} = (A^{-1})^k, extending the exponent laws to all integers.

One rule from scalar arithmetic does not carry over. Since matrix multiplication is not commutative, the identity (AB)k=AkBk(AB)^k = A^k B^k is false in general. Expanding (AB)2=ABAB(AB)^2 = ABAB, there is no way to rearrange this into A2B2=AABBA^2 B^2 = AABB without commutativity.

Powers of specific matrix types are particularly well-behaved. For a diagonal matrix D=diag(d1,,dn)D = \text{diag}(d_1, \dots, d_n), the kk-th power is Dk=diag(d1k,,dnk)D^k = \text{diag}(d_1^k, \dots, d_n^k) — each diagonal entry is raised to the kk-th power independently. This simplicity is one of the main reasons diagonalization is so useful: writing A=PDP1A = PDP^{-1} gives Ak=PDkP1A^k = PD^kP^{-1}, reducing an expensive matrix power to a cheap diagonal power.

Elementary Matrices

An elementary matrix is the result of performing a single row operation on the identity matrix. There are three types, corresponding to the three row operations: swapping two rows, multiplying a row by a nonzero scalar, and adding a multiple of one row to another.

The key property is that left-multiplying a matrix AA by an elementary matrix EE performs the corresponding row operation on AA. If EE swaps rows 22 and 33 of the identity, then EAEA swaps rows 22 and 33 of AA. If EE scales row 11 of the identity by 55, then EAEA scales row 11 of AA by 55.

Every elementary matrix is invertible, and its inverse is another elementary matrix of the same type: the inverse of a row swap is the same row swap, the inverse of scaling by kk is scaling by 1/k1/k, and the inverse of adding cc times row ii to row jj is subtracting cc times row ii from row jj.

This leads to a structural result: every invertible matrix can be written as a product of elementary matrices. Since Gaussian elimination reduces an invertible matrix to the identity through a sequence of row operations, each operation corresponds to an elementary matrix, and reversing the sequence expresses the original matrix as their product. This factorization is more conceptual than computational, but it underpins the theoretical foundations of the determinant and the inverse.

Matrix Decompositions

A matrix decomposition (or factorization) expresses a matrix as a product of simpler matrices with known structure. Decompositions are among the most powerful tools in computational linear algebra, converting hard problems into sequences of easy ones.

The LU decomposition writes A=LUA = LU where LL is lower triangular and UU is upper triangular. It captures the essence of Gaussian elimination in matrix form and makes solving linear systems with multiple right-hand sides efficient: once LL and UU are known, each system reduces to two triangular solves.

The QR decomposition writes A=QRA = QR where QQ is orthogonal and RR is upper triangular. It is the foundation of least-squares computation and several eigenvalue algorithms.

The Cholesky decomposition writes A=LLTA = LL^T for symmetric positive definite matrices, achieving the work of LU in roughly half the computation by exploiting symmetry.

The eigendecomposition writes A=PDP1A = PDP^{-1} where DD is diagonal, placing the eigenvalues on the diagonal and the eigenvectors in the columns of PP. It applies only to diagonalizable matrices.

The singular value decomposition writes A=UΣVTA = U\Sigma V^T where UU and VV are orthogonal and Σ\Sigma is diagonal with nonnegative entries. Unlike the eigendecomposition, the SVD exists for every matrix of every shape. It reveals the rank, the fundamental subspaces, and the best low-rank approximation to AA, making it one of the most broadly applicable tools in the subject.

Each of these decompositions has its own page with full derivations and worked examples.
Decomposition Form Requires Primary use
LU A = LU (L lower, U upper triangular) any square matrix (with pivoting) solving Ax = b for many right-hand sides
QR A = QR (Q orthogonal, R upper triangular) any matrix least squares, eigenvalue algorithms
Cholesky A = LLᵀ symmetric positive definite half-cost LU for SPD systems
Eigendecomposition A = PDP⁻¹ (D diagonal) diagonalizable square matrix matrix powers, spectral analysis
SVD A = UΣVᵀ (U, V orthogonal; Σ diagonal ≥ 0) any matrix of any shape rank, fundamental subspaces, best low-rank approximation

Dimension Summary

The dimension requirements for each operation are worth collecting in one place. Addition and subtraction require both matrices to share the same m×nm \times n dimensions, and the result is m×nm \times n. Scalar multiplication imposes no restriction and preserves the original dimensions. The product ABAB requires the column count of AA to match the row count of BB — if AA is m×nm \times n and BB is n×pn \times p, the result is m×pm \times p. The transpose of an m×nm \times n matrix is n×mn \times m. Powers AkA^k require AA to be square and produce a matrix of the same size.

A common source of confusion is the product rule. The product of two n×nn \times n matrices is n×nn \times n, but the product of a 2×32 \times 3 matrix with a 3×53 \times 5 matrix is 2×52 \times 5. The "inner" dimensions must match and are consumed; the "outer" dimensions survive into the result.
Operation Input requirement Result size Key property
Addition / subtraction A and B both m × n m × n commutative; additive identity O
Scalar multiplication A is m × n; c any scalar m × n distributes over both matrix and scalar sum
Linear combination all Aᵢ same m × n shape m × n turns m × n matrices into a vector space of dimension mn
Matrix multiplication A is m × n, B is n × p  (inner dims match) m × p associative, NOT commutative; inner dim consumed
Transpose A is m × n (no other restriction) n × m (Aᵀ)ᵀ = A; (AB)ᵀ = BᵀAᵀ (order reverses)
Power Aᵏ A square (n × n), k ≥ 0 (or k ∈ ℤ if invertible) n × n Aʲ Aᵏ = Aʲ⁺ᵏ; (AB)ᵏ ≠ Aᵏ Bᵏ in general

Matrix Operations FAQ

Does a23a_{23} mean row 2 column 3, or row 3 column 2?

+
Row first, column second, always: a23a_{23} sits in row 22, column 33. The size m×nm \times n follows the same order, rows then columns. Reversing the pair names a different entry, since aija_{ij} and ajia_{ji} agree only when the matrix is symmetric, and swapping them is precisely what the transpose does.Read more →

Is (A+B)2(A + B)^2 equal to A2+2AB+B2A^2 + 2AB + B^2?

+
No. Expanding gives four terms, A2+AB+BA+B2A^2 + AB + BA + B^2, and they cannot be merged because ABAB and BABA are generally different matrices. The same warning applies to cancellation: from AB=ACAB = AC nothing follows about BB and CC. The notation borrows the look of ordinary algebra without the behaviour.Read more →

Why is matrix multiplication written with no symbol at all?

+
Juxtaposition is the convention: ABAB, with no dot and no cross. The bare notation hides a shape contract, since an m×nm \times n times an n×pn \times p works only because the inner dimensions agree, producing m×pm \times p. Note that the ×\times in m×nm \times n is a dimension separator and multiplies nothing.Read more →