TITLE: Proving $\operatorname{rank}A =\operatorname{rank}B$ when $AB = 2A + 3B$
QUESTION [7 upvotes]: $A$ and $B$ are two square matrices such that $AB = 2A + 3B$. Show that $\operatorname{rank}A =\operatorname{rank}B$.

I managed to prove that the matrices $A-3I$ and $B-2I$ are invertible and that $AB=BA$. 
Also if $A$ is invertible then $B$ is invertible because otherwise determinat of $2A$ would be $0$ which is false. 
I don't know what to do when $A$ is not invertible.

REPLY [7 votes]: We have
$$A(B-2I) = 3B$$
Since $B-2I$ is invertible, it follows that $\operatorname{rank} A = \operatorname{rank}(3B) = \operatorname{rank} B $.