Finding quotient and remainder of this polynomial in fields This question was asked in my algebra mid term exam  and I was unable to solve it:
Determine the quotient and the remainder of the division:

(a) of $f \in K[X]$ by $X^2 -a$ in K[X], where K is a field.


(b) of $X^m-1$ by $X^n-1$ in $\mathbb{Z}[x]$ for $m,n\in \mathbb{N}^*$.

I am severely confused.
Attempt:(a) cases when degree of f is less than 2 are trivial.  I can write $f(x) = (x^2-a) q(x)+r(x)$,  $f(x) = a_0+...+a_n x^n$.  r(x) will have degree 1. If I use synthetic divison,  I can get $f(X) = ( X-\sqrt a\,) q'(x) +r'(x)$. I can use synthetic division on $q'(x)$  again to get $f(x)= (x- \sqrt a\, ) (x+ \sqrt a\,) q(x) +r(x)$ I never used the property that K is a field=> I have to prove that $+\sqrt a , -\sqrt a$ exist in the field K. If $K$ is infinite and $K=\mathbb{Q}$, then this will not hold. So, my proof is not valid. How should I approach this problem?
(b) when $m<n$ then cases are trivial. Thoughts were similar as that of (a) and can't be used.
So, Can you please help me with this problem?
 A: I always find it somewhat disingenuous to ask to perform a calculation or determine properties of values that are completely unspecified, as $f\in K[X]$ in your case. Clearly here the quotient $q$ could be any polynomial at all and the remainder $r$ any polynomial of degree less than$~2$; what could it then possibly mean to determine them? They should at least have given some hint of what kind of description they are after, and what properties of$~f$ can be used in the description (you may probably use things like degree and individual coefficients, possibly the evaluation of $f$ at specific values in$~K$, but clearly not the result of Euclidean divisions performed on$~f$).
My guess here is that they want you to describe in general terms how the Euclidean division proceeds in these cases. For case (a) you may observe that the coefficients of $f$ in even and odd degrees are treated entirely separately, which can be made precise as follows. Let $P_0,P_1\in K[X]$ be the polynomials whose coefficients are those of$~f$ taken at even respectively odd positions, which means that $f=P_0[X:=X^2]+XP_1[X:=X^2]$. Then if $P_i=(X-a)Q_i+r_i$ by euclidean division for $i=0,1$ (so $Q_i\in K[X]$ and $r_i=P_i[X:=a]\in K$) then $f=(X^2-a)Q+R$ where $Q=Q_0[X:=X^2]+XQ_1[X:=X^2]$ and $R=r_0+r_1X$. If you look closely at how Euclidean division by $X-a$ proceeds, you can even express the coefficients of $Q_i$ in terms of those of $P_i$, but I'm not at all sure this is what they are after.
You are right that an attempt to describe the result in terms of evaluation of $f$ at vales $\pm\sqrt a$ are wrong since nothing ensures that those values exist in $K$, and are distinct if they do (this fails in characteristic$~2$).
I'll leave consideration of case (b); one can similarly describe the progress of Euclidean division here, and it has already been done in the comments.
