Moore-Penrose pseudoinverse of a 3×3 matrix Is there a "simple" formula for computing the Moore-Penrose pseudoinverse of a $3\times 3$ matrix? I mean something like the formula for the inverse (for non-singular matrices), which involves the matrix of minors, etc.
I need that for a computer program, and I feel that using LAPACK's SVD is a bit of an overkill.
 A: You are probably thinking of the formula
$$
\begin{align}
  \mathbf{A}^{-1} 
     &= \frac{\text{adj } \mathbf{A}} {\det \mathbf{A} } \\ 
     &= \frac{\left( \text{cof } \mathbf{A}\right)^{\mathrm{T}}} {\det \mathbf{A} } \\ 
\end{align}
$$
The matrix $\text{adj } \mathbf{A}$ is the adjugate of $\mathbf{A}$ and is the transpose of $\mathbf{C}$, the matrix of cofactors of $\mathbf{A}$.
For a nonsingular $\mathbf{A}\in\mathbb{R}^{3 x 3}$,
$$
 \mathbf{A} = 
  \left[
    \begin{array}{ccc}
       a_{11} & a_{12} & a_{13} \\
       a_{21} & a_{22} & a_{23} \\
       a_{31} & a_{32} & a_{33}
    \end{array}
  \right],
$$
the matrix of cofactors is composed of the determinants
$$
 \mathbf{C} = 
  \left[
    \begin{array}{ccc}
       %
       + \left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right| &
       - \left| \begin{array}{cc} a_{21} & a_{23} \\ a_{31} & a_{33} \end{array} \right| &
       + \left| \begin{array}{cc} a_{21} & a_{22} \\ a_{31} & a_{32} \end{array} \right| \\
       %
       - \left| \begin{array}{cc} a_{12} & a_{13} \\ a_{32} & a_{33} \end{array} \right| &
       + \left| \begin{array}{cc} a_{11} & a_{13} \\ a_{31} & a_{33} \end{array} \right| &
       - \left| \begin{array}{cc} a_{11} & a_{12} \\ a_{31} & a_{32} \end{array} \right| \\
       %
       + \left| \begin{array}{cc} a_{12} & a_{13} \\ a_{22} & a_{23} \end{array} \right| &
       - \left| \begin{array}{cc} a_{11} & a_{13} \\ a_{21} & a_{23} \end{array} \right| &
       + \left| \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right| \\
    \end{array}
  \right].
$$
Because you specified that $\mathbf{A}$ is nonsingular, the matrix inverse exists and is the same as the Moore-Penrose pseudoinverse:
$$
  \mathbf{A}^{-1} = \mathbf{A}^{\dagger}.
$$
Example
Pencil and paper exercise of confirmation:
$$
\mathbf{A} =
  \left[
    \begin{array}{ccc}
       1 & 0 & 1 \\
       0 & 1 & 1 \\
       1 & 0 & 0
    \end{array}
  \right],
$$
The determinant is $\det \mathbf{A} = 1$, and the matrix of cofactors is
$$
\mathbf{C} =
  \left[
    \begin{array}{rrr}
       0 &  1 & -1 \\
       0 & -1 &  0 \\
      -1 & -1 &  1
    \end{array}
  \right]
$$
The inverse matrix is
$$
  \mathbf{A}^{-1} = \frac{\left( \text{cof } \mathbf{A}\right)^{\mathrm{T}}} {\det \mathbf{A} } = \frac{\mathbf{C}^\mathrm{T}} {-1} = 
  \left[
    \begin{array}{rrr}
       0 &  0 &  1 \\
      -1 &  \phantom{-}1 &  1 \\
       1 &  0 & -1
    \end{array}
  \right].
$$
