Whilst working on a project I kept stumbeling across two different expressions for the standard deviation $\Delta{X}^2 = <(X - <X>)^2 >$ and the other $\Delta{X}^2 = <X^2> - <X>^2$. In one of my books I found the following "derivation" $$\Delta{X}^2 = \langle(X - \langle X\rangle)^2 \rangle$$ $$ = \langle X^2 - 2X\langle X \rangle + \langle X \rangle ^2 \rangle $$ $$= (\langle X^2 \rangle- \langle X \rangle ^2) $$
It is the jump from the second to the last line that doesnt make any sense to me because the way I understand it this would imply:
$$ X\langle \psi|X|\psi\rangle = \langle\psi|XX|\psi\rangle$$ And this cannot be the case since X is an operator, no?
And on an unrelated note, how do I use the braket notation in LaTeX?