Why do the energy eigenvalues never depend on the position coordinate $x$? The eigenvalues of the Hamiltonian can depend on momentum $p$, only for a free particle where $[\hat p,\hat H]=0$. In this case, since the energy and momentum eigenvalues are given by the relations $$E=\frac{\hbar^2k^2}{2m},~ p=\hbar k$$ respectively, they jointly make the energy $E$ depend on momentum as $$E=\frac{p^2}{2m},$$ reproducing the classical result. But the energy eigenvalues never depend on the position coordinate $x$. I cannot remember any example where the energy eigenvalue varied as a function of $x$. However, I have a feeling that this is related to the noncommutativity of $\hat x$ and $\hat H$ i.e. $[\hat x,\hat H]\neq 0$. But I do not have a proof of this.
 A: The Hamiltonian of a particle in an external potential energy $V(x)$ can be written as
$$
H = -\frac{h^2}{2m} \nabla^2 + V(x)
$$
so indeed the energy operator does depend on the position coordinate.
It should be said, though, that a wave function $\psi(x)$ with definite energy $E$ satisfies
$$
H \psi(x) = E \psi(x)
$$
where $E$ is just a constant number. Eigenvalues, are, by definition, scalars. However, they depend on the parameters of the wave function. So for instance, if we have a collection of wave functions $\psi_i(x)$, where $i$ is just a label, then we can write
$$
H \psi_i(x) = E_i \psi_i(x).
$$
So here we see that the energy $E_i$, of course, depends on which wave function $\psi_i(x)$ we are talking about, i.e. it depends on the label $i$.
It's the exact same thing as having a matrix $A$ and a basis of eigenvectors $v_i$, which satisfy
$$
A v_i = \lambda_i v_i.
$$
The $\lambda_i$'s are constant, in the sense that they are scalars multiplying $v_i$, but obviously they depend on $i$!
If $V(x) = 0$, then we may label the wave functions $\psi_k(x)$ with the vector $k$ as
$$
\psi_k(x) = e^{- i k \cdot x}.
$$
So you see, $k$ is really a label, which labels different states $\psi_k(x)$. We then have
$$
H \psi_k(x) = \frac{\hbar^2 k^2}{2m} \psi_k(x)
$$
so
$$
E_k = \frac{\hbar^2 k^2}{2m}.
$$
Please notice that $E_k$ truly is a constant, because it just multiplies $\psi_k(x)$ as a scalar, but it depends on the parameter $k$, which labels which state you are talking about.
Edit: Proof: In order for $E$ to "depend" on the eigenvalue of the operator $\hat x$, the definite energy states would have to themselves be eigenstates of the $\hat x$ operator. These are given by the states
$$
\psi_{x_0}(x) = \delta(x_0 - x)
$$
where
$$
\hat x \psi_{x_0} (x) = x_0 \psi_{x_0}.
$$
If these states were eigenvectors of both $\hat x$ and $\hat H$, then $(\hat H \hat x - \hat x \hat H) \psi_{x_0}(x) = 0$. Because the $\psi_{x_0}(x)$ comprises a complete basis of states, then this proves that $[\hat{H},\hat{x}]=0$. Therefore $E$ cannot depend on the eigenvalues of $\hat x$ unless $[\hat{H},\hat{x}]=0$. QED.
A: Suppose you have an eigenstate of $H$, $\left|\psi\right\rangle $ of definite energy $E_0$. This means that the wave function in $E$-representation is,*
$$
\left\langle E\left|\psi\right.\right\rangle =\delta\left(E,E_{0}\right)
$$
Where by $\delta\left(E,E_{0}\right)$ I mean $\delta\left(E-E_{0}\right)$ if the spectrum is continuous, or $\delta_{E,E_{0}}$, in case it's discrete.
By twice using the closure relation --once in $x$-representation, and once in $E$-representation,
$$
I=\int dx\left|x\right\rangle \left\langle x\right|=\int dE\left|E\right\rangle \left\langle E\right|
$$
we get,
$$
\left|\psi\right\rangle =\int dx\left|x\right\rangle \left\langle x\left|\psi\right.\right\rangle =
$$
$$
=\int dx\int dE\left|x\right\rangle \left\langle x\left|E\right.\right\rangle \left\langle E\left|\psi\right.\right\rangle =
$$
$$
=\int dx\int dE\left|x\right\rangle \left\langle x\left|E\right.\right\rangle \delta\left(E,E_{0}\right)=
$$
$$
=\int dx\left|x\right\rangle \left\langle x\left|E_{0}\right.\right\rangle 
$$
What this identity is telling us is that when we have an eigenvector of the Hamiltonian with a definite value of $E$ (constant, yes, but constant with respect to what?), all the possible values of $x$ are integrated into it in some way, in the most general case in which $x$ and $H$ do not commute.
Now, suppose the Hamiltonian were diagonal in the $x$-representation. Which is what you seem to be suggesting as a possibility. Then, and only then --something that rarely ever happens--,
$$
\left\langle x\left|H\right|x'\right\rangle =E\left(x\right)\delta\left(x-x'\right)
$$
$$
E_{0}=\int dx\int dx'\left\langle E_{0}\left|x\right.\right\rangle E\left(x\right)\delta\left(x-x'\right)\left\langle x'\left|E_{0}\right.\right\rangle =
$$
$$
=\int dx\left\langle E_{0}\left|x\right.\right\rangle E\left(x\right)\left\langle x\left|E_{0}\right.\right\rangle =
$$
$$
=\int dxE\left(x\right)\left|\left\langle x\left|E_{0}\right.\right\rangle \right|^{2}
$$
There would be only one value of $x$ (say, $x_{0}$) that would give you a non-zero scalar product. And then,
$$
E_{0}=E\left(x_{0}\right)
$$
*I'm assuming that $\left\langle E\left|E\right.\right\rangle =1$, so I'm being somewhat cavalier there. I hope you forgive me.
