Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read several similar posts but I have not found a solution yet. However, I think that my problem should be quite easy. So here we are.


Mt = M1 + M2;
x1 = -(M2/Mt)*R;
x2 = R*(1 - M2/Mt);
r1 = (x - x1)^2 + y^2;
r2 = (x - x2)^2 + y^2;
Ω = Sqrt[Mt/R^3];

V1 = -M1/(b1^2 + Sqrt[b1^2 + r1]);
V2 = -M2/(b2^2 + Sqrt[b2^2 + r2]);
Vt = V1 + V2;

Vx = D[Vt, x];
Vy = D[Vt, y];
Print["Vx = ", Simplify[Vx]]
Print["Vy = ", Simplify[Vy]]

My question is how to simplify the expressions Vx and Vy. Mathematica computes them correctly but I want to take into account the above relations, in other words, Vx and Vy should contain Mt, r1, r2 and Ω in order to get the most simplified output.

Any ideas?


It seems that rules do not work in this case. For example if I set

rule1 = {Mt -> M1 + M2};

and apply it to Vx


the output still contains M1 + M2 instead of Mt. Same goes for r1, r2 and omega.

share|improve this question
A very common question. I have gathered links to related questions here:… – Mr.Wizard Dec 24 '13 at 9:59
@Mr.Wizard As I state in my post, before I ask this question I read most of the previous posts but none of the approaches worked in my case. Perhaps this is a different case (maybe more complicated expressions) and needs special treatment. – Vaggelis_Z Dec 24 '13 at 10:11
I assumed you had missed some of them since there are so many and they are scattered all about. This question appears to be a duplicate in the conceptual sense and I was trying to keep there from being more questions on the topic if possible. Can you confirm that you have indeed tried all the solutions from the linked posts? – Mr.Wizard Dec 24 '13 at 10:15
@Mr.Wizard Yes. In fact, in many of the linked posts the examples are very simple expressions, while in my case the expressions are much more complicated. – Vaggelis_Z Dec 24 '13 at 10:22
Reopened as requested. – Mr.Wizard Dec 24 '13 at 10:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.