Question: Why are those expressions not equal?

I started with the following expression:

k := n*(phi+ln(-1/(-exp(phi)+exp(phi)*p-p)))/phi;

 

and two equations:

{p=mu/n};

{n=-((sigma)^(2))/(p*(p-1))};

 

Afterwards I carried out two substitution steps:

1. Substitute mu/n for p in k and store the return as j.

j:=subs({p=mu/n},k);
 

2. Substitute -((sigma)^(2))/(p*(p-1)) for n in j.

m1:=subs({n=-((sigma)^(2))/(p*(p-1))},j);


Then I carried ou the same two steps in reversed order i.e.:

1. Substitute -((sigma)^(2))/(p*(p-1)) for n in k and store the return as j.

j:=subs({n=-((sigma)^(2))/(p*(p-1))},k);

 

2. Substitute mu/n for p in k and store the return as j.

m2:=subs({p=mu/n},j);

 

Now the problem is that m1 and m2 are not identical:
for i to 2 do
M||i:=unapply(m||i,p,phi,mu,sigma);
evalf(M||i(0.2,0.5,2,1));
end do;

-------   WHY?   -------

Thanks for helping.

Please Wait...