Solving rank equations Suppose we are given a (finite) matrix $A$ with entries $a_{ij} \in k[w_1, \ldots, w_n]$ which are polynomial expressions of $w_1, \ldots, w_n$ over some field $k$. For a fixed integer $m$, is there a way to determine all points $p=(w_1, \ldots, w_n) \in \mathbb A^n(k) = k^n$ such that
$$\operatorname{rank} A=m,$$ i.e. which $p\in k^n$ makes the rank of $A$ to be $m$?
 A: The rank of a matrix is the size of its largest non-vanishing minor, so you can express your condition by polynomial equations in the matrix entries.
A: I have reservations about this, Maxima, solution; although it corresponds to some other approaches I tried
Rewriting the particular problem to satisfy my pattern-seeking.
Using Maxima
$ M=\left[\begin{array}{cccc}
d_{1} & d_{2} & 0 & 0\\
-sd_{2} & d_{1} & 0 & 0\\
a_{1} & a_{2} & b_{1} & b_{2}\\
-sa_{2} & a_{1} & -sb_{2} & b_{1}\\
-a_{2}d_{2} & 0 & -d_{2}b_{2} & 0\\
0 & 0 & d_{1} & d_{2}\\
0 & 0 & -sd_{2} & d_{1}
\end{array}\right]$
factor(triangularize(M));
$\left[\begin{array}{cccc}
d_{1} & d_{2} & 0 & 0\\
0 & d_{2}^{2}\cdot s+d_{1}^{2} & 0 & 0\\
0 & 0 & -b_{2}\cdot d_{2}\cdot(d_{2}^{2}\cdot s+d_{1}^{2})\\
0 & 0 & 0 & -\left(b_{2}\right)^{2}\cdot d_{2}\cdot(d_{2}^{2}\cdot s+d_{1}^{2})\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{array}\right]$
The rank() command also gives these terms.
The only thing wrong with this is the $d_{2}$ in the top row. It should have been eliminated? I left it in because I might have missed something, but it seems wrong (a bug in Maxima?)
Analysis:
$(d_{2}^{2}\cdot s+d_{1}^{2}) =0 $ yields rank 1
$b_{2}=0$ yields rank 2
$d_{2}=0$ yields rank 2
$d_{1}=0$ yields rank 3
Comment: I prefer to use exterior/alternating products for this type of analysis.
That is because it automatically points down to the elementary definition of dependence/independence of linear conditions and fits any dimension/size. It starts out with vector, cross-product, triple product; but these are specialized and actually more complicated than the general alternating products.
But Maxima didn't have specialized routines for your type of problem and the standard function yielded too many terms to be useful. Sage didn't seem to have a function that didn't drag in extra concerns.
Do not use the “echelon” form because I think it will make incorrect decisions when you want to later set terms to zero or not; it normalizes.
Constructive comments welcome :)
