Suppose we have a matrix $M$ whose elements are rational functions of $x$ with the same denominator.
A simple example
$M=\left[\begin{matrix} \frac{x}{a^2+x^2} & \frac{-a}{a^2+x^2}\\ \frac{a}{a^2+x^2} & \frac{x}{a^2+x^2}\end{matrix}\right]$
Clearly
$M=\left[\begin{matrix} a^2+x^2 & 0\\ 0 & a^2+x^2\end{matrix}\right]^{-1}\left[\begin{matrix} x & -a\\ a & x\end{matrix}\right]$
but also
$M=\left[\begin{matrix} x & a\\ -a & x\end{matrix}\right]^{-1}\left[\begin{matrix} 1 & 0\\ 0 & 1\end{matrix}\right]$
The first expression is obvious, but the second is lower-degree and preferable. Is there a systematic way to find the lowest-degree expression of the form $M=(\text{numerator matrix})^{-1}(\text{denominator matrix})$, given $M$ ?
(i.e. the numerator matrix and denominator matrix must contain polynomials in $x$ whose degree is as low as possible)
Edit
Thinking further, I notice that $\text{det}\left( \left[\begin{matrix} x & a\\ -a & x\end{matrix}\right]\right)=x^2+a^2$ and $\text{det}\left(\left[\begin{matrix} a^2+x^2 & 0\\ 0 & a^2+x^2\end{matrix}\right]\right)=(x^2+a^2)^2$ , i.e. the determinants of the "numerator" and "denominator" of the first expression have common zeros, which is not the case for the second expression. It could well be that this lack of common zeros uniquely determines the "simplest" expression.