in the code below I'd like the elements in each of the rows to be aligned with the corresponding elements in the other rows and the inside brackets in each row to be aligned with the corresponding brackets in other rows yet to adjust size depending on their contents.
Thanks!
\documentclass{amsart}
\begin{document}
\begin{gather}
\begin{bmatrix}
a \begin{bmatrix} b & a_{long} f_{ormula} \end{bmatrix}\\
c_d \begin{bmatrix} \dfrac{e}{f} & g \end{bmatrix}
\end{bmatrix}
\end{gather}
I want $e/f$ aligned with $b$ and $g$ with $a_{long} f_{ormula} $ and the inside brackets to be both aligned with the corresponding brackets in other rows and to adjust to their contents. What is the easiest way of doing this?
\end{document}

a &andc_d &to change to second column? – Sigur Jan 24 '15 at 21:31ato multiply a row vector andc_dto multiply a row vector and both of these row vectors to have elements that are aligned and ditto for the brackets surrounding them. – JPi Jan 24 '15 at 21:33