In quantum mechanics, observables are represented by Hermitian operators. Mathematically, two operators $\hat A$ and $\hat B$ commute if $$\tag 1 [ \hat A, \hat B]=\hat A \hat B- \hat B \hat A = 0$$


Hermitian operators which satisfy (1) are also called _compatible observables_ meaning that both can be measured _simultaneously_. 

Hermitian operators which do not commute and do not satisy (1) are called incompatible observables, and a good example of this in quantum mechanics are [the canonical commutation relations](https://en.wikipedia.org/wiki/Canonical_commutation_relation). 

**Now:**

Operators or observables that commute with the Hamiltonian of the system are **conserved quantities**, e.g. angular momentum or spin. This means that these quantities do not change with time. Those that do not commute with the Hamiltonian, are not conserved quantities.

To summarise, if $\hat H$ is the Hamiltonian of the system then if

$$[\hat H, \hat O] = 0$$ then $\hat O$ is conserved and $$\frac{d \hat O}{dt}=0$$ but if
$$[\hat H, \hat O] \ne 0$$ then $\hat O$ is *not* conserved and $$\frac{d \hat O}{dt} \ne 0$$

Commutation relations also do not depend on our choice of basis meaning they work just as well in coordinate space as they do in momentum space. This is a [powerful result used in quantum mechanics](https://en.wikipedia.org/wiki/Position_and_momentum_space).