Generalization of Remainder Theorem Technique Generalization of this question
$$\frac{x^{2021}}{x^3 +x^2+x+1}$$
We wish to determine the remainder for the expression above. As in the linked question, write
$$x^{2021}=({x^3 +x^2+x+1})P(x)+ R(x)$$
To eliminate the term with P(x) let
$$x^3 +x^2+x+1=0\Rightarrow x^4 =1$$
We must then have:
$$R(x)= x^{2021}=x^{2020}\times x=1 \times x =x$$
Second Example
The remainder of $x^{2023}$ when dividing by $x^3+x^2+x+1$ will be after reduction:
$$x^{2023}=x^3=-(x^2+x+1)$$
(You can write this more formally using the Remainder Theorem, but this is a shorter version).
Further generalization
We can generalize this technique. To find the remainder when dividing by
$$1+x+x^2+...+x^n$$
substitute
$$x^{n+1}=1,x\neq1$$
Is this correct?
 A: As opposed to blindly using "eliminate the term", a simple explanation of why that works is just algebraic manipulation:
$$\begin{align} & x^{2021} \\
= & (x^4 -1 ) A(x) + x \\
= & (x^3+x^2+x+1) B(x) + x.\\
\ \\
& x^{2023} \\
= & (x^4 -1 ) C(x) + x^3 \\
= & (x^3+x^2+x+1) D(x) + x^3 \\
= & (x^3+x^2+x+1)E(x) + (-x^2-x-1).\end{align}$$
Note: Of course, I'm using that $ x^{2020} - 1 = (x^4 - 1) \times F(x)$, which could be demonstrated directly via algebraic manipulation.
General idea: If we want to divide by the polynomial $P(x)$, which has a "simpler" form of $P(x) Q(x)$, then we can write it out step by step.
This could be applied even if $P(x)$ isn't a factor of $ x^n - 1 $.   The hard part is guessing what $Q(x)$ could be to "simplify" the polynomial.
Here's a worked example, with the solution hidden.

What is the remainder when $x^{2021} $ is divided by $x^2 + 2x + 2$?


 Using Remainder-Factor theorem might be a slight pain (esp if someone isn't comfortable with complex numbers) as the roots are $-1 \pm i$, which we have to take to the 2021 power and equate to $Ax+B$.


 However, if you recognize the Sophie-Germain factorization $ x^4 + 4 = (x^2 - 2x + 2 ) (x^2 + 2x + 2)$, we see that
$$x^{2021} = (x^4 + 4 ) A(x) + 4^{403} x^5  = (x^4 + 4)B(x) - 4^{404} x.$$

Here's an example of you to practice on:

What is the remainder when $x^{2021} $ is divided by $x^4 - 2x^2 + 2$?

A: The observation which you made is nontrivial.
Actually when you take $x^4 = 1$ and conclude that $x^{2021} = x$ then we can not immediately conclude that the remainder is $x$ because what you have observed here is if $a$ is a number such that $a^4 = 1$  then $a^{2021}= a$ . Note that $a = \pm 1, \pm i$ satisfies this equation. The correct way is to do is write
$x^{2021} = g(x)q(x) + r(x)$ where $g(x) = x^3 + x^2 + x + 1$ and $r(x)$ is the remainder. Since $g(i) = g(-i) = g(-1) = 0$ we have $i^{2021} = r(i), (-i)^{2021} = r(-i)$  and $(-1)^{2021} = r(-1), r(-i) = -i$ and $r(-1) = -1$.
By remainder theorem for polynomials, we may assume that $r(x)$ is at most quadratic and then it is easy to see that the only polynomial satisfying the above condition is $r(x) = x$. A similar approach can be used in the other example that you gave.
Actually your pattern works in general.
In general:
Assume that all polynomials have rational coefficients.
Let $p(x)$ be an irreducible factor of largest degree of  $g(x)$ and $a$ be a number such that $p(a) = 0$ . The field $\frac{\mathbb{Q}[x]}{(p(x))}$ is isomorphic to $\mathbb{Q}(a)$ and the isomorphism is given by $c_0 + c_1 x + \ldots + c_{n-1} x^{n-1} + (p(x)) \mapsto c_0 + c_1a + \ldots c_{n-1} a^{n-1}$ where $n = \deg p(x)$
Consider a polynomial $f(x)$ then by division algorithm there exist $r(x)$ and $q(x)$ such that $f(x) = q(x)g(x) + r(x)$.  We can write $g(x) = p(x)q_1(x)$ and $f(x) = p(x) q(x)q_1(x) + r(x)$ hence the remainder of $f(x)$ when you divide by $g(x)$ is same as when you divide by $p(x)$ if $\deg r(x) < \deg p(x)$. So $f(x)  + (p(x)) = r(x) + (p(x))$. But $r(x)+(p(x))$ is equivalent to $r(a)$, so it is sufficient to write  $f(a)$ in terms of $c_0 + c_1 a + \ldots c_{n-1} a^{m-1}$ where $m < \deg p(x)$.
So in your case, you showed that if $g(x) = x^3+ x^2 + x + 1$ and we have $p(x) = x^2 + 1$. So you can choose $a = i$ so that $f(a) = a$ now using the isomorphism we see that $r(x) = x$.
Note: If $a$ is a rational number it may be difficult to point out the exact form of remainder for example if $g(x) = x^2-1$ and $f(x) = x^{2021}$ then you may take $a =1$ and see that $f(a) =1$. However $r(x) \ne 1$ but $r(x) = x$ and this kind of confusions arises. So this works better if $a$ is irrational.
