Hi all, would be grateful to help with the following. Consider the code:
p = x /. Solve[(a - x)/y^2 == 1, x];
q = ((3 a - 2 p)/(4 y^2));
f[x_] = x Sign[x] ;
Assuming[q > 0, Simplify[f[q]]]
The output is:
((a + 2 y^2) Sign[a + 2 y^2])/(4 y^2 Sign[y]^2)
I am trying to tell function f[] that it’s argument is positive, and hence Sign[] operator is +1. However, Sign operator is still in the Out cell.
By the way, if I remove the first line in which p is defined via Solve, everything works fine. It’s something about the fact that q depends on an output from a function that makes “Assuming q>0” work incorrectly
Thanks a lot, Gianluca! Can you briefly explain, or point towards the relevant section in the documentation, how does the internal engine of Mathematica interpret {a/b}>0 and why it is different from a/b>0. I mean I don’t get an error, so in terms of synthax both are acceptible. But somehow Mathematica cannot figure out what I mean when it sees {a/b}>0. Then, what DOES it see.
Gianluca, your solution stops working again with a small change in the equation being solved in the first line. In particular, if take your code and change only the first line to:
p = x /. Solve[(a - x)/(c y^2)+(b - x)/(d y^2) == 1, x][[1]];
Then again, Sign appears in the answer, disappointingly. If you know how to get rid of it, it would help me a lot.