ELIAS EBNER

  • Home
  • Blog
  • Courses
  • About

Linear Algebra

  1. Vectors
    1. Scalars
    2. Vectors vs Sets
    3. Addition and Subtraction
    4. Scalar Multiplication
    5. Zero Vectors
    6. Linear Combinations
    7. Real Dot Product
    8. Length of a Vector
    9. Orthogonal Vectors
    10. Parallel Vectors
    11. Angle Between Vectors
    12. Unit Vectors
  2. Matrices
    1. Notation
    2. Indexing
    3. Submatrices
    4. Matrix-by-Vector Product
    5. Addition and Subtraction
    6. Scalar Multiplication
    7. Transpose
    8. Symmetries
    9. Matrix Multiplication
    10. Identity Matrix
    11. Non-Negative Integer Powers
    12. Reverse Order Law of Transposition
  3. Linear Systems
    1. Inverse Matrices
    2. Singular Matrices
    3. Linear Dependence
    4. Solutions
  4. Planes
    1. Vector Cross Product
  5. Gaussian Elimination
Linear Algebra โ€บMatrices โ€บAddition and Subtraction

Matrix Addition and Subtraction

Just like vectors, you can add and subtract matrices. The process is similar.

For both of these operations, the matrices must be of the same size. That is, if we want to add two matrices AAA and BBB, they both have to be of size mร—nm \times nmร—n. The same is true for subtraction.

Addition

The way addition is defined for two matrices of size mร—nm \times nmร—n is as follows:

For each row iii and each column jjj:

[A+B]ij=[A]ij+[B]ij. [A + B]_{ij} = [A]_{ij} + [B]_{ij}.[A+B]ijโ€‹=[A]ijโ€‹+[B]ijโ€‹.

That means that you must add each element at position ijijij of matrix AAA with the corresponding element at position ijijij of matrix BBB. That gives you the element of the resulting matrix at position ijijij.

Another way of expressing this, which might make it more clear:

A+B=[a11+b11a12+b12โ‹ฏa1n+b1na21+b21a22+b22โ‹ฏa2n+b2nโ‹ฎโ‹ฎโ‹ฑโ‹ฎam1+bm1am2+bm2โ‹ฏamn+bmn].A + B = \begin{bmatrix} a_{11} + b_{11} & a_{12} + b_{12} & \cdots & a_{1n} + b_{1n} \\ a_{21} + b_{21} & a_{22} + b_{22} & \cdots & a_{2n} + b_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} + b_{m1} & a_{m2} + b_{m2} & \cdots & a_{mn} + b_{mn} \\ \end{bmatrix}.A+B=โ€‹a11โ€‹+b11โ€‹a21โ€‹+b21โ€‹โ‹ฎam1โ€‹+bm1โ€‹โ€‹a12โ€‹+b12โ€‹a22โ€‹+b22โ€‹โ‹ฎam2โ€‹+bm2โ€‹โ€‹โ‹ฏโ‹ฏโ‹ฑโ‹ฏโ€‹a1nโ€‹+b1nโ€‹a2nโ€‹+b2nโ€‹โ‹ฎamnโ€‹+bmnโ€‹โ€‹โ€‹.

Example

Here is a concrete numerical example.

Take two matrices

A=[โˆ’8โˆ’84โˆ’28โˆ’19โˆ’766โˆ’65]A = \begin{bmatrix} -8 & -8 & 4 \\ -2 & 8 & -1 \\ 9 & -7 & 6 \\ 6 & -6 & 5 \end{bmatrix}A=โ€‹โˆ’8โˆ’296โ€‹โˆ’88โˆ’7โˆ’6โ€‹4โˆ’165โ€‹โ€‹

and

B=[705โˆ’65376138โˆ’2].B = \begin{bmatrix} 7 & 0 & 5 \\ -6 & 5 & 3 \\ 7 & 6 & 1 \\ 3 & 8 & -2 \end{bmatrix}.B=โ€‹7โˆ’673โ€‹0568โ€‹531โˆ’2โ€‹โ€‹.

