5
$\begingroup$

I have a large expression that I want to simplify according to some conditions, which FullSimplify doesn't seem to take into account.

For example, let's say I have:

expr = p[3].k[2] + p[3].k[4];
Cond = Sum[p[3].k[j], {j, {1, 2, 4}}];
FullSimplify[expr, Assumptions -> Cond == 0]

The result is p[3].k[2] + p[3].k[4] - unchanged. However, I would like this to be -p[3].k[1] which seems obviously simpler.

What is interesting, is that the expr = p[3].k[1] + p[3].k[2] does simplify correctly, but I don't understand why (since Plus[] is Orderless)

Note: I need to find out how to do this in general - I know I could use replacement rules or something but in reality my condition might be a large sum applied to many arbitrary terms. I don't want to have to do it by hand each time if avoidable. Thanks!

$\endgroup$
  • $\begingroup$ Not even this simplifies: Simplify[p[3].k[2] + p[3].k[4], p[3].k[2] + p[3].k[4] == -p[3].k[1]]. $\endgroup$ – bbgodfrey Aug 26 '16 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.