If $x^2 - 3x + 2$ is a factor of $x^4 - px^2 +q$, then find the value of $p$ and $q$ If $x^2 - 3x +2$ is a factor of $x^4-px^2+q$ then find the value of $p$ and $q$.
My attempt:
$$x^2-3x+2$$
$$x^2-2x-x+2$$
$$x(x-2)-1(x-2)$$
$$(x-1)(x-2)$$
How do I proceed further?
P.S: Edit after Deepak's comment!

Using long division:
$$ \frac{x^4 - px^2 + q}{x^2-3x+2} = x^2 + 3x + \frac{(7-p)x^2 - 6x +q}{x^2-3x+2}.$$
Look at the last fraction. By inspection, the ratio will be equal to $2$ if
$$ 7-p = 2 \implies p = 5$$
$$q = 4$$
Note: Previously, I mistook $q$ for $9$.
