# Linear Algebra/Matrix Equation

## Diagonal Matrix

A diagonal matrix, $A$ , is a square matrix in which the entries outside of the main diagonal are zero. The main diagonal of a square matrix consists of the entries which run from the top left corner to the bottom right corner.

In the example below the main diagonal are $a_{11},a_{22},...,a_{nn}\!$

$\quad A={\begin{bmatrix}a_{11}&0&\cdots &0\\0&a_{22}&\cdots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\cdots &a_{nn}\end{bmatrix}}$

## Identity Matrix

The identity matrix, with a size of n, is an n-by-n square matrix with ones on the main diagonal and zeros elsewhere. It is commonly denoted as $I_{n}$ , or simply by I if the size is immaterial or can be easily determined by the context.

$I_{1}=\quad I_{2}={\begin{bmatrix}1&0\\0&1\end{bmatrix}}\quad I_{3}={\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}}\quad I_{n}={\begin{bmatrix}1&0&\cdots &0\\0&1&\cdots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\cdots &1\end{bmatrix}}$

The most important property of the identity matrix is that, when multiplied by another matrix, A, the result will be A

$AI_{n}=A\,$  and $I_{n}A=A\,$ .