# 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)? [duplicate]

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.

• You have to take some care. For instance, if $a=b$ the claim is not true. But otherwise, it is. That ambiguity gets more subtle as the degree of the divisors increases. – lulu Jan 9 at 15:21
• For integers, the claim holds so long as we require the divisors to be relatively prime. A similar constraint holds for polynomials. – lulu Jan 9 at 15:23
• @lulu I think you should post your comment as an answer. – Ethan Bolker Jan 9 at 15:26
• @lulu will you please give reason or explanation for , if 'N' is divisible by "a" and "b" , and if "a" and "b" are coprime , then why is it necessary that 'N' will be divisible by (a×b) ? – Sameer nilkhan Jan 9 at 15:40
• related and likely follow-up to this question: math.stackexchange.com/questions/3503038/… – gt6989b Jan 9 at 16:20

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$$

• @ Andrew Ostergaard in your answer as you wrote p(x) = (x-a)q(x) and p(x) = (x-b)q(x) , so is it necessary at both places q(x) should be same ? – Sameer nilkhan Jan 9 at 15:52
• You said that I wrote $p(x)=(x-b)q(x)$. Are you sure I wrote that? I'm having trouble finding the spot where I wrote that. – user729424 Jan 9 at 15:59
• I may be splitting hairs, but the truth of your Lemma requires something from the ring of coefficients. A field $K$ will do nicely as then $K[x]$ is a Euclidean domain where irreducible $\implies$ prime. If the coefficient ring is not commutative then the main claim is actually false (consider $x^2+1$ over quaternions). Similarly, if you have zero divisors then divisibility and irreducibility become murky. Consider $f(x)=x^2-1$ over $\Bbb{Z}_8$ or $\Bbb{Z}_{12}$. $x-1\mid x^2-1$ and $x-5\mid x^2-1$, but... – Jyrki Lahtonen Jan 9 at 16:00
• @JyrkiLahtonen Your comment is excellent, and I appreciate your help. The original problem didn't make it clear where the coefficients came from, so I initially thought it would be okay to ignore the question of where the coefficients come from. I realize now, thanks to you, that this was a mistake. I'm going to edit my post now, to fix those flaws. – user729424 Jan 9 at 16:05