TITLE: Condition for two matrices to share at least one eigenvector?
QUESTION [21 upvotes]: Suppose that I have two matrices $A$ and $B$, and I want them to share a common eigenvector $x$.  For simplicity let's just assume that the eigenvalue associated with $x$ is $1$ for both matrices, so $Ax=x$ and $Bx=x$.  Is there a simple condition on $A$ and $B$ which is both necessary and sufficient for this to occur?
Edit: loup blanc's answer covers the case where the eigenvalues are not known, which is generally much more interesting than the case I was asking about, which is when both eigenvalues are 1.  The solution to my case is just that $\ker(A-I) \cap \ker(B-I) \ne 0$.  I would still be interested if someone found an even simpler condition which is equivalent to this, though.

REPLY [10 votes]: I'm not sure if this is what you're looking for, but Donu Arapura's website contains notes on algebraic geometry.  Starting on page 24 of the notes, he proves that the set of pairs of matrices $(A,B)\in M_n(k)\times M_n(k)$ (with $k$ algebraically closed) having a common eigenvector is Zariski closed in $M_n(k)\times M_n(k)$.
In particular, for each $n$, there is a system of polynomials in the entries of two arbitrary $n\times n$ matrices with the property that all of the polynomials vanish iff the matrices share a common eigenvector.  So, once you know these polynomials, you have an "simple, easily computable" way to check whether or not a pair of matrices shares a common eigenvector.
Unfortunately, he mentions that starting with $n=3$, the computation of what these polynomials is "painfully slow" on his computer.  (When $n=2$, is turns out the polynomial is $\det(AB-BA)$).  He also mentions, and later proves, that for $n > 2$, the system of polynomials must consist of more than one polynomial.  Thus, $\det(AB-BA)=0$ is necessary for sharing a common eigenvalue, but not sufficient as other answers have shown.