Lemma 29.7.3. Let $X$ be a scheme. Let $U \subset X$ be an open subscheme. If the inclusion morphism $U \to X$ is quasi-compact, then $U$ is scheme theoretically dense in $X$ if and only if the scheme theoretic closure of $U$ in $X$ is $X$.

Proof. Follows from Lemma 29.6.3 part (3). $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).