Given two positive semidefinite matrices $A$ and $B$, I'd like to find the smallest x such that $xA-B$ is positive semidefinite.
If $AB=BA$, there's a common set of eigenvectors, so it's equivalent to $A$ and $B$ being diagonal. How would I do this when there's no such common basis?
If $A=0$, there is no minimum. If $A\ne0$, for $xA-B\succeq0$ to be solvable, it is necessary that $V:=\ker(A)\subseteq\ker(B)$.
Under the hypotheses that $A\ne0$ and $\ker(A)\subseteq\ker(B)$, the minimum $x$ such that $xA-B\succeq0$ is given by $x=\lambda_\max(A^+B)$, where $A^+$ denotes the Moore-Penrose pseudoinverse of $A$.
The proof is akin to the one in the case where $A$ is positive definite. Since $A$ and $B$ are Hermitian, $V$ and $V^\perp$ are their invariant subspaces. On $V^\perp$, $A$ is positive definite. Therefore the condition that $xA-B\succeq0$ is equivalent to that $xA_{V^\perp}-B_{V^\perp}\succeq0$, or that $x\operatorname{Id}_{V^\perp}-A_{V^\perp}^{-1/2}B_{V^\perp}A_{V^\perp}^{-1/2}\succeq0$, or that $$ x\ge \lambda_\max\left(A_{V^\perp}^{-1/2}B_{V^\perp}A_{V^\perp}^{-1/2}\right) =\lambda_\max\left((A^+)^{1/2}B(A^+)^{1/2}\right) =\lambda_\max(A^+B). $$