<s>[INST] Find polynomials $f(x),g(x)$ such that $f(x)p(x) + g(x)q(x) = 2x^2 + 6x +2$ Let $$p(x) = x^4 + 7x^3 + 14x^2 + 7x+1 $$$$q(x) = x^4 +10x^3 + 23x^2 + 10x+1$$ 
Find polynomials $f(x),g(x)$ with rational coefficients such that $$f(x)p(x) + g(x)q(x) = 2x^2 + 6x +2$$
I totally have no idea to solve this problem... Please help me to do it. Thank you!!
 [/INST] If you factor both polynomials in $\mathbb Q[x]$ you'll get
$p(x) = (x^2+3x+1) (x^2+4x+1)$
$q(x) = (x^2+3x+1) (x^2+7x+1)$
These factors are irreducible (Why?).
Therefore $gcd(p,q) = x^2+3x+1$. Now with the Euclidean algorithm (or some guessing) you should be able to get two polynomials $r,s$ such that $$r(x^2+4 x+1)+s(x^2+7 x+1) = gcd(x^2+4 x+1,x^2+7 x+1) = 1$$
If you multiply this by $2(x^2+3x+1)$ you get exactly what you want:
$$(2r) p + (2s)q = 2x^2+6x+2.$$
Hint 1:

 $r,s$ are of degree 1

Hint 2:

 $x+7$,$x+4$

</s>