The arithmetic was explained by John. I explain how to eliminate such error-prone arithmetic by replacing the painful back-substitution with simpler forward-computation of the Bezout identity using row-operations. Using the verson of the Extended Euclidean Algorithm described here yields
$$\begin{array}{rrr}
(1)\quad x^5+1 & 1 & 0\\
(2)\quad x^3+1 & 0 & 1\\
(1)+x^2(2)\equiv_{2} (3)\quad x^2+1 & 1 & x^2\\
(2)\ +\ x(3)\equiv_2(4)\quad\ \ x+1 & \color{#c00}x & \color{#0a0}{x^3+1}\\
(x\!+\!1)(4)+(3)\equiv_2 (5)\qquad\ \ 0\quad\! & \ldots & \ldots
\end{array}\qquad\qquad\qquad\ \ $$
where the above lines $\ a\ \ b\ \ c\ $ denote that $\ a\, =\, b(x^5+1) + c(x^3+1).\ $ So the Bezout identity is
$$ x+1 \,=\, \color{#c00}{x}(x^5+1)+ (\color{#0a0}{x^3+1})(x^3+1)\quad $$
The linked post describes the algorithm in great detail, in a way that is easy to remember.
Here is another example computing $\rm\ gcd(141,19),\,$ with the equations written explicitly
$$\rm\begin{eqnarray}(1)\quad \color{#C00}{141}\!\ &=&\,\ \ \ 1&\cdot& 141\, +\ 0&\cdot& 19 \\
(2)\quad\ \color{#C00}{19}\ &=&\,\ \ \ 0&\cdot& 141\, +\ 1&\cdot& 19 \\
\color{#940}{(1)-7\,(2)}\, \rightarrow\, (3)\quad\ \ \ \color{#C00}{ 8}\ &=&\,\ \ \ 1&\cdot& 141\, -\ 7&\cdot& 19 \\
\color{#940}{(2)-2\,(3)}\,\rightarrow\,(4)\quad\ \ \ \color{#C00}{3}\ &=&\, {-}2&\cdot& 141\, + 15&\cdot& 19 \\
\color{#940}{(3)-3\,(4)}\,\rightarrow\,(5)\quad \color{#C00}{{-}1}\ &=&\,\ \ \ 7&\cdot& 141\, -\color{#0A0}{ 52}&\cdot& \color{#0A0}{19} \end{eqnarray}\qquad$$