Tutorials › Linear Algebra › Proving Linearity of Matrix-Vector Multiplication

Vectors and Linear Combinations · Tutorial 135 of 1000

Proving Linearity of Matrix-Vector Multiplication

Learn why a fixed matrix sends sums to sums and scalar multiples to scalar multiples, and verify these properties with concrete calculations.

Beginner 8 min read

What You'll Learn

  • State the dimensions needed for a matrix-vector linearity claim.
  • Prove the addition identity by comparing each coordinate.
  • Prove the scalar-multiplication identity, including the zero-scalar case.
  • Apply both identities to concrete matrix-vector products.
  • Check linearity calculations by evaluating both sides directly.
  • Recognize and correct a common error involving the action of a matrix on a sum.

What Must Be Proved

A matrix-vector product is built from sums and scalar multiples of entries. This makes it plausible that multiplying by a fixed matrix should respect addition and scalar multiplication, but plausibility is not a proof. We will establish both identities by examining each coordinate of the resulting vectors. The argument works for rectangular matrices as well as square ones, provided the dimensions match.

Throughout this tutorial, scalars are real. Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), and let \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) be column vectors. The products \(\mathbf{A}\mathbf{x}\) and \(\mathbf{A}\mathbf{y}\) are in \(\mathbb{R}^m\), as is \(\mathbf{A}(\mathbf{x}+\mathbf{y})\). For \(c\in\mathbb{R}\), both \(\mathbf{A}(c\mathbf{x})\) and \(c(\mathbf{A}\mathbf{x})\) are also in \(\mathbb{R}^m\). These dimension checks tell us that the equations we want to prove are meaningful.

Definition: A function \(T:\mathbb{R}^n\to\mathbb{R}^m\) is linear if, for every \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and every \(c\in\mathbb{R}\), it satisfies \(T(\mathbf{x}+\mathbf{y})=T(\mathbf{x})+T(\mathbf{y})\) and \(T(c\mathbf{x})=cT(\mathbf{x})\). The first identity preserves addition; the second preserves scalar multiplication.

The word “fixed” matters: we use the same matrix \(\mathbf{A}\) throughout each identity. We do not claim that multiplying by one matrix is the same operation as multiplying by a different matrix. To prove the identities, write \(\mathbf{A}=(a_{ij})\), where \(a_{ij}\) is the entry in row \(i\) and column \(j\). If the coordinates of \(\mathbf{x}\) are \(x_1,\dots,x_n\), then the \(i\)th coordinate of \(\mathbf{A}\mathbf{x}\) is \(\sum_{j=1}^n a_{ij}x_j\). This coordinate formula is the only fact about matrix-vector multiplication needed for the proof.

The Coordinatewise Proof

Theorem: For every \(\mathbf{A}\in\mathbb{R}^{m\times n}\), the function \(T:\mathbb{R}^n\to\mathbb{R}^m\) defined by \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) is linear. In particular, for all \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and \(c\in\mathbb{R}\), \(\mathbf{A}(\mathbf{x}+\mathbf{y})=\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}\) and \(\mathbf{A}(c\mathbf{x})=c(\mathbf{A}\mathbf{x})\).

Proof. Write \(x_j\) and \(y_j\) for the \(j\)th coordinates of \(\mathbf{x}\) and \(\mathbf{y}\). To prove the addition identity, fix any row index \(i\) with \(1\le i\le m\). The \(i\)th coordinate of the left-hand side is

$$ \bigl(\mathbf{A}(\mathbf{x}+\mathbf{y})\bigr)_i =\sum_{j=1}^{n}a_{ij}(x_j+y_j) =\sum_{j=1}^{n}a_{ij}x_j+\sum_{j=1}^{n}a_{ij}y_j =(\mathbf{A}\mathbf{x})_i+(\mathbf{A}\mathbf{y})_i. $$

The second equality uses distributivity of real multiplication over addition, applied to each term of the finite sum. The last expression is the \(i\)th coordinate of \(\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}\). Since this equality holds for every \(i\) from \(1\) to \(m\), the two vectors have equal coordinates and therefore are equal.

For scalar multiplication, fix the same kind of index \(i\). Then

