# Simplify product of complex numbers

I am trying to take product of a complex number with its conjugate. When I take

A*Conjugate[A] // FullSimplify


The output is as desired

Abs[A]^2


But when I try

FullSimplify@(A*Conjugate[A]*B*Conjugate[B])


The output is

A B Conjugate[A] Conjugate[B]


Why mathematica is not showing the output as

Abs[A]^2 Abs[B]^2


I am using Mathematica 11.2.0.

• ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
– rmw
Commented Nov 10, 2018 at 13:41
• @rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables. Commented Nov 10, 2018 at 15:29

You can use ComplexExpand

simplify =
Simplify[ComplexExpand[#, Variables[Level[#, {-1}]],
TargetFunctions -> {Abs, Arg}]] &;

A*Conjugate[A] // simplify

(* Abs[A]^2 *)

simplify[A*Conjugate[A]*B*Conjugate[B]]

(* Abs[A]^2 Abs[B]^2 *)

• Thank you. This will save a lot of time in my calculations :-) Commented Nov 10, 2018 at 15:00

It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.

LeafCount[Abs[A]^2 Abs[B]^2]
LeafCount[A B Conjugate[A] Conjugate[B]]


9

7

Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.

In the end, simplification is always a matter of taste.