Message Boards Message Boards

0
|
2664 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Abs of product with FullSimplify and assumptions not simplifying

See the commands below.

Is there a way for Abs[x y]^2 function to simplify further in first case?

POSTED BY: Siddhesh Ambhire
2 Replies

Thanks Gianluca Gorni!

POSTED BY: Siddhesh Ambhire

Mathematica thinks that Abs[x y]^2 is simpler than x^2 y^2:

LeafCount[Abs[x y]^2]
LeafCount[x^2 y^2]

Try this:

FullSimplify[Abs[x y]^2, Element[x | y, Reals], 
 ComplexityFunction -> (Count[#, Abs, All, Heads -> True] &)]
POSTED BY: Gianluca Gorni
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