2
$\begingroup$

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?

$\endgroup$
4
  • $\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$ Commented 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
    Commented May 8, 2016 at 18:46
  • $\begingroup$ Are your examples all linear? That could simplify matters if so. $\endgroup$ Commented 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
    Commented May 9, 2016 at 9:38

2 Answers 2

0
$\begingroup$

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!

$\endgroup$
0
$\begingroup$

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}]
$\endgroup$

Your Answer

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

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