I'm working with polynomials of 5 variables $a,b,p,q,r$ which have a condition $a+b=p+q+r$. I'd like to minimize the number of variables in the answer. However, FullSimplify can't handle even simple example:

FullSimplify[pol, Assumptions -> a + b == p + q + r]


-b + p + q + r

instead of a. Is there a way to do it?

  • $\begingroup$ That ain't how assumptions work. Here's a possibility: do you prefer expressing in terms of $a,b$, or $p,q,r$? $\endgroup$ May 8, 2016 at 17:05
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    May 8, 2016 at 18:46
  • $\begingroup$ Are your examples all linear? That could simplify matters if so. $\endgroup$ May 8, 2016 at 21:27
  • $\begingroup$ @DanielLichtblau In general, I need to decompose homogeneous polynomials of degree n-1 which variables satisfy equation $a+b=p_1+...+p_n$ (at least for n=4,5,6). The polynomial I actually needed to simplify was 2*b*(-b+p+q+r). I'm thinking of introducing additional variable $d=a+b=p_1+...+p_n$, substitute sums for $d$, then substitute expressions of the type $d-p$. $\endgroup$
    – Ingvar
    May 9, 2016 at 9:38

2 Answers 2


The equality may be used to eliminate one variable of your choice. It may be done by the way used in the @happy fish answer, or by a direct substitution:

 pol = p + q + r - b;
pol /. b -> p + q + r - a

(*  a  *)

Have fun!


You can use

Solve[pol == p + q + r - b && a + b == p + q + r, pol, {b, q, p, r}]


Eliminate[pol == p + q + r - b && a + b == p + q + r, {b, q, p, r}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.