# Matrices/Linear system/Introduction/Section

A system of linear equations can easily be written with a matrix. This allows us to make the manipulations which lead to the solution of such a system, without writing down the variables. Matrices are quite simple objects; however, they can represent quite different mathematical objects (e.g., a family of column vectors, a family of row vectors, a linear mapping, a table of physical interactions, a vector field, etc.), which one has to keep in mind in order to prevent wrong conclusions.

## Definition

Let ${\displaystyle {}K}$ denote a field, and let ${\displaystyle {}I}$ and ${\displaystyle {}J}$ denote index sets. An ${\displaystyle {}I\times J}$-matrix is a mapping

${\displaystyle I\times J\longrightarrow K,(i,j)\longmapsto a_{ij}.}$

If ${\displaystyle {}I=\{1,\ldots ,m\}}$ and ${\displaystyle {}J=\{1,\ldots ,n\}}$, then we talk about an ${\displaystyle {}m\times n}$-matrix. In this case, the matrix is usually written as

${\displaystyle {\begin{pmatrix}a_{11}&a_{12}&\ldots &a_{1n}\\a_{21}&a_{22}&\ldots &a_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&\ldots &a_{mn}\end{pmatrix}}.}$

We will usually restrict to this situation. For every ${\displaystyle {}i\in I}$, ${\displaystyle {}a_{ij}}$ , ${\displaystyle {}j\in J}$, is called the ${\displaystyle {}i}$-th row of the matrix, which is usually written as a row vector

${\displaystyle (a_{i1},a_{i2},\ldots ,a_{in}).}$

For every ${\displaystyle {}j\in J}$, ${\displaystyle {}a_{ij}}$ , ${\displaystyle {}i\in I}$, is called the ${\displaystyle {}j}$-th column of the matrix, usually written as a column vector

${\displaystyle {\begin{pmatrix}a_{1j}\\a_{2j}\\\vdots \\a_{mj}\end{pmatrix}}.}$

The elements ${\displaystyle {}a_{ij}}$ are called the entries of the matrix. For ${\displaystyle {}a_{ij}}$, the number ${\displaystyle {}i}$ is called the row index, and ${\displaystyle {}j}$ is called the column index of the entry. The position of the entry ${\displaystyle {}a_{ij}}$ is where the ${\displaystyle {}i}$-th row meets the ${\displaystyle {}j}$-th column. A matrix with ${\displaystyle {}m=n}$ is called a square matrix. An ${\displaystyle {}m\times 1}$-matrix is simply a column tuple (or column vector) of length ${\displaystyle {}m}$, and an ${\displaystyle {}1\times n}$-matrix is simply a row tuple (or row vector) of length ${\displaystyle {}n}$. The set of all matrices with ${\displaystyle {}m}$ rows and ${\displaystyle {}n}$ columns (and with entries in ${\displaystyle {}K}$) is denoted by ${\displaystyle {}\operatorname {Mat} _{m\times n}(K)}$, in case ${\displaystyle {}m=n}$ we also write ${\displaystyle {}\operatorname {Mat} _{n}(K)}$.

Two matrices ${\displaystyle {}A,B\in \operatorname {Mat} _{m\times n}(K)}$ are added by adding entries with corresponding entries. The multiplication of a matrix ${\displaystyle {}A}$ with an element ${\displaystyle {}r\in K}$ (a scalar) is also defined entrywise, so

${\displaystyle {}{\begin{pmatrix}a_{11}&a_{12}&\ldots &a_{1n}\\a_{21}&a_{22}&\ldots &a_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&\ldots &a_{mn}\end{pmatrix}}+{\begin{pmatrix}b_{11}&b_{12}&\ldots &b_{1n}\\b_{21}&b_{22}&\ldots &b_{2n}\\\vdots &\vdots &\ddots &\vdots \\b_{m1}&b_{m2}&\ldots &b_{mn}\end{pmatrix}}={\begin{pmatrix}a_{11}+b_{11}&a_{12}+b_{12}&\ldots &a_{1n}+b_{1n}\\a_{21}+b_{21}&a_{22}+b_{22}&\ldots &a_{2n}+b_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}+b_{m1}&a_{m2}+b_{m2}&\ldots &a_{mn}+b_{mn}\end{pmatrix}}\,}$

and

${\displaystyle {}r{\begin{pmatrix}a_{11}&a_{12}&\ldots &a_{1n}\\a_{21}&a_{22}&\ldots &a_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&\ldots &a_{mn}\end{pmatrix}}={\begin{pmatrix}ra_{11}&ra_{12}&\ldots &ra_{1n}\\ra_{21}&ra_{22}&\ldots &ra_{2n}\\\vdots &\vdots &\ddots &\vdots \\ra_{m1}&ra_{m2}&\ldots &ra_{mn}\end{pmatrix}}\,.}$

