TITLE: Factor a sum of products of cofactors
QUESTION [10 upvotes]: Let $M$ be any $n\times n$ matrix.
We define the usual cofactors:  $C_{i,j}$ is $(-1)^{i+j}$ times the determinant of the submatrix obtained by deleting row $i$ and column $j$ of $M$.
We can write the determinant of $M$ using Laplace expansion along column $p$ as:
$$\det M = \sum_{q=1}^n M_{q,p} C_{q,p}$$
Now, for any $k, p\in \{1,...,n\}$ consider the sum:
$$W_{n,p}(k) = \sum_{q=1}^n {M_{q,p} C_{q,p}^2 \prod_{j\ne q}{C_{j,k}}}$$
Clearly $W_{n,p}(p)$ can always be factored, with $\det M$ as one factor:
$$W_{n,p}(p) = \sum_{q=1}^n{M_{q,p} C_{q,p}^2 \prod_{j\ne q}{C_{j,p}}}
= \sum_{q=1}^n{M_{q,p} C_{q,p} \prod_{j=1}^n{C_{j,p}}}
= \left(\det M\right)  \prod_{j=1}^n{C_{j,p}}$$
But in all the specific cases I've examined, $\det M$ appears as a factor of $W_{n,p}(k)$ even when $k\ne p$. For example, with $n=3$, $p=1$ and $k=2$:
$$W_{3,1}(2)=\sum_{q=1}^3{M_{q,1} C_{q,1}^2 \prod_{j\ne q}{C_{j,2}}}=\\
\left(\det M\right)\left(M_{2,2} M_{2,3} M_{3,1}^2 M_{1,3}^2+M_{2,1} M_{2,3} M_{3,1} M_{3,2} M_{1,3}^2-M_{2,1} M_{2,2} M_{3,1} M_{3,3} M_{1,3}^2-M_{2,1}^2 M_{3,2}
   M_{3,3} M_{1,3}^2-M_{1,2} M_{2,3}^2 M_{3,1}^2 M_{1,3}+M_{1,2} M_{2,1}^2 M_{3,3}^2 M_{1,3}+M_{1,1} M_{2,1} M_{2,2} M_{3,3}^2
   M_{1,3}-M_{1,1} M_{2,3}^2 M_{3,1} M_{3,2} M_{1,3}-M_{1,1} M_{1,2} M_{2,1} M_{2,3} M_{3,3}^2-M_{1,1}^2 M_{2,2} M_{2,3} M_{3,3}^2+M_{1,1}
   M_{1,2} M_{2,3}^2 M_{3,1} M_{3,3}+M_{1,1}^2 M_{2,3}^2 M_{3,2} M_{3,3}\right)
$$
It might be worth noting that the second factor here cannot be written as a linear combination of products of the cofactors, with purely numeric coefficients. This is in stark contrast to the case $k=p$, when the quotient is simply a product of cofactors.
I am seeking a proof that $\det M$ always divides $W_{n,p}(k)$, and a general formula for the quotient in the non-trivial case $k\ne p$.

REPLY [2 votes]: This is a proof that $\det M$ divides $W_{n,p}(k)$.
I can assume that the entries of $M$ are variables of polynomial ring $\mathbb{C}[M_{11},\ldots,M_{nn}]$; then, it suffices to prove that points from the (irreducible) variety $\det M=0$ satisfy $W_{n,p}(k)=0$.
Indeed, let $M'$ be a generic point on this variety; denote by $v^i$ the $i$th column vector of $M'$. Since $M'$ is generic, there is $l\notin\{p,k\}$ such that $v^l=\sum_{t\neq l} \lambda_t v^t$ with all $\lambda_t$ nonzero. Then, the ratio of cofactors $C_{qp}/C_{qk}$ equals $\alpha=\lambda_p/\lambda_k$ and, in particular, it does not depend on $q$. We conclude $$W_{n,p}(k)=\sum\limits_{q=1}^{n}\,M'_{qp}C_{qp}^2\prod\limits_{j\neq q}C_{jk}=\sum\limits_{q=1}^{n}\,M'_{qp}C_{qp}\alpha\prod\limits_{j=1}^nC_{jk}=\alpha\prod\limits_{j=1}^nC_{jk}\cdot\left(\sum\limits_{q=1}^{n}\,M'_{qp}C_{qp}\right)=0.$$