# Linear Algebra/Addition, Multiplication, and Transpose

## Addition and subtraction

Two matrices can only be added or subtracted if they have the same size. Matrix addition and subtraction are done entry-wise, which means that each entry in A+B is the sum of the corresponding entries in A and B.

${\displaystyle A={\begin{bmatrix}7&&5&&3\\4&&0&&5\end{bmatrix}}\qquad B={\begin{bmatrix}1&&1&&1\\-1&&3&&2\end{bmatrix}}}$

Here is an example of matrix addition

${\displaystyle A+B={\begin{bmatrix}7+1&&5+1&&3+1\\4-1&&0+3&&5+2\end{bmatrix}}={\begin{bmatrix}8&&6&&4\\3&&3&&7\end{bmatrix}}}$

And an example of subtraction

${\displaystyle A-B={\begin{bmatrix}7-1&&5-1&&3-1\\4+1&&0-3&&5-2\end{bmatrix}}={\begin{bmatrix}6&&4&&2\\5&&-3&&3\end{bmatrix}}}$

Remember you can not add or subtract two matrices of different sizes.

The following rules applies to sums and scalar multiples of matrices.
Let ${\displaystyle A,B,C}$  be matrices of the same size, and let ${\displaystyle r,s}$  be scalars.

• ${\displaystyle A+B=B+A}$
• ${\displaystyle (A+B)+C=A+(B+C)}$
• ${\displaystyle A+0=A}$
• ${\displaystyle r(A+B)=rA+rB}$
• ${\displaystyle (r+s)A=rA+sA}$
• ${\displaystyle r(sA)=(rs)A}$

## Multiplication

What is matrix multiplication? You can multiply two matrices if, and only if, the number of columns in the first matrix equals the number of rows in the second matrix.

Otherwise, the product of two matrices is undefined. The product matrix's dimensions are

${\displaystyle \to ({\text{rows of first matrix}})\times ({\text{columns of the second matrix}})}$

In above multiplication, the matrices cannot be multiplied since the number of columns in the 1st one, matrix ${\displaystyle A}$  is not equals the number of rows in the 2nd, matrix ${\displaystyle B}$  . The Dimensions of the product matrix. Rows of 1st matrix × Columns of 2nd

## Powers

If ${\displaystyle A}$  is an ${\displaystyle n\times n}$  matrix and if ${\displaystyle k}$  is a positive integer, then ${\displaystyle A^{k}}$  denotes the product of ${\displaystyle k}$  copies of ${\displaystyle A}$

${\displaystyle A^{k}={\begin{matrix}\underbrace {A\cdots A} \\k\end{matrix}}}$

If ${\displaystyle A}$  is non-zero and if ${\displaystyle {\rm {x}}}$  is in ${\displaystyle \mathbb {R} ^{n}}$  , then ${\displaystyle A^{k}{\rm {x}}}$  is the result of left-multiplying ${\displaystyle {\rm {x}}}$  by ${\displaystyle A}$  repeatedly ${\displaystyle k}$  times. If ${\displaystyle k=0}$  , then ${\displaystyle A^{0}{\rm {x}}}$  should be ${\displaystyle {\rm {x}}}$  itself. Thus ${\displaystyle A^{0}}$  is interpreted as the identity matrix.

## Transpose

Given the ${\displaystyle m\times n}$  matrix ${\displaystyle A}$  , the transpose of ${\displaystyle A}$  is the ${\displaystyle n\times m}$  , denoted ${\displaystyle A^{T}}$  , whose columns are formed from the corresponding rows of ${\displaystyle A}$  .

For example

${\displaystyle A={\begin{bmatrix}a&&b\\c&&d\end{bmatrix}}\qquad B={\begin{bmatrix}3&&5\\2&&7\\6&&9\\1&&0\\5&&2\end{bmatrix}}}$
${\displaystyle A^{T}={\begin{bmatrix}a&&c\\b&&d\end{bmatrix}}\qquad B^{T}={\begin{bmatrix}3&&2&&6&&1&&5\\5&&7&&9&&0&&2\end{bmatrix}}}$

The following rules applied when working with transposing

1. ${\displaystyle (A^{T})^{T}=A}$
2. ${\displaystyle (A+B)^{T}=A^{T}+B^{T}}$
3. For any scalar ${\displaystyle r}$  , ${\displaystyle (rA)^{T}=rA^{T}}$
4. ${\displaystyle (AB)^{T}=B^{T}A^{T}}$

The 4th rule can be generalize to products of more than two factors, as "The transpose of a product of matrices equals the product of their transposes in the reverse order." Meaning

${\displaystyle (a_{1},a_{2},a_{3},\dots ,a_{n})^{T}=a_{n}^{T},\dots ,a_{3}^{T},a_{2}^{T},a_{1}^{T}}$