See the commands below.
Is there a way for Abs[x y]^2 function to simplify further in first case?
See the commands below.
Is there a way for Abs[x y]^2 function to simplify further in first case?
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!