Message Boards Message Boards

0
|
2418 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Simplification of absolute value

Posted 2 years ago

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
POSTED BY: Steven Kaptein
4 Replies

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.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Yes, it does the job! Thanks a lot.

POSTED BY: Steven Kaptein

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]]
POSTED BY: Gianluca Gorni
Posted 2 years ago

Indeed, for me it also worked for slightly simpler expressions. I hope there is a way to make it work for the complex ones.

POSTED BY: Steven Kaptein
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract