Find Highest Common Factor of two polynomials $\ 2(x^4+9)-5x^2(x+1),\ 2x^3(2x-9)+81(x-1)$ Find the H.C.F. of $\ 2(x^4+9)-5x^2(x+1),\ 2x^3(2x-9)+81(x-1)$
I can't really see any pattern by inspection, so I carry out the multiplication with the brackets: $2x^4+18-5x^3-5x^2,\ 4x^4-18x^3+81x-81$
I tried to divide them into each other to find the common factor (Euler's method or something? I forgot). I did the obvious first step by multiplying $2x^4+18-5x^3-5x^2$ by $2$, then subtracting that from $4x^4-18x^3+81x-81$, but the result is $-8x^3+10x^2+81x-117$, so clearly continuing this way is almost impossible by hand. Now I don't know what to do. The answer is given as $2x^2-9x+9$, so I'm not understanding something here. Thanks for your help.
 A: You are thinking about The Euclidean algorithm applied to polynomials.
Certainly, the algorithm can be done by hand although it is a bit tedious:
$$\begin{align}
4x^4 - 18x^3 + 81x - 81 &= 2(2x^4 - 5x^3 - 5x^2 + 18) + (-8x^3 + 10x^2 + 81x - 117) \\
4(2x^4 - 5x^3 - 5x^2 + 18) &= (-x)(-8x^3 + 10x^2 + 81x - 117) + (-10x^3 + 61x^2 - 117x + 72) \\
5(-8x^3 + 10x^2 + 81x - 117) &= 4(-10x^3 + 61x^2 - 117x + 72) + 97(-2x^2 + 9x - 9) \\
97(-10x^3 + 61x^2 - 117x + 72) &= 5x(-2x^2 + 9x - 9) + 776(2x^2 - 9x + 9) \\
-2x^2 + 9x - 9 &= (-1)(2x^2 - 9x + 9) + 0.
\end{align}$$
All that remains is to check that $2x^2 - 9x + 9$ does in fact divide both polynomials.
A: Then
$$f:=2x^4+18-5x^3-5x^2=(2x-3)(x-3)(x^2+2x+2)$$
and
$$g:=4x^4-18x^3+81x-81=(2x-3)(x-3)(2x^2-9)$$
Hence, $${\rm gcd}(f,g)=(2x-3)(x-3)$$
as desired.
Note: For $f$ we have the candidate rational root are $$\pm\left\{\frac{1}{2},\frac{3}{2},\frac{9}{2}, 1,2,3,6,9,18\right\} $$ But the these we have roots $\frac{3}{2}$ and $3$, then linear factor $(2x-3)$ and $(x-3)$ so $f=(2x-3)(x-3)(x^2+2x+2)$. Similar for $g$.
