Question: why algsubs does not replace all instances of variable like subs?

 

restart;
sub:=x/C;
expr:=1/2*x*(p^2+a)/p;

And now

subs(p = sub, expr)

But

algsubs(p = sub,expr)

Notice one "p" is still not replaced. 

This is very annoying. I looked at help and did not see anything about this. I could have missed it. It looks like it does not replace "p" when it is in denominator:

algsubs(p = x,1/p)

Remains 1/p but 

subs(p = x,1/p)

gives 1/x as expected.

May be this is documented somewhere? But why it does this?

Please Wait...