To write the answer as a product of polynomials we try to factor the polynomial
a(p–q)+q–p
we can write this expression as
a(p-q)+(q-p)
from second parenthesis we can factor out -1 , so we get
a(p-q) -1(p-q)
Now it has two terms a(p-q) and -1(p-q) , from these two terms we can factor out (p-q)
So we get it
(p-q)(a-1)
So we get the polynomial as a product of two polynomials.
Second

we can rewrite the expression as

Now try to factor the groups
factor out "pq" as GCF from first group and "-r" as GCF from second group

Now we can factor it out for final step
