Find (a generating set for) $\mathbb{Q}[x]\cap I$ where $I=\langle x^2-y,y^2-x,x^5-x^2\rangle$ (generate gröbner basis). Consider the polynomial ring $\mathbb{Q}[x,y]$ and the ideal $I=\langle x^2-y,y^2-x,x^5-x^2\rangle$ in $\mathbb{Q}[x,y]$. $G=(x^2-y,y^2-x)$ is a (reduced) gröbner basis for $I$ wrt. graded lexicographic ordering.


*Find $\mathbb{Q}[x]\cap I$ (That is find a set of generators for $\mathbb{Q}[x]\cap I$ as an ideal in $\mathbb{Q}[x]$).


To solve this problem I believe I want to find a gröbner basis for $\mathbb{Q}[x]\cap I$. But how do I do that?
Usually for these types of problems I have some ideal $J=\langle f_1,f_2,...,f_n\rangle$. I then consider $H=(f_1,f_2,...,f_n)$ and check if $H$ is a gröbner basis for J. If it's not then I can create one by using Buchbergers Algorithm.
However, in this problem it's kind of the opposite problem. I don't know the generators for $\mathbb{Q}[x]\cap I$. Is $\mathbb{Q}[x]\cap I$ all the one-variable polynomials in $x$ that $I$ "span" ? Or what do it really mean?
how do I approach this problem?
 A: Nvm. I found the following theorem:

Theorem 5.9.1 Let $G$ be a Gröbner basis for an ideal $I \subseteq k\left[X_{1}, \ldots, X_{n}\right]$ with respect to the lexicographic ordering $\leq$ given by $X_{1} \leq X_{2} \leq \cdots \leq X_{n}$. Then $G \cap k\left[X_{1}, \ldots, X_{i}\right]$ is a Gröbner basis for the ideal $I \cap k\left[X_{1}, \ldots, X_{i}\right]$ in $k\left[X_{1}, \ldots, X_{i}\right]$ with respect to the lexicographic ordering $\leq$ for the polynomials in $k\left[X_{1}, \ldots, X_{i}\right]$.

So I believe I just have to compute a gröbner basis G' for I wrt. the lexicographic order $x>y$. After this, I can find the intersection $G'\cap \mathbb{Q}[x]$, which will just be polynomials in only the x-variable. Then $\langle G'\cap \mathbb{Q}[x] \rangle$ will generate $I\cap \mathbb{Q}[x]$.
I do have one question though. As far as I know $y>x$ could also be a lexicographic ordering. So using this ordering I could generate a different gröbner basis and thus find different generators for $I\cap \mathbb{Q}[x]$. Is that a problem or do they still generate the same ideal?