The multiplication of matrices is defined in the following way.

## Definition

Let ${\displaystyle {}K}$ denote a field, and let ${\displaystyle {}A}$ denote an ${\displaystyle {}m\times n}$-matrix and ${\displaystyle {}B}$ an ${\displaystyle {}n\times p}$-matrix over ${\displaystyle {}K}$. Then the matrix product

${\displaystyle AB}$

is the ${\displaystyle {}m\times p}$-matrix, whose entries are given by

${\displaystyle {}c_{ik}=\sum _{j=1}^{n}a_{ij}b_{jk}\,.}$

Such a matrix multiplication is only possible when the number of columns of the left-hand matrix equals the number of rows of the right-hand matrix. Just think of the scheme

${\displaystyle {}(ROWROW){\begin{pmatrix}C\\O\\L\\U\\M\\N\end{pmatrix}}=(RC+O^{2}+WL+RU+OM+WN)\,,}$

the result is an ${\displaystyle {}1\times 1}$-Matrix. In particular, one can multiply an ${\displaystyle {}m\times n}$-matrix ${\displaystyle {}A}$ with a column vector of length ${\displaystyle {}n}$ (the vector on the right), and the result is a column vector of length ${\displaystyle {}m}$. The two matrices can also be multiplied with roles interchanged,

${\displaystyle {}{\begin{pmatrix}C\\O\\L\\U\\M\\N\end{pmatrix}}(ROWROW)={\begin{pmatrix}CR&CO&CW&CR&CO&CW\\OR&O^{2}&OW&OR&O^{2}&OW\\LR&LO&LW&LR&LO&LW\\UR&UO&UW&UR&UO&UW\\MR&MO&MW&MR&MO&MW\\NR&NO&NW&NR&NO&NW\end{pmatrix}}\,.}$

## Definition

An ${\displaystyle {}n\times n}$-matrix of the form

${\displaystyle {\begin{pmatrix}d_{11}&0&\cdots &\cdots &0\\0&d_{22}&0&\cdots &0\\\vdots &\ddots &\ddots &\ddots &\vdots \\0&\cdots &0&d_{n-1\,n-1}&0\\0&\cdots &\cdots &0&d_{nn}\end{pmatrix}}}$
is called a diagonal matrix.

## Definition

The ${\displaystyle {}n\times n}$-matrix

${\displaystyle {}E_{n}:={\begin{pmatrix}1&0&\cdots &\cdots &0\\0&1&0&\cdots &0\\\vdots &\ddots &\ddots &\ddots &\vdots \\0&\cdots &0&1&0\\0&\cdots &\cdots &0&1\end{pmatrix}}\,}$
is called identity matrix.

The identity matrix ${\displaystyle {}E_{n}}$ has the property ${\displaystyle {}E_{n}M=M=ME_{n}}$, for an arbitrary ${\displaystyle {}n\times n}$-matrix ${\displaystyle {}M}$.

## Remark

If we multiply an ${\displaystyle {}m\times n}$-matrix ${\displaystyle {}A=(a_{ij})_{ij}}$ with an column vector ${\displaystyle {}x={\begin{pmatrix}x_{1}\\x_{2}\\\vdots \\x_{n}\end{pmatrix}}}$, then we get

${\displaystyle {}Ax={\begin{pmatrix}a_{11}&a_{12}&\ldots &a_{1n}\\a_{21}&a_{22}&\ldots &a_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&\ldots &a_{mn}\end{pmatrix}}{\begin{pmatrix}x_{1}\\x_{2}\\\vdots \\x_{n}\end{pmatrix}}={\begin{pmatrix}a_{11}x_{1}+a_{12}x_{2}+\cdots +a_{1n}x_{n}\\a_{21}x_{1}+a_{22}x_{2}+\cdots +a_{2n}x_{n}\\\vdots \\a_{m1}x_{1}+a_{m2}x_{2}+\cdots +a_{mn}x_{n}\end{pmatrix}}\,.}$

Hence, an inhomogeneous system of linear equations with disturbance vector ${\displaystyle {}{\begin{pmatrix}c_{1}\\c_{2}\\\vdots \\c_{m}\end{pmatrix}}}$, can be written briefly as

${\displaystyle {}Ax=c\,.}$

Then, the manipulations on the equations, which do not change the solution set, can be replaced by corresponding manipulations on the rows of the matrix. It is not necessary to write down the variables.