Some question on localization of polynomial ring Let $S=A[x_1,\dots, x_r](r \geq 2)$ be a polynomial ring where $A$ is a commutative ring.
Then is it true that $S=\bigcap_{i=1}^r S_{x_i}$? If $S$ is $A$-algebra and $x_i$ are not zero divisors, then is it true?
 A: Let's assume $r=2$ and prove $S=S_{x_1}\cap S_{x_2}$. (As Hartshorne mentions the intersection takes place in $S_{s_1x_2}$.) Pick $w\in S_{x_1}\cap S_{x_2}$. Then $w=f/x_1^m=g/x_2^n$ with $f,g\in S$. If $m=0$ or $n=0$ we are done. Suppose $m,n\ge 1$. Write $f=a_0(x_1)+a_1(x_1)x_2+\cdots+a_s(x_1)x_2^s$ and $g=b_0(x_1)+b_1(x_1)x_2+\cdots+b_t(x_1)x_2^t$ with $a_s\neq 0$, $b_t\neq 0$. Since $x_2^nf=x_1^mg$ we get $$x_2^n[a_0(x_1)+a_1(x_1)x_2+\cdots+a_s(x_1)x_2^s]=x_1^m[b_0(x_1)+b_1(x_1)x_2+\cdots+b_s(x_1)x_2^t].$$ Now consider both sides as polynomials in $x_2$ with coefficients in $A[x_1]$ and identify the coefficients. One obtains $t=n+s$ and $x_1^mb_0(x_1)=\cdots=x_1^mb_{n-1}(x_1)=0$. But $x_1$ is a non-zerodivisor in $A[x_1]$, so $b_0(x_1)=\cdots=b_{n-1}(x_1)=0$. This shows that $x_2^n\mid g$, and thus $w\in S$.
For $r\ge 2$ the proof is the same with some minor changes. 
If $S$ is an $A$-algebra and $x_i$ are non-zerodivisors the property can fail: consider $S=K[x,y]$ with $x^2=y^3$. This is an integral domain and $\frac{1}{x^2}\in S_x\cap S_y$, but $\frac{1}{x^2}\notin S$.
A: First of all you want to take the intersection inside of the fraction field, so I believe you need that $A$ be at least a domain. Now the result you ask for I believe holds at least in the case that $A$ is a UFD. Here is how we prove this result. Suppose you have some element $g$ that is in $S_{x_i}$ and $S_{x_j}$ where $i \neq j$. Then we can write $$g = f/x_i^k= h/x_j^l$$
where $f,h \in A[x_1,\ldots,x_n]$. Now since $A$ is a UFD, $A[x_1,\ldots,x_n]$ is a UFD so we may assume wlog that $f$ and $x_i$ have not common factor, similarly for $x_j$ and $h$. It will now follow that $fx_j^l = hx_i^k$ and so $x_i$ has to divide $x_j^l$. But then necessarily $ l = k = 0$ and so $g$ is just a plain old element of $A[x_1,\ldots,x_n]$.  
