If $f(x)$ is a common factor of $g(x)$ and $h(x)$ find $f(x)$ Given that $f(x)$ is a common factor of $g(x)=x^4-3x^3+2x^2-3x+1$ and $h(x)=3x^4-9x^3+2x^2+3x-1$ find $f(x)$
I tried to factorised $g(x)$ but it doesn't have any rational roots as I've already tried 1 and -1.
So how do I solve this?

$$  \left(  3 x^{4}  - 9 x^{3}  + 2 x^{2}  + 3 x  - 1 \right)  $$ 
$$  \left(   x^{4}  - 3 x^{3}  + 2 x^{2}  - 3 x  + 1 \right)  $$ 
$$  \left(  3 x^{4}  - 9 x^{3}  + 2 x^{2}  + 3 x  - 1 \right)  =  \left(   x^{4}  - 3 x^{3}  + 2 x^{2}  - 3 x  + 1 \right)  \cdot \color{magenta}{  \left( 3  \right) } +  \left(   - 4 x^{2}  + 12 x  - 4 \right)  $$
$$  \left(   x^{4}  - 3 x^{3}  + 2 x^{2}  - 3 x  + 1 \right)  =  \left(   - 4 x^{2}  + 12 x  - 4 \right)  \cdot \color{magenta}{  \left(   \frac{  -  x^{2}  - 1 }{ 4 }  \right) } +  \left( 0 \right)  $$
$$ \frac{ 0}{1} $$
$$ \frac{ 1}{0} $$
$$ \color{magenta}{  \left( 3  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left( 3  \right) }{ \left( 1  \right) } $$
$$ \color{magenta}{  \left(   \frac{  -  x^{2}  - 1 }{ 4 }  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{  - 3 x^{2}  + 1 }{ 4 }  \right) }{ \left(   \frac{  -  x^{2}  - 1 }{ 4 }  \right) } $$
$$  \left(  3 x^{2}  - 1 \right)  \left( \frac{ 1}{4 } \right)  -  \left(   x^{2}  + 1 \right)  \left( \frac{ 3}{4 } \right)  =  \left( -1  \right)  $$
$$  \left(  3 x^{4}  - 9 x^{3}  + 2 x^{2}  + 3 x  - 1 \right)  =  \left(  3 x^{2}  - 1 \right)  \cdot \color{magenta}{  \left(   x^{2}  - 3 x  + 1 \right) } +  \left( 0 \right)  $$
$$  \left(   x^{4}  - 3 x^{3}  + 2 x^{2}  - 3 x  + 1 \right)  =  \left(   x^{2}  + 1 \right)  \cdot \color{magenta}{  \left(   x^{2}  - 3 x  + 1 \right) } +  \left( 0 \right)  $$
$$  \mbox{GCD} =   \color{magenta}{  \left(   x^{2}  - 3 x  + 1 \right) }   $$
$$  \left(  3 x^{4}  - 9 x^{3}  + 2 x^{2}  + 3 x  - 1 \right)  \left( \frac{ 1}{4 } \right)  -  \left(   x^{4}  - 3 x^{3}  + 2 x^{2}  - 3 x  + 1 \right)  \left( \frac{ 3}{4 } \right)  =  \left(   -  x^{2}  + 3 x  - 1 \right)  $$ 
well, there you go...
