Matrix Operations Example

Matrix operations follow precise dimension rules. Addition and subtraction combine corresponding entries, scalar multiplication scales every entry, and matrix multiplication uses row-by-column dot products. This example performs all four operations and verifies one product entry so the dimensions and arithmetic are easy to follow.

Given A and B, find A + B, A − B, 2A, and AB

Use corresponding-entry operations for the first three parts. For AB, multiply each row of A by each column of B; the inner dimensions must match.

A=[1234],B=[5−120]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad B=\begin{bmatrix}5&-1\\2&0\end{bmatrix}
Key facts used in this example
Addition/subtraction conditionSame dimensions
Scalar multiplicationMultiply every entry by the scalar
Product conditionColumns of A = rows of B
Product order(m × n)(n × p) = m × p

Step-by-step solution

  1. 1

    Add corresponding entries

    Add entries in the same row and column. Both matrices are 2 × 2, so addition is defined.

    A+B=[1+52+(−1)3+24+0]=[6154]A+B=\begin{bmatrix}1+5&2+(-1)\\3+2&4+0\end{bmatrix}=\begin{bmatrix}6&1\\5&4\end{bmatrix}
  2. 2

    Subtract corresponding entries

    Subtract each entry of B from the entry in the same position in A.

    A−B=[1−52−(−1)3−24−0]=[−4314]A-B=\begin{bmatrix}1-5&2-(-1)\\3-2&4-0\end{bmatrix}=\begin{bmatrix}-4&3\\1&4\end{bmatrix}
  3. 3

    Multiply A by the scalar 2

    A scalar multiplies every matrix entry independently.

    2A=[2(1)2(2)2(3)2(4)]=[2468]2A=\begin{bmatrix}2(1)&2(2)\\2(3)&2(4)\end{bmatrix}=\begin{bmatrix}2&4\\6&8\end{bmatrix}
  4. 4

    Check the dimensions for AB

    A is 2 × 2 and B is 2 × 2. The inner dimensions agree, so AB exists and has order 2 × 2.

    (2×2)(2×2)⟶2×2(2\times2)(2\times2)\longrightarrow2\times2
  5. 5

    Compute each row-by-column product

    For example, the top-left entry is 1·5 + 2·2 = 9. Repeat with each row and column pair.

    AB=[1(5)+2(2)1(−1)+2(0)3(5)+4(2)3(−1)+4(0)]=[9−123−3]AB=\begin{bmatrix}1(5)+2(2)&1(-1)+2(0)\\3(5)+4(2)&3(-1)+4(0)\end{bmatrix}=\begin{bmatrix}9&-1\\23&-3\end{bmatrix}

ANSWER

A + B, A − B, 2A, and AB

Addition, subtraction, and scalar multiplication are entrywise. Matrix multiplication is different: it combines rows of the first matrix with columns of the second.

A+B=[6154],A−B=[−4314],2A=[2468],AB=[9−123−3]A+B=\begin{bmatrix}6&1\\5&4\end{bmatrix},\quad A-B=\begin{bmatrix}-4&3\\1&4\end{bmatrix},\quad2A=\begin{bmatrix}2&4\\6&8\end{bmatrix},\quad AB=\begin{bmatrix}9&-1\\23&-3\end{bmatrix}

Verify a product entry

The bottom-left product entry uses the second row of A and first column of B. This row-by-column check confirms the value 23.

(3,4)⋅(5,2)=3(5)+4(2)=15+8=23(3,4)\cdot(5,2)=3(5)+4(2)=15+8=23