# [Physics] Measuring position and momentum at the same time

commutatorheisenberg-uncertainty-principleMeasurementsoperatorsquantum mechanics

In a non-relativistic quantum mechanical system in an infinite potential well. I try to measure the energy and the position of the system simultaneously. Since, the respective operators do commute according to Heisenberg's uncertainty relation I should be able to measure them both with infinite precision. Now, since I know that there is no potential energy in the well I can use $E=\frac{p^2}{2m}$ since the potential energy is 0 and determine it's momentum provided I know it's mass. But I shouldn't be able know the momentum and position simultaneously with infinite precision! So where am I going wrong?

If you are considering a system of a single particle in a potential well with infinitely high walls and with finite width, the energy operator is $H = \frac{p^2}{2m} + V(x)$ where $V(x)$ is the potential energy operator, vanishing inside the well and infinite outside it. Being that $\frac{p^2}{2m}$ does not commute with $x$, how are you saying that the energy and position operators commute? Besides, if that were true than we could place a particle in any point inside the well and the particle would stay there forever.