I'm trying to understand the following example from Vakil's text:
I believe he wants to apply the gluability axiom of the structure sheaf, so he is looking for $f_1\in A_x$ and $f_2\in A_y$ such that $Res_{D(x),D(xy)}f_1=Res_{D(y),D(xy)} f_2$, so writes:
So we are looking for functions on $D(x)$ and $D(y)$ that agree on $D(x)\cap D(y)=D(xy)$
But what does he mean by "interpreting" in the statement below, and how is it related to the above?
i.e, we are interpreting $A_x\cap A_y$ in $A_{xy}$ (or in $k(x,y)$)
Next, he writes:
Clearly those rational functions with only powers of $x$ in the denominator, and also with only powers of y in the denominator, are the polynomials. Translation: $A_x\cap A_y=A$
At this point I've completely lost the discussion thread. I guess this is related to my previous confusion. Why do we need/want to consider $A_x\cap A_y$? How are $D(x), D(y), D(x)\cap D(y)$ related to this?
What are the $f_1$ and $f_2$ that we wanted to find? Have we found them? And suppose that we've found them. Then the gluability axiom tells us that there is $f\in \mathscr O_{\mathbb A^2}(U)$ such that $Res_{U,U_i} f= f_i$. How does this imply the last claim quoted below?
Thus we conclude $\Gamma(U, \mathscr O_{\mathbb A^2} )\equiv k[x,y]$

Yes, by the sheaf axioms, since $D(x)$ and $D(y)$ cover $D(x)\cup D(y)$ with intersection $D(x)\cap D(y)=D(xy)$, sections of $\mathcal{O}_X$ over $D(x)\cup D(y)$ are exactly the choice of an $f_1\in \mathcal{O}_X(D(x)) = A_x$ and $f_2\in \mathcal{O}_X(D(y))=A_y$ so that $f_1|_{D(xy)}=f_2|_{D(xy)}$ in $A_{xy}$.
Since $X$ is integral, all restriction maps are injective and given any inclusion of open subsets $W\subset U$ we may identify $\mathcal{O}_X(U)$ with it's image in $\mathcal{O}_X(W)$. Therefore if we want to ask whether $f_1|_{D(xy)}=f_2|_{D(xy)}$, we can just ask whether (the images of) $f_1$ and $f_2$ are the same element in $\mathcal{O}_X(D(xy))=A_{xy}$. To find all possible pairs of $f_1$ and $f_2$ which satisfy the desired property, we can take the intersection of $\mathcal{O}_X(D(x))=A_x$ and $\mathcal{O}_X(D(y))=A_y$ inside $\mathcal{O}_X(D(xy))=A_{xy}$.
I've explained why we want to consider $A_x\cap A_y$ above. (In case it's still not clear what $A_x$ has to do with $D(x)$, recall that by the construction of the structure sheaf, $\mathcal{O}_X(D(x))=A_x$ and similarly for $\mathcal{O}_X(D(y))=A_y$ and $\mathcal{O}_X(D(x)\cap D(y))=\mathcal{O}_X(D(xy))=A_{xy}$.)
From the computation that $A_x\cap A_y=A$, we know that the only possible pairs of $f_1,f_2$ which restrict as required are those where $f_1$ and $f_2$ are already the same element of $A$. By the first unquoted paragraph above, this implies the result.