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.

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.
