Pull Request #87 (https://sourceforge.net/p/maxima/patches/87/) describes that when the ams package is loaded (which frequently is the case when dealing with mathematics) and LaTeX is used \pmatrix is not only deprecated as it is in LaTeX, but actually causes an error.
One way around this is providing a way for the user to specify if LaTeX or plain TeX is to be used - and making the user do so. Another one is replace the \pmatrix command by something like the following
\ifx\documentstyle\undefined\pmatrix\else\begin{pmatrix}\fi
...and adding the following command to the end of the matrix:
\ifx\documentstyle\undefined\else\end{pmatrix}\fi
This way we would be compatible to plain TeX, stop producing warnings in LaTeX and work smoothly together with the ams package.
The disadvantage would be that the TeX code we output would get slightly longer this way.
Attached to this mail you can find an [still untested] patch that might solve the problem.