2

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:

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

returns

-b + p + q + r

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

Ingvar
  • 23
  • 2
  • That ain't how assumptions work. Here's a possibility: do you prefer expressing in terms of $a,b$, or $p,q,r$? – J. M.'s missing motivation May 08 '16 at 17:05
  • 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! – Michael E2 May 08 '16 at 18:46
  • Are your examples all linear? That could simplify matters if so. – Daniel Lichtblau May 08 '16 at 21:27
  • @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$. – Ingvar May 09 '16 at 09:38

2 Answers2

0

You can use

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

or

Eliminate[pol == p + q + r - b && a + b == p + q + r, {b, q, p, r}]
vapor
  • 7,911
  • 2
  • 22
  • 55
0

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!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96