We compute

A+B=[โˆ’8โˆ’84โˆ’28โˆ’19โˆ’766โˆ’65]+[705โˆ’65376138โˆ’2]=[โˆ’8+7โˆ’8+04+5โˆ’2โˆ’68+5โˆ’1+39+7โˆ’7+66+16+3โˆ’6+85โˆ’2]=[โˆ’1โˆ’89โˆ’813216โˆ’17923]\begin{align*} A + B &= \begin{bmatrix} -8 & -8 & 4 \\ -2 & 8 & -1 \\ 9 & -7 & 6 \\ 6 & -6 & 5 \end{bmatrix} + \begin{bmatrix} 7 & 0 & 5 \\ -6 & 5 & 3 \\ 7 & 6 & 1 \\ 3 & 8 & -2 \end{bmatrix} \\ &= \begin{bmatrix} -8 + 7 & -8 + 0 & 4 + 5 \\ -2 - 6 & 8 + 5 & -1 + 3 \\ 9 + 7 & -7 + 6 & 6 + 1 \\ 6 + 3 & -6 + 8 & 5 - 2 \end{bmatrix} \\ &= \begin{bmatrix} -1 & -8 & 9 \\ -8 & 13 & 2 \\ 16 & -1 & 7 \\ 9 & 2 & 3 \\ \end{bmatrix} \end{align*}A+Bโ€‹=โ€‹โˆ’8โˆ’296โ€‹โˆ’88โˆ’7โˆ’6โ€‹4โˆ’165โ€‹โ€‹+โ€‹7โˆ’673โ€‹0568โ€‹531โˆ’2โ€‹โ€‹=โ€‹โˆ’8+7โˆ’2โˆ’69+76+3โ€‹โˆ’8+08+5โˆ’7+6โˆ’6+8โ€‹4+5โˆ’1+36+15โˆ’2โ€‹โ€‹=โ€‹โˆ’1โˆ’8169โ€‹โˆ’813โˆ’12โ€‹9273โ€‹โ€‹โ€‹

Subtraction

Subtraction follows a similar principle, where for two matrices of size mร—nm \times nmร—n:

For each row iii and column jjj:

[Aโˆ’B]ij=[A]ijโˆ’[B]ij, [A - B]_{ij} = [A]_{ij} - [B]_{ij},[Aโˆ’B]ijโ€‹=[A]ijโ€‹โˆ’[B]ijโ€‹,

or

Aโˆ’B=[a11โˆ’b11a12โˆ’b12โ‹ฏa1nโˆ’b1na21โˆ’b21a22โˆ’b22โ‹ฏa2nโˆ’b2nโ‹ฎโ‹ฎโ‹ฑโ‹ฎam1โˆ’bm1am2โˆ’bm2โ‹ฏamnโˆ’bmn].A - B = \begin{bmatrix} a_{11} - b_{11} & a_{12} - b_{12} & \cdots & a_{1n} - b_{1n} \\ a_{21} - b_{21} & a_{22} - b_{22} & \cdots & a_{2n} - b_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} - b_{m1} & a_{m2} - b_{m2} & \cdots & a_{mn} - b_{mn} \\ \end{bmatrix}.Aโˆ’B=โ€‹a11โ€‹โˆ’b11โ€‹a21โ€‹โˆ’b21โ€‹โ‹ฎam1โ€‹โˆ’bm1โ€‹โ€‹a12โ€‹โˆ’b12โ€‹a22โ€‹โˆ’b22โ€‹โ‹ฎam2โ€‹โˆ’bm2โ€‹โ€‹โ‹ฏโ‹ฏโ‹ฑโ‹ฏโ€‹a1nโ€‹โˆ’b1nโ€‹a2nโ€‹โˆ’b2nโ€‹โ‹ฎamnโ€‹โˆ’bmnโ€‹โ€‹โ€‹.

Example

Take two matrices

A=[โˆ’64โˆ’6โˆ’910โˆ’2]A = \begin{bmatrix} -6 & 4 \\ -6 & -9 \\ 10 & -2 \end{bmatrix}A=โ€‹โˆ’6โˆ’610โ€‹4โˆ’9โˆ’2โ€‹โ€‹

