Hypothesis: all polynomials are define over field $\mathbb{F}_p$, where $p$ is a large prime number.
Consider we have two polynomials, $p_1(x)$ and $p_2(x)$ (as defined above).
For simplicity assume they have some roots in common.
Question: How can we define a polynomial $p_3(x)$ (using $p_1(x)$ and $p_2(x)$) that contains those roots of $p_1(x)$ that are not roots of $p_2(x)$ ?
To be more clear, consider example below:
$p_1(x)=(x-a)\cdot(x-b)$
$p_2(x)=(x-a)\cdot(x-c)$
I need to know how to define $p_3(x)=x-b$, using polynomials $p_1(x)$ and $p_2(x)$
If you can compute the greatest common divisor of two polynomials, then $$p_3(x)=\frac{p_1(x)}{\gcd(p_1(x),p_2(x))},$$ will do the trick. This is always possible over (finite) fields.