Message Boards Message Boards

GROUPS:

Abs of product with FullSimplify and assumptions not simplifying

Posted 19 days ago
213 Views
|
2 Replies
|
4 Total Likes
|

See the commands below.

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

2 Replies

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] &)]

Thanks 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