Polynomial Question Find polynomials $A(x)$ and $B(x)$ such that $A(x)P(x) + B(x)Q(x) = x + 1$ for all $x$ where $P(x) = x^4 - 1$ and $Q(x) = x^3 + x^2$. I'm stumped on this question. I know that I'm supposed to apply the extended version of Euclid's algorithm for polynomials but I'm unsure of how to do that. I thought about trying to create some kind of linear system but guessing arbitrary coefficients but that wouldn't work as $A$ and $B$ don't have fixed degrees.
 A: By using Extended Euclidean Algorithm,
$$\begin{align}
x^4-1 =& \left(x^3+x^2\right)(x-1) +x^2-1\\
x^3+x^2 =& \left(x^2-1\right)(x+1) + x+1\\
x^2-1 =& \left(x+1\right)(x-1) + 0
\end{align}$$
And so $x+1$ is the GCD of $P(x)$ and $Q(x)$. Now, we substitute previous remainders to the second-to-last line:
$$\begin{align}
x+1 =& \left(x^3+x^2\right) - \left(x^2-1\right)(x+1)\\
=& \left(x^3+x^2\right) - \left[\left(x^4-1\right) - \left(x^3+x^2\right)(x-1)\right](x+1)\\
=& \left(x^3+x^2\right)\left[1+(x-1)(x+1)\right] - \left(x^4-1\right)(x+1)\\
=& \left(-x-1\right)\left(x^4-1\right) + x^2\left(x^3+x^2\right)\\
\end{align}$$
Therefore, $A(x) = -x-1$ and $B(x)=x^2$ is a pair of solution.
A: We have $P=(x^4-1)=(x+1)(x-1)(x^2+1)$ and $Q=(x+1)x^2$.
We can divide through by the common factor $(x+1)$, getting $Q_1={\bf x^2}$ and $P_1=(x-1)(x^2+1)=(x-1){\bf x^2}+(x-1)=(x-1)Q_1+\,{\bf (x-1)}$.  $\ \ (1)$
Now let's continue the division: ${\bf x^2}=(x+1){\bf (x-1)}\,+1$.
Writing back $(x-1)$ from $\,(1)$, we have 
$$Q_1=(x+1)\,{\it (P_1 - (x-1)Q_1)} \  +1$$
And from this, we can express $1$ as linear combination of $P_1$ and $Q_1$ with polynomial coefficients.
