Let $A,B$ be commuting positive operators on a Hilbert space such that $\langle(A-B)(A+B)x,x\rangle=0$ for all $x$ in the Hilbert space. Prove that $A=B$.
My attempt: The above implies that $A=B$ on the image of $A+B$, hence on the closure on the image. So I have to show $A=B$ on the kernel of $A+B$. How to proceed?
As $A$ and $B$ commute, you have $\langle (A^2-B^2)x,x\rangle=0$ for all $x$, so $A^2=B^2$. Now you can use that both $A,B$ are positive, so $A$ is the unique positive square root of $A^2$, and likewise with $B$. So $A=B$.
I don't immediately see how to prove that $A=B$ in the kernel of $A+B$ other than doing what I did above, which shows $A=B$ everywhere.