and

B=[0โˆ’86โˆ’54โˆ’6].B = \begin{bmatrix} 0 & -8 \\ 6 & -5 \\ 4 & -6 \end{bmatrix}.B=โ€‹064โ€‹โˆ’8โˆ’5โˆ’6โ€‹โ€‹.

We compute

Aโˆ’B=[โˆ’64โˆ’6โˆ’910โˆ’2]โˆ’[0โˆ’86โˆ’54โˆ’6]=[โˆ’6โˆ’04โˆ’(โˆ’8)โˆ’6โˆ’6โˆ’9โˆ’(โˆ’5)10โˆ’4โˆ’2โˆ’(โˆ’6)]=[โˆ’612โˆ’12โˆ’464].\begin{align*} A - B &= \begin{bmatrix} -6 & 4 \\ -6 & -9 \\ 10 & -2 \end{bmatrix} - \begin{bmatrix} 0 & -8 \\ 6 & -5 \\ 4 & -6 \end{bmatrix} \\ &= \begin{bmatrix} -6 - 0 & 4 - (-8) \\ -6 - 6 & -9 - (-5) \\ 10 - 4 & -2 - (-6) \\ \end{bmatrix} \\ &= \begin{bmatrix} -6 & 12 \\ -12 & -4 \\ 6 & 4 \end{bmatrix}. \end{align*}Aโˆ’Bโ€‹=โ€‹โˆ’6โˆ’610โ€‹4โˆ’9โˆ’2โ€‹โ€‹โˆ’โ€‹064โ€‹โˆ’8โˆ’5โˆ’6โ€‹โ€‹=โ€‹โˆ’6โˆ’0โˆ’6โˆ’610โˆ’4โ€‹4โˆ’(โˆ’8)โˆ’9โˆ’(โˆ’5)โˆ’2โˆ’(โˆ’6)โ€‹โ€‹=โ€‹โˆ’6โˆ’126โ€‹12โˆ’44โ€‹โ€‹.โ€‹

Properties of Matrix Addition

Because of its definition in terms of scalar addition, matrix addition inherits its algebraic properties.

Commutative Property

For two matrices AAA and BBB, the order of the operands does not make a difference:

A+B=B+A.A + B = B + A.A+B=B+A.

Associative Property

For three matrices AAA, BBB, and CCC:

(A+B)+C=A+(B+C). (A + B) + C = A + (B + C).(A+B)+C=A+(B+C).

Closure Property

If AAA and BBB are both mร—nm \times nmร—n matrices, then A+BA + BA+B is also an mร—nm \times nmร—n matrix.

Additive Identity

For some matrix AAA of size mร—nm \times nmร—n, if 0mร—n0_{m \times n}0mร—nโ€‹ is the zero matrix (just like the zero vector, it is a matrix consisting of all 000) of size mร—nm \times nmร—n:

A+0mร—n=A.A + 0_{m \times n} = A.A+0mร—nโ€‹=A.

Additive Inverse

If AAA is a matrix of size mร—nm \times nmร—n:

Aโˆ’A=0mร—n.A - A = 0_{m \times n}.Aโˆ’A=0mร—nโ€‹.

Properties of Matrix Subtraction

Just like with matrix addition, matrix subtraction inherits all the properties from scalar subtraction. That means itโ€™s non-commutative and non-associative. That means that generally,

Aโˆ’Bโ‰ Bโˆ’A,A - B \ne B - A,Aโˆ’B๎€ =Bโˆ’A,

and

(Aโˆ’B)โˆ’Cโ‰ Aโˆ’(Bโˆ’C).(A - B) - C \ne A - (B - C).(Aโˆ’B)โˆ’C๎€ =Aโˆ’(Bโˆ’C).
Previous
Multiplying a Vector by a Matrix
Next
Scalar Multiplication of a Matrix
This website does not collect personal data, does not use cookies, and does not perform any tracking.