$$ \bigl(\mathbf{A}(c\mathbf{x})\bigr)_i =\sum_{j=1}^{n}a_{ij}(cx_j) =c\sum_{j=1}^{n}a_{ij}x_j =c(\mathbf{A}\mathbf{x})_i. $$

Here \(c\) can be any real number, including \(0\); the calculation does not divide by \(c\) or require it to be nonzero. Again, equality in every coordinate proves \(\mathbf{A}(c\mathbf{x})=c(\mathbf{A}\mathbf{x})\). Thus the function \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) satisfies both conditions in the definition of a linear function. \(\square\)

The coordinate proof also indicates what the result does and does not say. It applies to any real \(m\times n\) matrix and inputs in \(\mathbb{R}^n\). No square-matrix assumption is needed. It also relies on using the same entries \(a_{ij}\) on both sides: the proof expands the left and right sides using one fixed matrix.

Applying Both Identities

Worked Example: Addition and a Negative Scalar

Let \(\mathbf{A}=\begin{bmatrix}2&-1\\3&4\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}1\\2\end{bmatrix}\), and \(\mathbf{y}=\begin{bmatrix}3\\-1\end{bmatrix}\). Check the addition identity and the scalar identity for \(c=-2\).

First compute each matrix-vector product from its rows:

$$ \mathbf{A}\mathbf{x} =\begin{bmatrix}2(1)+(-1)(2)\\3(1)+4(2)\end{bmatrix} =\begin{bmatrix}0\\11\end{bmatrix}, \qquad \mathbf{A}\mathbf{y} =\begin{bmatrix}2(3)+(-1)(-1)\\3(3)+4(-1)\end{bmatrix} =\begin{bmatrix}7\\5\end{bmatrix}. $$

Adding these results gives \(\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}=\begin{bmatrix}7\\16\end{bmatrix}\). On the other side, \(\mathbf{x}+\mathbf{y}=\begin{bmatrix}4\\1\end{bmatrix}\), so

$$ \mathbf{A}(\mathbf{x}+\mathbf{y}) =\begin{bmatrix}2(4)+(-1)(1)\\3(4)+4(1)\end{bmatrix} =\begin{bmatrix}7\\16\end{bmatrix}. $$

The two sides agree. For \(c=-2\), first scale the input: \((-2)\mathbf{x}=\begin{bmatrix}-2\\-4\end{bmatrix}\). Then

$$ \mathbf{A}\bigl((-2)\mathbf{x}\bigr) =\begin{bmatrix}2(-2)+(-1)(-4)\\3(-2)+4(-4)\end{bmatrix} =\begin{bmatrix}0\\-22\end{bmatrix}, \qquad (-2)(\mathbf{A}\mathbf{x}) =(-2)\begin{bmatrix}0\\11\end{bmatrix} =\begin{bmatrix}0\\-22\end{bmatrix}. $$

Check: both calculations give the same column vector for addition, and both give \(\begin{bmatrix}0\\-22\end{bmatrix}\) for scalar multiplication.

This example uses a square matrix, but that shape is not essential. For a rectangular matrix, the input and output live in different-sized coordinate spaces. The identities still hold because they compare vectors in the same output space, \(\mathbb{R}^m\).

Worked Example: A Rectangular Matrix

Let \(\mathbf{A}=\begin{bmatrix}1&0&-2\\2&-1&1\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}1\\2\\-1\end{bmatrix}\), and \(\mathbf{y}=\begin{bmatrix}0\\-1\\3\end{bmatrix}\). Verify addition and scalar multiplication with \(c=3\). Here \(\mathbf{A}\) has three columns, so its inputs have three coordinates; its two rows produce outputs with two coordinates.

Compute the products separately:

$$ \mathbf{A}\mathbf{x} =\begin{bmatrix}1(1)+0(2)+(-2)(-1)\\2(1)+(-1)(2)+1(-1)\end{bmatrix} =\begin{bmatrix}3\\-1\end{bmatrix}, \qquad \mathbf{A}\mathbf{y} =\begin{bmatrix}1(0)+0(-1)+(-2)(3)\\2(0)+(-1)(-1)+1(3)\end{bmatrix} =\begin{bmatrix}-6\\4\end{bmatrix}. $$

