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(x1,...,xn) with coefficients in Q[√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(x1,…,xn)=q(x1,…,xn)+√2r(x1,x2,…,xn) 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.