Q:

Alternative to Bordermatrix for MathJax

I'm using bordermatrix to write matrix with coefficient on the top and on the left:

I would like to display a similar matrix on my website where I use Mathjax but I get a [Math Processing Error]. Do you have a MathJax-alternative to bordermatrix to get the same result?

A:

You can use the following construction:
\begin{align}
  f(x) &= ax^2 + bx + c \\
  &= \begin{array}{c c}
    & \begin{array} {@{} c c c @{}}
      u_1 & \cdots & u_q
    \end{array} \\
    \begin{array}{c}
      e_1 \\ \vdots \\ e_n
    \end{array}\hspace{-1em} &
    \left(
      \begin{array}{@{} c c c @{}}
        u_{11} & \cdots & u_{1q} \\
        \vdots &        & \vdots \\
        u_{n1} & \cdots & u_{nq}
      \end{array}
    \right) \\
    \mbox{} % Blank line to match column names so as to align the = vertically
  \end{array} \\[-12pt] % Correction for blank line
  &= ax^2 + bx + c
\end{align}

Depending on whether you're aligning it with other content, you might not need the vertical adjustment I inserted.
Tested on Math.SE.

