# $A$ with equation of more than one matrix

I need to write a matrix, that has a structure as in the attached picture.

• Welcome to TeX SX! Use the align environment and bmatrix, both from amsmath. Nov 21, 2019 at 0:47
• Unrelated: The attached picture is wrong :-) The off-diagonal terms of the matrix in the second line need a sign too... Nov 21, 2019 at 10:37
• I’d rather use the split environment inside an align (or align*): indeed, the two lines are part of a single equation, which should get a single equation number, not two (one would hardly want to refer to each line separately!). i’d align at the “=” sign, too (as opposed to aligning the second “=” with “t”).
– GuM
Nov 21, 2019 at 11:44

A solution that complements the comments by @Bernard and @campa. Observe that the first row may be simplified by multiplying t into I_n.

\documentclass{article}
\usepackage{amsmath} % for 'align*' env.

\begin{document}

\begin{align*}
tI_n-A
&=
\begin{bmatrix}
t & 0 & \dots & 0 \\
0 & t & \dots & 0 \\
\vdots& \vdots& \ddots & \vdots \\
0 & 0 & \dots & t
\end{bmatrix}
-
\begin{bmatrix}
a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22} & \dots & a_{2n} \\
\vdots & \vdots & \ddots& \vdots \\
a_{n1} & a_{n2} & \dots & a_{nn}
\end{bmatrix}\\
&=
\begin{bmatrix}
t-a_{11}& -a_{12} & \dots & -a_{1n} \\
-a_{21} & t-a_{22}& \dots & -a_{2n} \\
\vdots  & \vdots  & \ddots& \vdots  \\
-a_{n1} & -a_{n2} & \dots & t-a_{nn}
\end{bmatrix}
\end{align*}

\end{document}