> For the complete documentation index, see [llms.txt](https://amanalok.gitbook.io/linear-algebra/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amanalok.gitbook.io/linear-algebra/matrix-properties.md).

# Matrix Properties

## Trace

Trace of a matrix is the sum of its diagonal elements:

$$
Tr(A) = \sum\_iA\_{ii}
$$

Further,

$$
Tr(A+B) = Tr(A) + Tr(B)
\\
Tr(AB) = Tr(BA), \hspace{0.1cm}even\hspace{0.1cm}if\hspace{0.1cm}AB \neq BA
\\
Tr(A) = Tr(A^T)
$$

## ​Determinant

For a matrix, $$A = \begin{bmatrix} a\_{11} & a\_{12}\ a\_{21} & a\_{22} \end{bmatrix}$$​, it's determinant is given by:

$$
|A| = a\_{11}a\_{22} - a\_{12}a\_{22}
$$

For a $$3 \times 3$$ matrix, $$A = \begin{bmatrix} a & b & c\ d & e & f\ g & h & i \end{bmatrix}$$​, it's determinant is given by:

$$
|A| = a(ei-fh) - b(di-fg) + c(dh - eg)
$$

​For a $$4 \times 4$$​ matrix, the determinant is given by:

$$
|A| = \begin{bmatrix}
a \times \begin{vmatrix}
f & g & h\\
j & k & l\\
n & o & p
\end{vmatrix}
\end{bmatrix}
-------------

\begin{bmatrix}
b \times \begin{vmatrix}
e & g & h\\
i & k & l\\
m & o & p
\end{vmatrix}
\end{bmatrix}
\+
\begin{bmatrix}
c \times \begin{vmatrix}
e & f & h\\
i & j & l\\
m & n & p
\end{vmatrix}
\end{bmatrix}
-------------

\begin{bmatrix}
d \times \begin{vmatrix}
e & f & g\\
I& j & k\\
m & n & o
\end{vmatrix}
\end{bmatrix}
$$

Physically, determinant represents volume formed by column vectors.

## Invertibility

A square matrix $$A$$ is invertible if and only if $$det(A) \neq 0$$. This automatically means that columns of $$A$$​ are linearly independent. For example,

$$
A = \begin{bmatrix}
v\_1 & v\_2 & ... & v\_n\\
\end{bmatrix}
\\
v\_1 = (a\_{11}, a\_{21}, ... , a\_{n1})
\\
v\_2 = (a\_{12}, a\_{22}, ... , a\_{n2})
\\
v\_n = (a\_{1n}, a\_{2n}, ... , a\_{nn})
$$

​Let's presume the following:

$$
v\_n = \alpha\_1v\_1 + \alpha\_2v\_2 + ... + \alpha\_{n-1}v\_{n-1}
$$

​In such a scenario, the area formed by the (hyper)parallelogram by the "n vectors" (the determinant) would be zero.

Another simpler example, consider a $$2 \times 2$$​ matrix where $$v\_1 = 2v\_2$$​. In such a case, the area of the parallelogram is zero.
