Simultaneous eigenbasis of the energy and momentum operators of a particle in a 1-dimensional box Does there exist a simultaneous eigenbasis of the energy operator $T=\hat{p}^2/2m$ and the momentum operator $\hat{p}=-i\hbar\, d/dx$, for a particle in a 1-dimensional box of unit length? 
Actually, one would expect that there is one because the commutator $[\hat{T},\hat{p}]=0$. However, I'm not sure about that because the full Hamiltonian has also a contribution of the (infinite) potential well.
Moreover, the eigenfunctions of the energy do vanish at the boundary of box, but the eigenstates of the momentum operator can never vanish there. However, the eigenfunctions of the momentum operator are also eigenfunctions of the energy. But the converse is not true.  
 A: No. The eigen-functions of momentum are of the form $\operatorname{e}^{ikx}$, and they fail the boundary conditions of the box. If you were working on a ring, with periodic boundary conditions, this would be possible. As it is, with a box you have to construct the standing wave functions from even and odd combinations of the momentum eigen-functions, and select those standing waves that obey the boundary conditions. The constructed functions will be eigen-functions of $\hat{p}^2$, but not $\hat{p}$.
If you want to think of it in terms of the commutator, you are correct that you need to consider the contribution of the boundary walls. You can handle them using step functions of finite height that will later be extended upward in a limit. So:
$$\hat{H} = \frac{\hat{p}^2}{2m} + D \left[\Theta(-\hat{x}) + \Theta(\hat{x} - a)\right],$$ for a box that extends from $0$ to $a$, and $\Theta(x)$ the Heaviside unit step function. Computing the commutator with $\hat{p}$ will give you:
$$[\hat{p}, \hat{H}]_{\operatorname{x-basis}} = D \left[\delta(-x) + \delta(x - a)\right],$$ which shows problems at the wall boundaries, as expected.
