Hello everyone

I would like to have a detailed reference to the statement bellow:

Let $A,B\in \mathbb{R}^{n\times n}$ such that $AB=BA$. Suppose $A$ has real eigenvalues only and $B$ is diagonalizable. Then, there exists a nonsingular matrix $P$ such that $P^{-1}AP$ is of Jordan canonical form and $P^{-1}BP$ is diagonale. Precisely \begin{equation*} P^{-1}AP=\mathrm{diag}(J_{1},\cdots,J_{r}) \quad\text{and}\quad P^{-1}BP=\mathrm{diag}(\underset{p_{1}}{\underbrace{\mu_{1},\cdots,\mu_{1}}},\cdots,\underset{p_{r}}{\underbrace{\mu_{r},\cdots,\mu_{r}}}) \end{equation*} where $J_{k}$ is a Jordan block of size $p_{k}$.