From one polynomial over an algebraic extension to several over Q.
Hello, I have what I assume is a basic question, but it deals with objects I usually don't work with on Sage and want to save some time. I have a polynomial $p(x_1,...,x_n)$ with coefficients in $Q[\sqrt 2 ]$. The way how i am extracting it gives a bunch of coefficients of the field that are fractions with irrational denominators. On the other hand, the polynomial can be written as $p(x_1,\dots,x_n) = q(x_1,\dots, x_n) + \sqrt {2} r(x_1,x_2,\dots, x_n)$ with $q$ and $r$ polynomials with rational coefficients. I am not used to work with field extensions and changing fields, but was wondering how to write a function that takes $p$ as an input and outputs $q$ and $r$.
(PS. in my particular case I have several inputs of $p$ and the number of variables is $n=15$). Thank you.