Matrix multiplication

I have followed the suggestions in this thread to place the delimiters before and After all arrays (also tried matrix} but my file won’t compile until I delinit each matrix which doesn’t give me the result I need.

  \documentclass[legalpaper,12pt]{amsart}
\usepackage{amsmath,array}
\begin{document}

$A =\begin{array}{r r r} 2 & -1 & 0\\ -1 & 2 & -1\\ 0 & -1 & 2 \end{array}$

Describe the column space and the nullspace          of the matrices
$A=\left(\begin{array}{c c} 1 & -1\\ 0 & 0 \end{array}\right) \qquad B=\begin{array}{c c c} 0 & 0 & 3\\ 1 & 2 & 3 \end{array} C=\begin{array}{c c c} 0&0&0\\ 0&0&0 \end{array}$
\end{document}


• Don't put all-blank lines in display-math environment, including one delimited by $ and $. – Mico Oct 2 '19 at 21:02

Remove any blank lines inside math environments as @Mico said, and use pmatrix for all your matrices and \qquad between A, B, and C.

\documentclass[12pt]{amsart}
\usepackage{amsmath,array}

\begin{document}
$A =\begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 2 \end{pmatrix}$
Describe the column space and the nullspace of the matrices
$A = \begin{pmatrix} 1 & -1 \\ 0 & 0 \end{pmatrix} \qquad B = \begin{pmatrix} 0 & 0 & 3\\ 1 & 2 & 3 \end{pmatrix} \qquad C = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}$
\end{document}


Your basic problem is solved by @Mico comment, but you maybe looking for the following result:

\documentclass[legalpaper,12pt]{amsart}
\usepackage{mathtools}

\begin{document}
$A =\begin{pmatrix*}[r] 2 & -1 & 0\\ -1 & 2 & -1\\ 0 & -1 & 2 \end{pmatrix*}$
Describe the column space and the nullspace of the matrices
$A=\begin{pmatrix*}[r] 1 & -1\\ 0 & 0 \end{pmatrix*} \qquad B=\begin{pmatrix} 0 & 0 & 3\\ 1 & 2 & 3 \end{pmatrix} \qquad C=\begin{pmatrix} 0&0&0\\ 0&0&0 \end{pmatrix}$
\end{document}


Same output can be obtained using spalign package with the attention to put a blank space between the elements of the matrix. The advantage of this package and to have directly the alignment the minus signs l, r, c. Here I have used the option r=right,\spalignmat[r].

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{spalign}
\begin{document}

\spalignmat[r]{2 -1 0; -1 2 -1; 0 -1 2}
Describe the column space and the nullspace of the matrices:
A=\spalignmat[r]{1 -1; 0 0}, \quad B=\spalignmat[r]{0 0 3; 1 2 3}, \quad C=\spalignmat[r]{0 0 0; 0 0 0}
\end{document}