if a polynomial p(x) is divisible by 2 polynomials (x-a) and (x-b) is it necessary that p(x) will be divisible by (x-a)(x-b)? I came across a question where we had to prove that a biquadratic polynomial $p(x)$ is divisible by a quadratic polynomial. In the solution, the quadratic polynomial was broken into 2 linear polynomials and by factor theorem it was shown that $p(x)$ is divisible by both the linear factors and hence it was concluded that $p(x)$ should be divisible by the quadratic polynomial.
I can't figure out why this is necessary? I tried to verify it for integers but it does not hold for integers, for example $12$ is divisible by $2$ and $12$ is divisible by $4$, but $12$ is not divisible by $4\times 2=8$. So why is it true for polynomials? Please guide me.
 A: First, when talking about polynomials, it is important to be clear about where the coefficients come from. Everything I'm about to say about polynomials is true if the coefficients are integers, rational numbers, real numbers, or complex numbers. In fact, if the coefficents come from $R$, then everything I'm about to say about polynomials is true as long as $R[x]$ is a unique factorization domain.
Second, as user Lulu pointed out, if $a=b$, then the claim is false. Let $p(x)=x-1$, and let $a=b=1$, then both $x-a$, $x-b$ divide $p(x)$, but $(x-a)(x-b)$ does not divide $p(x)$.
If $a\ne b$, and $x-a$, $x-b$ both divide $p(x)$, then $(x-a)(x-b)$ divides $p(x)$ as well. We can show this by using the following useful lemma:
Lemma: Let $f(x)$, $p(x)$, $q(x)$ be polynomials, and suppose $f(x)$ is irreducible. If $f(x)$ divides $p(x)\cdot q(x)$, then either $f(x)$ divides $p(x)$ or $f(x)$ divides $q(x)$.
Side comment: Irreducible polynomials are a lot like primes. Note that for integers $p$, $a$, $b$, with $p$ prime, if $p$ divides $ab$ then either $p$ divides $a$ or $p$ divides $b$.
Proof of Original Claim: Let $a\ne b$ and let $x-a$, $x-b$ divide $p(x)$. Our goal is to show that $(x-a)(x-b)$ divides $p(x)$.
Since $x-a$ divides $p(x)$, we have that $p(x)=(x-a)q(x)$ for some polynomial $q(x)$. Since $x-b$ divides $p(x)$, it divides $(x-a)q(x)$. The fact that $x-b$ is degree $1$, means that $x-b$ is irreducible. So either $x-b$ divides $x-a$ or $x-b$ divides $q(x)$. The fact that $a\ne b$ means that $x-b$ cannot divide $x-a$, so it must divide $q(x)$. So $q(x)=(x-b)r(x)$ for some polynomial $r(x)$ and $p(x)=(x-a)(x-b)r(x)$. $\square$
