I want to compute the derivative of a generalized eigenvalue $\lambda$ which is solution of $A u = \lambda Bu$ ($A,B,u,\lambda$ all depend on $t$; in my case $A,B$ are known explicitly, and the eigenvalue $\lambda$ and its corresponding eigenvector $u$ can be immediately computed using eigs).
If I write formally the derivation, I arrive to the problem $$ (A-\lambda B)u' = -(A'-\lambda B')u+\lambda' Bu \ \ \ (1)$$ In the above equation I know $A,B,\lambda,u,A',B'$. The unknowns are $\lambda'$ and $u'$. If $A,B$ are symmetric, we can get rid of $u'$ by taking the scalar product with $u$. In my case $A,B$ are not always symmetric, so I need to solve $(1)$ with both unknowns $u'$ and $\lambda'$.
This has the form $Xu' = v+\lambda ' w$ where $X$ is a known matrix (non-invertible) and $v,w$ are known vectors.
How can we compute $u'$ and $\lambda'$?