Their sum is \(\begin{bmatrix}-3\\3\end{bmatrix}\). The input sum is \(\mathbf{x}+\mathbf{y}=\begin{bmatrix}1\\1\\2\end{bmatrix}\), and its product is

$$ \mathbf{A}(\mathbf{x}+\mathbf{y}) =\begin{bmatrix}1(1)+0(1)+(-2)(2)\\2(1)+(-1)(1)+1(2)\end{bmatrix} =\begin{bmatrix}-3\\3\end{bmatrix}. $$

For scalar multiplication, \(3\mathbf{y}=\begin{bmatrix}0\\-3\\9\end{bmatrix}\), giving

$$ \mathbf{A}(3\mathbf{y}) =\begin{bmatrix}1(0)+0(-3)+(-2)(9)\\2(0)+(-1)(-3)+1(9)\end{bmatrix} =\begin{bmatrix}-18\\12\end{bmatrix}, \qquad 3(\mathbf{A}\mathbf{y}) =3\begin{bmatrix}-6\\4\end{bmatrix} =\begin{bmatrix}-18\\12\end{bmatrix}. $$

Check: the addition calculation agrees in both coordinates, and the two scalar-multiplication calculations both give \(\begin{bmatrix}-18\\12\end{bmatrix}\). The outputs have two coordinates, as required by the two rows of \(\mathbf{A}\).

Combining the Identities

The two defining identities can be applied in succession. This is useful when an input is already written as a sum of scalar multiples. The statement below follows directly from the identities just proved; it does not require a new matrix rule.

Corollary: For a fixed \(\mathbf{A}\in\mathbb{R}^{m\times n}\), for all \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and \(a,b\in\mathbb{R}\), \(\mathbf{A}(a\mathbf{x}+b\mathbf{y})=a(\mathbf{A}\mathbf{x})+b(\mathbf{A}\mathbf{y})\).

Proof. Set \(\mathbf{u}=a\mathbf{x}\) and \(\mathbf{v}=b\mathbf{y}\). The addition identity gives \(\mathbf{A}(a\mathbf{x}+b\mathbf{y})=\mathbf{A}(a\mathbf{x})+\mathbf{A}(b\mathbf{y})\). Applying the scalar identity to each term gives \(\mathbf{A}(a\mathbf{x})=a(\mathbf{A}\mathbf{x})\) and \(\mathbf{A}(b\mathbf{y})=b(\mathbf{A}\mathbf{y})\). Substitution yields the stated equation. This reasoning also covers \(a=0\) or \(b=0\), because the scalar identity holds for zero scalars. \(\square\)

Worked Example: A Scaled Sum in Three Coordinates

Let \(\mathbf{A}=\begin{bmatrix}1&2\\-2&0\\3&-1\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}2\\-1\end{bmatrix}\), \(\mathbf{y}=\begin{bmatrix}-1\\3\end{bmatrix}\), and \(c=\tfrac12\). Check that scaling the sum before multiplying gives the same result as scaling the product of the sum.

First calculate each product:

$$ \mathbf{A}\mathbf{x} =\begin{bmatrix}1(2)+2(-1)\\-2(2)+0(-1)\\3(2)+(-1)(-1)\end{bmatrix} =\begin{bmatrix}0\\-4\\7\end{bmatrix}, \qquad \mathbf{A}\mathbf{y} =\begin{bmatrix}1(-1)+2(3)\\-2(-1)+0(3)\\3(-1)+(-1)(3)\end{bmatrix} =\begin{bmatrix}5\\2\\-6\end{bmatrix}. $$

Thus \(\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}=\begin{bmatrix}5\\-2\\1\end{bmatrix}\). Directly, \(\mathbf{x}+\mathbf{y}=\begin{bmatrix}1\\2\end{bmatrix}\), and

$$ \mathbf{A}(\mathbf{x}+\mathbf{y}) =\begin{bmatrix}1(1)+2(2)\\-2(1)+0(2)\\3(1)+(-1)(2)\end{bmatrix} =\begin{bmatrix}5\\-2\\1\end{bmatrix}. $$

Now scale the input sum by \(\tfrac12\): \(\tfrac12(\mathbf{x}+\mathbf{y})=\begin{bmatrix}\tfrac12\\1\end{bmatrix}\). Multiplication gives

