# ComplexExpand absolute squared

ComplexExpand[Abs[a + b I]]


Gives

$\sqrt{a^2 + b^2 }$

ComplexExpand[Abs[a + b I]^2]


On the other hand gives

Abs[a + I b]^2

How can I let it evaluate to $a^2 + b^2$ instead?

-
Try ComplexExpand[Abs[a + b I]^2, TargetFunctions -> {Re, Im}]. –  b.gatessucks Apr 23 '13 at 15:45
FullSimplify[Abs[a + b I]^2, (a | b) \[Element] Reals] works too. –  Szabolcs Apr 23 '13 at 15:54
I have found that the TargetFunctions approach usually works better for more complicated arguments. Sometimes, running things through FullSimplify is slow and doesn't get you much. –  Kevin Driscoll Apr 23 '13 at 18:39