Expressing gcd as a linear combination of two polynomials

discrete mathematicsgcd-and-lcmpolynomialsproof-explanation

I'm having trouble understanding how to go to the last line of this example.
Let

$m(x)=x^4-4x^3+4x^2-3x+14$ and $n(x) = x^4+8x^3+12x^2+17x+6$.

[…]

We establish that $gcd(m(x), n(x))=x^2+x+2$. Writing this as a linear combination of m(x) and n(x):

[…]

$x^2+x+2 = \frac{9}{49}\left(m(x)-(n(x)- m(x))\left( \frac{1}{12}x-\frac{7}{18} \right) \right) =$

I don't understand how they get the RHS of the next line

$x^2+x+2=\frac{1}{196}(3x+22)\cdot m(x) + \frac{1}{196}(-3x+14)\cdot n(x)$.

Best Answer

The 2nd last equation is incorrect - it has a spurious open paren after the $\frac{9}{49}$ which causes an incorrect parse. Deleting the paren yields the correct result, namely

$$ \tfrac{9}{49}\left(m(x)-(n(x)-m(x))\left(\tfrac{1}{12} x - \tfrac{7}{18}\right)\right)\qquad $$

Expanding that then collecting the polynomial coef's $\,\frac{1}{196}(ax+b)\,$ on $\,m(x)\,$ and $\,n(x)\,$ yields the final equation - which is correct.

Update $ $ A comment asks for further details. To verify the equality we scale the RHS of the final two equations both by $196$ to eliminate fractions. $196(9/49) = 36$ so RHS of 2nd last equation is

$$\begin{align} &\ \ \ \ \ \ 36m- 36\left(\tfrac{1}{12}x\!-\!\tfrac{7}{18}\right)\!(n\!-\!m) \\ &=\, 36m\ -\ (3x-14)\ (n\, -\, m)\\[.2em] &=\, m(3x\!+\!22)-n(3x\!-\!14)\end{align}\qquad\qquad$$

which equals $\,196 \times$ RHS of final equation $\color{#c00}\checkmark$

Related Question