In quantum mechanics how the expression of average value of an observable is derived? In Dirac's Principles of QM following is stated:
$$
\langle x | A + B | x \rangle = \langle x | A | x \rangle + \langle x | B |x \rangle
$$
but
$$
\langle x | AB | x \rangle \ne  \langle x | A | x \rangle \langle x | B | x \rangle
$$
and so $\langle x|A|x \rangle$ is not exact but average value of observable A otherwise in second relation both sides would have to be equal.
I don't understand the second relation. Shouldn't both side be equal like this,
$\langle x|AB|x \rangle = \langle x|A(B|x \rangle) = b \langle x|A|x \rangle = ba \langle x|x \rangle = ba = \langle x|A|x \rangle \langle x|B|x \rangle$ , where $a$ and $b$ are corresponding eigenvalues. What is wrong here?
Edit: It is embarrassing. I indeed was thinking $|x\rangle$ was eigenvector of both $A$ and $B$ out of sleep deprivation I suppose which I only realised this morning. So anyway I am going to ask moderator to delete this question.
 A: Maybe I could help you with your confusion. If we consider two hermitian operators (just ordinary QM) $A,B$ and regard
$$<v|AB|v>$$
you could run into several scenarios.

*

*$|v>$ is eigenstate for operator $A$ (with eigenvalue $a$) and operator $B$ (with eigenvalue $b$). Then your argumentation is correct.
$<v|AB|v>=ab<v|v>=<v|A|v><v|B|v>$


*If $|v>$ is not eigenstate to one of those operators (or both) then $<v|AB|v>=<v|A|v><v|B|v>$ does no longer hold in general.
We could consider one counter expamle:
$$A = \begin{bmatrix}0 & 1\\1 & 0\end{bmatrix}$$
$$B = A$$
$$AB = \begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}$$
$$|v> = \begin{bmatrix}1\\0\end{bmatrix}$$
Then :
$$<v|AB|v>=\begin{bmatrix}1&0\end{bmatrix}\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=1$$
But :
$$<v|A|v>=\begin{bmatrix}1&0\end{bmatrix}\begin{bmatrix}0 & 1\\1 & 0\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=0$$
In fact, this is very important to realise that the operators are not allways diagonal.
A: It is generally NOT true that $B|x\rangle=b|x\rangle$. This is only true if $|x\rangle$ is an eigenvector of $B$. However, there is another flaw in your reasoning. Even if $|x\rangle$ is an eigenvector of both $A$ and $B$ (as you assumed), it is NOT true that $\langle x| x\rangle=1$ (I assume $|x\rangle$ represents an eigenvector of the position operator $X$). Position eigenvectors are not normalizable in the usual sense. They are normalized to the dirac delta function such that $\langle y|x\rangle=\delta(y-x)$, which means $\langle x|x \rangle=\delta(0)$ in infinite.
