Let $H$ be a complex Hilbert space. If $B$ is a bounded self-adjoint operator on $H$ then its spectrum is a closed and bounded subset of the real line and we can find its extremes in terms of the quadratic form $(B\psi, \psi)$:
$\min (\sigma(B))=\inf_{\psi \in H} \frac{(B\psi, \psi)}{\lVert \psi\rVert^2}, \quad \max(\sigma(B))=\sup_{\psi \in H} \frac{(B\psi, \psi)}{\lVert \psi\rVert^2}$
(cf. Brézis, Functional analysis, Sobolev spaces and PDE, §6.4, Proposition 6.9, p. 165 - link)
Question 1. Does this extend to the unbounded case? Specifically, I think it is true that, given a self-adjoint operator $A\colon D(A)\subset H \to H$, we have
$\inf (\sigma(A))=\inf_{\psi \in D(A)} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2}, \quad \sup(\sigma(A))=\sup_{\psi \in D(A)} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2};$
where of course we allow for infinite inf's and sup's.
Question 2. If the answer to 1. is affirmative, can we replace
$\inf_{\psi \in D(A)} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2} \quad \text{and}\quad \sup_{\psi \in D(A)} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2}$
with
$\inf_{\psi \in D} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2} \quad \text{and}\quad \sup_{\psi \in D} \frac{(A\psi, \psi)}{\lVert \psi\rVert^2}$
where $D\subset D(A)$ is a dense subset? I guess that we cannot unless $D$ is a core for $A$, that is a domain of essential self-adjointness.
Thank you.