$$ \mathbf{A}\left(\frac12(\mathbf{x}+\mathbf{y})\right) =\begin{bmatrix}\frac12+2\\-2\left(\frac12\right)+0(1)\\3\left(\frac12\right)-1\end{bmatrix} =\begin{bmatrix}\frac52\\-1\\\frac12\end{bmatrix}. $$

Scaling the previously computed product gives \(\tfrac12\begin{bmatrix}5\\-2\\1\end{bmatrix}=\begin{bmatrix}\tfrac52\\-1\\\tfrac12\end{bmatrix}\).

Check: the two routes give exactly \(\begin{bmatrix}\tfrac52\\-1\\\tfrac12\end{bmatrix}\). In this calculation the input has two coordinates and the output has three, consistent with the \(3\times2\) size of \(\mathbf{A}\).

Consequences and a Common Mistake

The identities quickly give familiar special cases. Taking \(c=0\) in \(\mathbf{A}(c\mathbf{x})=c(\mathbf{A}\mathbf{x})\) shows that \(\mathbf{A}\mathbf{0}=\mathbf{0}\). Taking \(c=-1\) shows that \(\mathbf{A}(-\mathbf{x})=-(\mathbf{A}\mathbf{x})\). These are consequences of the scalar identity, not separate assumptions about matrix multiplication. They can also serve as quick checks on a proposed calculation.

Common mistake: applying the matrix to only one term. Consider \(\mathbf{A}=\begin{bmatrix}1&2\\0&-1\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}1\\0\end{bmatrix}\), and \(\mathbf{y}=\begin{bmatrix}0\\1\end{bmatrix}\). A tempting but wrong calculation is \(\mathbf{A}(\mathbf{x}+\mathbf{y})=\mathbf{A}\mathbf{x}+\mathbf{y}\). It gives \(\mathbf{A}\mathbf{x}=\begin{bmatrix}1\\0\end{bmatrix}\), so the incorrect right-hand side is \(\begin{bmatrix}1\\1\end{bmatrix}\). The correction is to apply \(\mathbf{A}\) to both terms: \(\mathbf{A}\mathbf{y}=\begin{bmatrix}2\\-1\end{bmatrix}\), and therefore \(\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}=\begin{bmatrix}3\\-1\end{bmatrix}\). Directly, \(\mathbf{x}+\mathbf{y}=\begin{bmatrix}1\\1\end{bmatrix}\), so \(\mathbf{A}(\mathbf{x}+\mathbf{y})=\begin{bmatrix}3\\-1\end{bmatrix}\), as the addition identity requires.

When checking a linearity calculation, keep the two sides separate until each is evaluated. First compute the input sum or scaled input; then multiply by the matrix. On the other side, multiply the inputs separately and combine the resulting output vectors. Check that input vectors have \(n\) coordinates, output vectors have \(m\) coordinates, and that the final coordinates agree. This routine catches both arithmetic errors and dimension mismatches.

Check Your Understanding

For each question, state the dimensions and use the two linearity identities where appropriate.

  1. For \(\mathbf{A}=\begin{bmatrix}1&-1\\2&0\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}1\\3\end{bmatrix}\), and \(\mathbf{y}=\begin{bmatrix}2\\-1\end{bmatrix}\), verify \(\mathbf{A}(\mathbf{x}+\mathbf{y})=\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}\).
  2. For the same matrix and \(\mathbf{x}\), check \(\mathbf{A}(-3\mathbf{x})=-3(\mathbf{A}\mathbf{x})\).
  3. In the coordinate proof of the addition identity, why is it enough to fix a row index \(i\) and then show equality for every possible \(i\)?
  4. For an \(m\times n\) matrix \(\mathbf{A}\), what are the dimensions of \(\mathbf{x}\), \(\mathbf{A}\mathbf{x}\), and \(\mathbf{A}\mathbf{y}\) when the products are defined?
  5. Use the addition and scalar identities to explain why \(\mathbf{A}(a\mathbf{x}+b\mathbf{y})=a(\mathbf{A}\mathbf{x})+b(\mathbf{A}\mathbf{y})\), including the cases where a coefficient is zero.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon