# PlanetPhysics/Matrix

A matrix is defined as a rectangular array of elements (usually the elements are real or complex numbers). An algebra of matrices is developed by defining addition of matrices, multiplication of matrices, multiplication of a matrix by a scalar (real or complex number), differentiation of matrices, etc. The definitions chosen for the above-mentioned operations will be such as to make the calculus of matrices highly applicable. A matrix $\mathbf {A}$ may be denoted as follows:
   $\mathbf {A} =\left({\begin{matrix}a_{1}^{1}&a_{2}^{1}&\dots &a_{n}^{1}\\a_{1}^{2}&a_{2}^{2}&\dots &a_{n}^{2}\\\dots &\dots &\dots &\dots \\a_{1}^{m}&a_{2}^{m}&\dots &a_{n}^{m}\end{matrix}}\right)=\left\|a_{j}^{i}\right\|$
If $m=n$, we say that $\mathbf {A}$ is a square matrix of order $n$. If $\mathbf {B}$ is the matrix of elements $\left\|b_{j}^{i}\right|,i=1,2,\dots ,m,j=1,2,\dots ,n$, then $\mathbf {B}$ is said to be equal to $\mathbf {A}$, written $\mathbf {B} =\mathbf {A}$ or $\mathbf {A} =\mathbf {B}$, if and only if $a_{j}^{i}=b_{j}^{i}$ for the complete range of values of $i$ and $j$.
Two matrices can be compared for equality if and only if they are comparable in the sense that they have the same number of rows and the same number of columns.
The sum of two comparable matrices $\mathbf {A}$, $\mathbf {B}$ is defined as a new matric $\mathbf {C}$ whose elements $c_{j}^{i}$ are obtained by adding the corresponding elements of $\mathbf {A}$ and $\mathbf {B}$. Thus
   $\left\|c_{j}^{i}\right\|=\mathbf {C} =\mathbf {A} +\mathbf {B} =\left\|a_{j}^{i}\right\|+\left\|b_{j}^{i}\right\|=\left\|a_{j}^{i}+b_{j}^{i}\right\|$
We note that $\mathbf {A} +\mathbf {B} =\mathbf {B} +\mathbf {A}$.
We call $\mathbf {A}$ a zero matrix if and only if each element of $\mathbf {A}$ is equal to the real number zero.
The product of a matrix $\mathbf {A}$ by a numbe $k$ (real or complex) is defined as the matrix whose elements are each $k$ times those of $\mathbf {A}$, that is
   $k\mathbf {A} =k\left\|a_{j}^{i}\right\|=\|ka_{j}^{i}\|$
Every matrix $\mathbf {A}$ can be associated with a negative matrix $\mathbf {B} =-\mathbf {A}$ such that $\mathbf {A} +(-\mathbf {A} )=(-\mathbf {A} )+\mathbf {A} =0$ (zero matrix).
The rule for multiplying a matrix $\mathbf {A}$ by a scalar $k$ should not be confused with the rule for multiplying a determinant by $k$, for in this latter case the elements of only one row or only one column are multiplied by $k$.
Before defining the product of two matrices let us consider the following sets of linear transformations:
   ${\begin{matrix}{ccl}A:&z^{i}=a_{j}^{i}y^{i}&i=1,2,\dots ,m;j=1,2,\dots ,n\\B:&y^{i}=b_{k}^{j}x^{k}&k=1,2,\dots ,p\end{matrix}}$
Since the $z$'s depend on the $y$'s, which in turn depend on the $x$'s, we can solve for the $z$'s in terms of the $x$'s. We write this transformation as follows:
   ${\begin{matrix}AB:&z^{i}=a_{j}^{i}b_{k}^{j}x^{k}&c_{k}^{i}=a_{j}^{i}b_{k}^{j}\end{matrix}}$
This suggests a method for defining multiplication of the matrics $\mathbf {A}$, $\mathbf {B}$.
If $\mathbf {A} =\left\|a_{j}^{i}\right\|,i=1,2,\dots ,m,j=1,2,\dots ,n,\mathbf {B} =\left\|b_{j}^{i}\right\|,i=1,2,\dots ,n,j=1,2,\dots ,p$, then $\mathbf {A} \mathbf {B}$ is defined as the matrix $\mathbf {C}$ such that
   $\mathbf {C} =\mathbf {A} \mathbf {B} =\left\|a_{j}^{i}\right\|\cdot \left\|b_{j}^{i}\right\|=\left\|a_{\alpha }^{i}b_{j}^{\alpha }\right\|=\left\|c_{j}^{i}\right\|$
Let us note that the number of columns of the matrix $\mathbf {A}$ must be equal the number of rows of $\mathbf {B}$. The matrix $\mathbf {C}$ of (3) is an $m\times p$ matrix. In the case of square matrices the definition for multiplication of matrices corresponds to that for multiplication of determinants. This implies that $\left|C\right|=\left|A\right|\cdot \left|B\right|$, where $\left|C\right|$ denotes the determinant of the set of elements comprising the square matrix $\mathbf {C} =\mathbf {A} {B}$.
A square matrix $\mathbf {A}$ is said to be a symmetric matrix if and only if $\mathbf {A} =\mathbf {A} ^{T}$. If $\mathbf {A} =-\mathbf {A} ^{T}$, we say the $\mathbf {A}$ is a skew-symmetric matrix. We now exhibit a symmetric matrix $\mathbf {A}$ and a skew-symmetric matrix $\mathbf {B}$.
   ${\begin{matrix}\mathbf {A} =\mathbf {A} ^{T}=\left({\begin{matrix}{rrrr}2&-1&4&-2\\-1&0&3&5\\4&3&1&-1\\-2&5&-1&3\end{matrix}}\right)&\mathbf {B} =-\mathbf {B} ^{T}=\left({\begin{matrix}{rrr}0&-1&3\\1&0&-2\\-3&2&0\end{matrix}}\right)\end{matrix}}$
We let the reader verify that ${\frac {1}{2}}\left(\mathbf {A} +\mathbf {A} ^{T}\right)$ is a symmetric matrix if $\mathbf {A}$ is a square matrix. Let the reader first prove that $\left(\mathbf {A} ^{T}\right)^{T}=\mathbf {A}$,
   $\left(\mathbf {A} +\mathbf {B} \right)^{T}=\mathbf {A} ^{T}+\mathbf {B} ^{T}$
It is easily seen that ${\frac {1}{2}}\left(\mathbf {A} +\mathbf {A} ^{T}\right)$ is a symmetric matrix. Any square matrix $\mathbf {A}$ can obviously be written as
   $\mathbf {A} ={\frac {1}{2}}\left(\mathbf {A} +\mathbf {A} ^{T}\right)+{\frac {1}{2}}\left(\mathbf {A} -\mathbf {A} ^{T}\right)$
Hence every square matrix can be written as the sum of a symmetric and a skew-symmetric matrix.