Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Linear Combinations of Matrices


Symbolic visualization of α·A + β·B = C, in three phases: scale, scale, add.

Dimensions (shared by A and B)?A linear combination is α·A + β·B, where α and β are scalars. The two operands must share the same shape so that the addition is defined; the result has that same shape. Linear combinations are built from two operations already covered: scalar multiplication (scale each operand) and addition (add the scaled operands). The same idea applies to vectors and to matrices — only the shape of the operands differs.
A, B2×3
α·
A2×3
a1,1
a1,2
a1,3
a2,1
a2,2
a2,3
+β·
B2×3
b1,1
b1,2
b1,3
b2,1
b2,2
b2,3
=
C2×3
?
?
?
?
?
?
Step 1 / 20

Step explanations

1Linear combination α·A + β·B
A and B are 2×3. The linear combination α·A + β·B is built in three phases: scale A by α, scale B by β, then add the two scaled matrices. The result C has the same shape.







Key Terms

Linear combination — an expression αA+βB\alpha A + \beta B that scales each matrix by a scalar and adds the results. More generally, c1A1+c2A2++cnAnc_1 A_1 + c_2 A_2 + \cdots + c_n A_n.

Scalar coefficient — the numbers α,β\alpha, \beta (or cic_i) that multiply each matrix in the combination.

Same-shape requirement — all matrices in a linear combination must share identical dimensions so the additions are defined.

Result shape — the linear combination has the same shape as the operands.

Span — the set of all linear combinations of a fixed collection of matrices.

Linear independence — a property of a collection: no matrix in it can be written as a linear combination of the others.

Vector space of matrices — the set of all m×nm \times n matrices forms a vector space under matrix addition and scalar multiplication; linear combinations are its native operation.
Learn More

Getting Started with the Visualizer

Set the shared shape of AA and BB, then watch αA+βB=C\alpha A + \beta B = C build in three phases.

• Use the Dimensions steppers to set the shape of AA and BB (1 to 5 in each direction). CC inherits the shape automatically
• Hover the ? icon for a reminder that linear combinations are built from scalar multiplication plus matrix addition
• Press play or step manually through the scene player
• The animation walks three phases in order: scale AA by α\alpha, scale BB by β\beta, then add the scaled matrices into CC
• The scalars α\alpha and β\beta are shown symbolically — the visualizer focuses on structure, not specific numeric values
Learn More

The Three Phases

The visualizer breaks the operation into three clearly separated phases.

Phase 1 — scale $A$ by $\alpha$: every cell of AA is multiplied by α\alpha in place, one cell per scene; BB stays untouched
Phase 2 — scale $B$ by $\beta$: every cell of BB is multiplied by β\beta in place, one cell per scene; AA is already fully scaled
Phase 3 — add into $C$: each cell of CC is filled with αai,j+βbi,j\alpha a_{i,j} + \beta b_{i,j}, with two curved arrows flowing from AA and BB into CC

This phase order makes the decomposition of a linear combination into scalar multiplication and matrix addition explicit. Both operations are visible on the screen at the same time when phase 3 begins.
Learn More

Reading the Scene Player

Each scene combines highlights, arrows, and a caption.

• In phase 1, the active cell of AA is highlighted primary; the rest of the canvas stays neutral
• In phase 2, the active cell of BB is highlighted secondary
• In phase 3, the active cells of AA and BB are highlighted primary and secondary, and the destination cell of CC is accent; arrows flow from both sources into CC
• Filled cells show their symbolic content — αai,j\alpha a_{i,j}, βbi,j\beta b_{i,j}, or αai,j+βbi,j\alpha a_{i,j} + \beta b_{i,j} — at a font size that scales with the matrix dimensions
• The step log on the right keeps a record of every completed cell across all phases
Learn More

Choosing Dimensions

The dimension steppers control the shape shared by all three matrices.

• Smaller shapes (2×22 \times 2, 2×32 \times 3) make the per-cell flow easy to follow in each phase
• Larger shapes (4×44 \times 4, 5×55 \times 5) demonstrate that the same rule scales; total scenes equal 3×m×n3 \times m \times n plus the intro and outro
• Cell content shrinks automatically as the matrix grows so αai,j+βbi,j\alpha a_{i,j} + \beta b_{i,j} stays readable at the largest shape
• Square and rectangular shapes follow identical rules — linear combinations require only matching shapes between operands
Learn More

