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?
$A$ and $B$ are real but not symmetric. I don't mind assuming for the moment that they are diagonalizable.
Side note Edit: in my problem, $A$ is a positive matrix, and I want this shared eigenvector to beloup blanc's answer covers the Frobenius-Perron eigenvector of $A$. If this makescase where the problem easier, that's great, but ifeigenvalues are not known, then ignore it for now.
Any ideas are welcome. Thanks!
Edit: Although I am grateful for both ofwhich is generally much more interesting than the answers currently below,case I am still hoping that there is a simplewas asking about, easily computable constraint which is when both necessary and sufficienteigenvalues are 1. (Unfortunately, loup blanc's answer doesn't seem The solution to be easily computable whenmy case is just that $n$$\ker(A-I) \cap \ker(B-I) \ne 0$. I would still be interested if someone found an even simpler condition which is largeequivalent to this, and Mustafa Said's answer is necessary but not sufficient.) Thanks again for thinking about itthough.