sjkaptein
(Steven Kaptein)
1
Dear Wolfram community, I am trying to simplify the following expression
Simplify[Abs[B Exp[2 z] Cos[x + y] + A Cos[y - z]] /( B Exp[2 z] Cos[x + y] + A Cos[y - z]),
B Exp[2 z] Cos[x + y] + A Cos[y - z] > 0]
And it returns
-1 B E^(2 z) Cos[x + y] + A Cos[y - z] < 0
1 True
Why does it not just return
1
since I specified that
B Exp[2 z] Cos[x + y] + A Cos[y - z] > 0
This is curious, the result seems to depend on how complicated the expression is:
With[{expr = a b c d e},
Simplify[Abs[expr]/expr, expr > 0]]
With[{expr = a b c d},
Simplify[Abs[expr]/expr, expr > 0]]
sjkaptein
(Steven Kaptein)
3
Indeed, for me it also worked for slightly simpler expressions. I hope there is a way to make it work for the complex ones.
One way would be to use Replace, instead of Simplify:
With[{expr = B Exp[2 z] Cos[x + y] + A Cos[y - z]},
Abs[expr]/expr /. Abs[expr] :> expr]
Perhaps Simplify ignores assumptions that look too complicated, and it seems a reasonable strategy in general.
sjkaptein
(Steven Kaptein)
5
Yes, it does the job! Thanks a lot.