Gaussian reduction of matrices

The gauss package is specifically designed for this purpose and allows for typesetting even large matrices and the associated Gaussian elimination (or reduction).

Here is a fairly elementary example of Gaussian (or Gauss-Jordan) elimination on a 2x2 matrix:

enter image description here

\documentclass{article}

\usepackage{gauss,amsmath}

\begin{document}

\begin{align*}
  & \begin{gmatrix}[p]
      1 & 2 \\
      3 & 4
      \rowops
      \add[-3]{0}{1}
    \end{gmatrix} \\
  \Rightarrow & \begin{gmatrix}[p]
      1 & 2 \\
      0 & -2
      \rowops
      \mult{1}{\scriptstyle\cdot-\frac{1}{2}}
    \end{gmatrix} \\
  \Rightarrow & \begin{gmatrix}[p]
      1 & 2 \\
      0 & 1
      \rowops
      \add[-2]{1}{0}
    \end{gmatrix} \\
  \Rightarrow & \begin{gmatrix}[p]
      1 & 0 \\
      0 & 1
    \end{gmatrix}
\end{align*}

\end{document}

Matrices using the gauss package are typeset within a gmatrix environment (an optional parameter specifies the delimiters), while elementary row operations are specified using \mult, \add, or \swap. See the gauss documentation for more information and refinements.

amsmath provided the align* environment, although it was not necessary; a regular array would also have worked.


read https://archiv.dante.de/DTK/PDF/komoedie_2002_3.pdf, pages 34--40 for an introduction into the package gauss. The examples should be self explanatory.