Part (a) of Exercise 5.14 in Chapter II of Hartshorne: Show that $\bigoplus_{n\geq 0}\Gamma(X,\mathcal{O}_X(n))$ is the integral closure of $S$. I'm doing part (a) of Exercise 5.14 in Chapter II of Hartshorne: Let $k$ be an algebraically closed field, and $X\subseteq\mathbb{P}_k^r$ a connected, normal and closed subscheme. Let $S$ be the homogeneous coordinate ring, and $S'=\bigoplus_{n\geq 0}\Gamma(X,\mathcal{O}_X(n))$. Then we have to show that $S$ is a domain and $S'$ is its integral closure.
Following the hint of Hartshorne, I proved that $X$ is integral, and that $S$ is a domain. He then proposes to consider the sheaf of rings $\mathcal{S}=\bigoplus_{n\geq 0}\mathcal{O}_X(n)$, and show that it is a sheaf of integrally closed domains. And this is the point where I'm failing to see how to proceed.
In this post, Brian Ng is using the following argument: for $\mathfrak{p}\in\operatorname{Proj S}$, we have $$\mathcal{S}_\mathfrak{p}\cong\bigoplus_{n\geq0}S(n)_{(\mathfrak{p})}\cong\{\frac{s}{b}\ |\ b\notin\mathfrak{p}\text{ homogeneous, every non-zero homogeneous part of $s$ has degree $\geq\deg b$}\}\subseteq S_{\mathfrak{p},\text{ hom.}}$$
where $S_{\mathfrak{p},\text{ hom.}}$ is the localization of $S$ at the homogeneous elements not in $\mathfrak{p}$. With this I agree. However, he then sais that this is integrally closed as $S_{\mathfrak{p},\text{ hom.}}$ is (because $X$ is normal), and that therefore that $S'=\Gamma(X,\mathcal{S})$ is integrally closed to, and I don't see how exactly we may conclude this. First of all, $X$ being normal only implies that $X_\mathfrak{p}\cong S_{(\mathfrak{p})}=(S_{\mathfrak{p},\text{ hom.}})_0$ is integrally closed. Furthermore, how does one conclude from the stalks being integrally closed that every ring of sections of the sheaf is integrally closed?
 A: Suppose $x\in S_1$ is a linear form on $\Bbb P^n$ not in $\mathfrak{p}$. I claim $\mathcal{S}_\mathfrak{p}\cong S_{(\mathfrak{p})}[x]$: as $\mathfrak{p}\in D(x)$, we can write $(\mathcal{O}_X(n))_\mathfrak{p} = (\mathcal{O}_X(n)|_{D(x)})_\mathfrak{p}$ since restriction commutes with stalks. By the identification of $D(x)$ with $\Bbb A^n$, we have  $\mathcal{O}_X(n)|_{D(x)}$ is the sheaf associated to the $S_{(x)}$-module $x^nS_{(x)}$, and the prime ideal $\mathfrak{p}$ is associated to the prime ideal $\mathfrak{p}'=\mathfrak{p}_{(x)}$. So $$(\mathcal{O}_X(n)|_{D(x)})_\mathfrak{p} = (\widetilde{x^nS_{(x)}})_{\mathfrak{p}'}=x^nS_{(\mathfrak{p})}$$ and the direct sum $\mathcal{S}_\mathfrak{p}$ is $\bigoplus_{n\geq0} x^nS_{\mathfrak{p}}=S_\mathfrak{p}[x]$. As $S_{\mathfrak{p}}$ is integrally closed, $\mathcal{S}_\mathfrak{p}$ is too.
As for why integrally closed in all stalks means integrally closed for every open, define a sheaf $\mathcal{T}$ by the rule $\mathcal{T}(U)$ is the integral closure of $\mathcal{S}(U)$, which works because integral closure commutes with localization. Then $\mathcal{S}$ is naturally a subsheaf of $\mathcal{T}$ with the same stalks, which implies they must be equal.
