I want to factor the following polynomial:
b*p - b*q + c*q - c*r - a*(p - r)
When I use the function FactorTerms. I get the following result:
FactorTerms[b*p - b*q + c*q - c*r - a*(p - r), {p, q, r}]
// Output: (-a)*p + b*p - b*q + c*q + a*r - c*r
FactorTerms[b*p - b*q + c*q - c*r - a*(p - r), {a, b, c}]
// Output: (-a)*p + b*p - b*q + c*q + a*r - c*r
Using simplify actually gives me factors:
Simplify[b*p - b*q + c*q - c*r - a*(p - r)]
// Output: b*(p - q) + c*(q - r) + a*(-p + r)
The only problem is that I wanted the common terms to be p, q and r.
How can I tell Mathematica to factor a polynomial with specific common variables?
Thanks.
Simplifyresult shows a sum, not a product. This is not going to be amenable to factorization. $\endgroup$