# How to best typeset this long matrix multiplication?

I have a quite large matrix multiplication:

\begin{align*}
\mathrm{Var}(\alpha)&\approx \begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}
\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}
\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) \\\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}\\-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}
\end{align*}


Since this does not fit a single line I am wondering how I could typeset this in the best way? So that the logic of the matrix multiplication is still visible?

Please always post complete documents, not just fragments. It is shorter and clearer if you highlight the fact that this is VAV^T: \documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\mathrm{Var}(\alpha)&\approx
V\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}V^T
\end{align*}
where
$V=\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}$

\end{document}

• Probably a \dfrac instead of \frac is better looking here? – karlkoeller Aug 18 '13 at 13:45
• Using \DeclareMathOperator for “Var” and “Cov” should be recommended – egreg Aug 18 '13 at 13:47

Like David Carlisle does in his answer, I would also reduce the overall visual complexity of the main equation by rewriting it in the form V(a)=V <some matrix> V^T and providing a separate equation to explain the structure of V^T. Furthermore, in order to enhance the appearance of the components of the 3x3 matrix and the 3x1 column vector I would suggest that you do not use the pmatrix environment, which centers the contents of each column. Instead, it may be better to use the more general array environment to left-align the columns in the matrix and to right-align the column vector. Additionally, the legibility of the code (and look of the output) are enhanced, I think, if one defines the math operator terms \Var and \Cov in the preamble and then uses them throughout the equations. If you feel so inclined, you can simplify the expression for V^T further by factoring out the common term \exp(-\delta^{*}+\zeta^{*}).

\documentclass{article}
\usepackage{amsmath,array}
\setlength\arraycolsep{3pt}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\Cov}{Cov}
\begin{document}
\begin{align*}
\Var(\alpha) &\approx V
\left( \begin{array}{lll}
\Var(\zeta^{*})            &\Cov(\zeta^{*},\pi)   & \Cov(\zeta^{*},\delta^{*}) \\
\Cov(\pi,\zeta^{*})        & \Var(\pi)            & \Cov(\pi, \delta^{*}) \\
\Cov(\delta^{*},\zeta^{*}) & \Cov(\delta^{*},\pi) & \Var(\delta^{*})
\end{array} \right)
V^T\\
\intertext{where}
V^T &=
\left( \begin{array}{@{}r}
\sqrt{1+\pi^{2}}\,\exp(-\delta^{*}+\zeta^{*}) \\
\pi/(\sqrt{1+\pi^{2}})\, \exp(-\delta^{*}+\zeta^{*})\\
-\sqrt{1+\pi^{2}}\,\exp(-\delta^{*}+\zeta^{*})
\end{array}\right)
\end{align*}
\end{document}