What a Linear Combination Is

A linear combination of two matrices AA and BB of the same shape is

C=αA+βB,ci,j=αai,j+βbi,jC = \alpha A + \beta B, \quad c_{i,j} = \alpha \cdot a_{i,j} + \beta \cdot b_{i,j}


More generally, a linear combination of nn matrices is

C=c1A1+c2A2++cnAnC = c_1 A_1 + c_2 A_2 + \cdots + c_n A_n


All matrices must share the same shape, and the result inherits that shape. The operation is built from two simpler ones: scale each matrix by its coefficient, then add the scaled matrices entry by entry.

Linear combinations are the native operation of any vector space — matrices, vectors, polynomials, and functions all support them. For comprehensive theory, see matrix operations.
Learn More

Key Properties

Linear combinations inherit their properties from scalar multiplication and matrix addition.

Closure: a linear combination of m×nm \times n matrices is again m×nm \times n
Commutativity: αA+βB=βB+αA\alpha A + \beta B = \beta B + \alpha A
Associativity: combining linear combinations gives another linear combination
Zero coefficient: if α=0\alpha = 0, the matrix AA drops out entirely
Scaling a linear combination: k(αA+βB)=(kα)A+(kβ)Bk(\alpha A + \beta B) = (k\alpha) A + (k\beta) B
Distributivity: α(A+B)=αA+αB\alpha(A + B) = \alpha A + \alpha B

The structural fact behind all of this is that the set of m×nm \times n matrices forms a vector space, and linear combinations are exactly the operation that vector spaces are designed to support.
Learn More

Why It Matters

Linear combinations are the foundation on which most of linear algebra is built.

Span and basis: the span of a set of matrices is the set of all their linear combinations; a basis is a linearly independent set whose span is the whole space
Linear independence: testing whether c1A1++cnAn=0c_1 A_1 + \cdots + c_n A_n = 0 forces all ci=0c_i = 0
Solving linear systems: a system Ax=bAx = b asks whether bb is a linear combination of the columns of AA
Subspaces: a subspace is a set closed under linear combinations
Coordinate representations: writing a matrix as a linear combination of basis matrices gives its coordinates
Differential equations, optimization, machine learning: every linear model, every superposition principle, every gradient update is a linear combination
Learn More

Worked Example

Take AA, BB as 2×22 \times 2 matrices and α=2\alpha = 2, β=1\beta = -1:

A=(1304),B=(5210)A = \begin{pmatrix} 1 & 3 \\ 0 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 2 \\ 1 & 0 \end{pmatrix}


Scale AA by 2:

2A=(2608)2A = \begin{pmatrix} 2 & 6 \\ 0 & 8 \end{pmatrix}


Scale BB by 1-1:

B=(5210)-B = \begin{pmatrix} -5 & -2 \\ -1 & 0 \end{pmatrix}


Add:

2AB=(3418)2A - B = \begin{pmatrix} -3 & 4 \\ -1 & 8 \end{pmatrix}


Set the visualizer to 2×22 \times 2 and step through to see the three phases animated symbolically.
Learn More

Common Mistakes

A few mistakes recur.

Mixing shapes — every matrix in the combination must have the same shape; no broadcasting
Distributing scalars unevenlyα(A+B)αA+B\alpha(A + B) \neq \alpha A + B; the scalar applies to every matrix it multiplies
Confusing linear combination with matrix product — a linear combination scales and adds, no row-column interaction
Treating a single scalar product as a linear combination of one matrix — technically valid but trivial; the interesting case has at least two matrices
Forgetting that the zero matrix is a trivial linear combination — choosing all coefficients zero produces the zero matrix regardless of the operands
Learn More

Related Concepts

Matrix addition — the additive piece of any linear combination.

Scalar multiplication — the scaling piece of any linear combination.

Span — the set of all linear combinations of a fixed collection.

Linear independence — the property that no matrix in a set is a linear combination of the others.

Basis — a linearly independent set whose linear combinations produce every matrix in the space.

Subspace — a set closed under linear combinations.

Vector space — the abstract setting in which linear combinations live.

Affine combination — a linear combination whose coefficients sum to 1; closely related but distinct.
Learn More