I have the following $4 \times 4$ matrix
$$ M = \sum_{i=1}^n P_i^T \left(I_{3x3} - \frac{x_ix_i^T}{x_i^Tx_i}\right)P_i $$
where $P_i$ and $x_i$ are $3 \times 4$ and $3 \times 1$, respectively. The $P_i$'s are camera perspective projection matrices. My goal is to optimize the $x_i$'s locally to make matrix $M$ singular.
The first approach I thought of was to try and express $M$'s determinant and then find its derivatives as a function of the $x_i$'s but this doesn't seem to be analytically doable.
Let $\pi_i=(I_{3x3} - \frac{x_ix_i^T}{x_i^Tx_i})$; it's the orthogonal projection on ${x_i}^{\perp}$; thus $\pi_i$ has rank $2$ and $M_i=P_i^T\pi_iP_i$ too (because $P_i$ is surjective ad $P_i^T$ is one to one). Finally $M$ is the sum of $2,3$ or $4$ such matrices $M_i$ and, therefore, has rank $4$ in general position. Note that we may assume that the $(x_i)_i$ have a norm equal to $1$.
Let $\det(M)=f((x_i)_i)=\sum_iP_i^T(I-x_ix_i^T)P_i$.
The question you ask can be rewritten as follows: let $(h_i)_{i\leq n}$ be $3\times 1$ unknown vectors.
Problem. Find the minimum of $\sum_i||h_i||^2$ under the conditions
$||x_i+h_i||=1,i\leq n$ and $f((x_i+h_i)_i)=0$.
The idea is to construct an iterative algorithm, replacing the function $f$ with $f(x_i)+Df_{x_i}(h_i)$. To do that, we use the Maple NLPSolve; of course, we must change the constraint $f(x_i+h_i)=0$ with $f(x_i+h_i)=kf(x_i)$ where $k\in(0,1)$; one must write a little procedure that calculates a "good" $k$ (begin, for example with $k=0.1$ and while NLPSolve gives a result, increase $k$). So we are getting closer to a good solution; less than $10$ iterations suffice in general.
That follows (if you are interested) is the procedure I wrote in Maple for $n=3$; I did'nt write explicitly the cycle "od..do".