# Hermitian positive semi-definite-Square root

Problem:

Let $A$ be a Hermitian positive semi-definite $n$ by $n$ matrix (The field of scalars is $\mathbb{C}$). Let $B$ be an $n$ by $n$ matrix that commutes with A. Prove that $B$ and $\sqrt{A}$ commute.

I started to solve the problem like this: Since $A$ is a Hermitian positive semi-definite matrix, then there exits a unitary matrix $J$ such that: $$J^{-1}AJ=D=diag(\lambda _{1},\lambda _{2},...,\lambda _{n})$$ where: $\lambda _{i}\geq 0$ and $\lambda _{i}$ are eigenvalues of $A$, and since $A$ is Hermitian, then the eigenvalues are real.

Let $$F=\sqrt{A}=JCJ^{-1}$$ where $C=\sqrt{D}=diag\left ( \sqrt{\lambda _{1}},\sqrt{\lambda _{2}},...,\sqrt{\lambda _{n}} \right )$, and $\sqrt{\lambda _{i}}$ are eigenvalues of $F=\sqrt{A}$.

$AB=BA\Rightarrow JDJ^{-1}B=BJDJ^{-1}$

So, I need to use the above equality to prove this one: $$FB=BF\Rightarrow JCJ^{-1}B=BJCJ^{-1}\Rightarrow ...$$

Please let me know how I should finish my proof. Also, if anyone has a different solution, please share. Thanks

Note that for any polynomial $p\in\mathbb{R}[x]$, $p(A)=J^{-1}p(D)J$ (just do it first for monomials, and see that it works for linear combinations of monomials).
Now observe that, since $BA=AB$, then $BA^2=BAA=ABA=AAB=A^2B$, etc., so we conclude that $Bp(A)=p(A)B$ for any polynomial $p$.
Finally, choose a polynomial $p$ such that $p(\lambda_j)=\sqrt{\lambda_j}$, $j=1,\ldots,n$. Then $p(D)=C$, in the notation from the question, which implies that $p(A)={A}^{1/2}$.
So $$BA^{1/2}=Bp(A)=p(A)B=A^{1/2}B$$