Let $F$ be a field and $A,B \in M_n(F)$ (i.e., $A$ and $B$ are $n\times n$ matrices with entries in $F$). If there exist a linear combination of $A$ and $B$ which is invertible, then prove the equation $$AXB-BXA=0$$ has at least one invertible solution in $M_n(F)$.
Attempt.
If $A$ is invertible, then from $AXB=BXA$, we get $XBA^{-1}=A^{-1}BX$. Then, we see that $X=A^{-1}$ is a solution. Similarly, if $B$ is invertible, then $X=B^{-1}$ is a solution.
Assume that $\alpha A + \beta B$ is invertible. We claim that $X = (\alpha A + \beta B)^{-1}$ is the desired solution.
$\alpha$ and $\beta$ cannot both be $0$ so WLOG assume that $\alpha \ne 0$.
We have:
$$\alpha A(\alpha A + \beta B)^{-1}B + \beta B(\alpha A + \beta B)^{-1}B = (\alpha A + \beta B)(\alpha A + \beta B)^{-1}B = IB =B $$ $$\alpha B(\alpha A + \beta B)^{-1}A + \beta B(\alpha A + \beta B)^{-1}B = B(\alpha A + \beta B)^{-1}(\alpha A + \beta B) = BI =B $$
Subtracting these equalities gives:
$$\alpha A(\alpha A + \beta B)^{-1}B = \alpha B(\alpha A + \beta B)^{-1}A$$
Multiplication with $\frac1\alpha$ yields
$$AXB = BXA$$