Finding polynomials so that m=af+bg Let
$$
f(x)=3x^4 -2x^3-6x^2+7x-2 
$$
and
$$
g(x)=3x^4 -8x^3+13x^2-12x+4
$$
I want to find two polynomials $a$ and $b$ so that
$$
m=af+bg 
$$
whereas $m$ is the greatest common divisor.
I have this: With some basic algebra, I got $f(x)=(x-1)(3x-2)(x^2-x+2)$ and
$g(x)=(x-1)(3x-2)(x^2+x-1).$
So $m=(x-1)(3x-2).$
Now I have
$(x-1)(3x-2)=a(x-1)(3x-2)(x^2-x+2)+b(x-1)(3x-2)(x^2+x-1),$ which is equivalent to
$m=m(a(x^2-x+2)+b(x^2+x-1)),$ and furthermore,
$$1=a(x^2-x+2)+b(x^2+x-1)=(a+b)x^2+(b-a)x+2a-b.$$
I read something about Bézout's Identity and with the euclidean algorithm I'll try to reach my goal. Thanks for the help in the comments.

Let $a=a_kx^k+...+a_1x+a_0$, $b=b_lx^l+...+b_1x+b_0$.
If $k> l$ then $(a+b)x^2+(b-a)x+2a-b$ will have term $ax^{k+2}$, that cannot be compensated by other terms.
Same for $l > k$, therefore $l=k$.
Then $(a+b)x^2+(b-a)x+2a-b$ will contain members from $x^{k+2}$ down to $x^0$ , totally $k+3$ terms, defined by $2k+2$ coefficients of $a$ and $b$.
To get unique solution we can suggest $k+3=2k+2 \Rightarrow k=1$.
Other explanation: $f^*=x^2-x+2$, $g^*=x^2+x-1$, $af^*+bg^*\equiv 1 \Rightarrow a^*f^*+b^*g^*\equiv 1$, where $a^*=a-k g^*$, $b^*=b+k f^*$. $a^*\equiv a \pmod{g^*}$, so we can select from set of $a^*$ such $a$ that has power less than $g^*$.
Then we can take $a=a_1x+a_0$, $b=b_1x+b_0$:
$$(a+b)x^2+(b-a)x+2a-b=$$ $$(a_1+b_1)x^3+(b_1-a_1+a_0+b_0)x^2+(2a_1-b_1+b_0-a_0)x+2a_0-b_0\equiv 1\Rightarrow$$ $$a_1+b_1=0, b_1-a_1+a_0+b_0=0, 2a_1-b_1+b_0-a_0=0, 2a_0-b_0=1\Rightarrow$$ $$a_1=2/11,a_0=5/11, b_1=-2/11, b_0=-1/11$$
$$a=\frac{2x+5}{11}, b=\frac{-2x-1}{11}$$
