h(x)=(x+3) is HCF of
p(x) and
q(x).
So, both the polynomials will contain (x+3) as one of the factor.
Now, q(x)=x2+x−6=(x+3)(x−2) ...... (i)
m(x) is LCM of p(x) and q(x). So, it will also contain (x+3) as one of the factor.
∴ m(x)=x3−7x+6=(x+3)f(x)
We first find f(x),
By using long division method, we get
f(x)=(x2−3x+2)
∴ m(x)=(x+3)(x2−3x+2)=(x+3)(x−2)(x−1)
Now, p(x) has (x+3) as one of the factor.
Since, LCM contains (x−1) and q(x) does not contains (x−1) as one of the factors. So, p(x) will have (x−1) and it will be another factor.
As it is given that, p(x) has negative leading coefficient, so we have
p(x)=−(x+3)(x−1)=−(x2+2x−3)=−x2−2x+3