# Simplification fails for complex variables

I ran into the problem that Mathematica's (full-) simplification does not replace

t Conjugate[t]


by

Abs[t]^2


In my case, I get pretty ugly expressions which greatly simplify when I replace the expressions manually. As an example:

FullSimplify[( 2 (-((Abs[a - b + Sqrt[(a - b)^2 + 4 t Conjugate[t]]]^2 +
4 t Conjugate[t])/(
2 (a + b - 2 ω + Sqrt[(a - b)^2 + 4 t Conjugate[t]]))) + (
Abs[-a + b + Sqrt[(a - b)^2 + 4 t Conjugate[t]]]^2 +
4 t Conjugate[t])/(
2 (-a - b + 2 ω +
Sqrt[(a - b)^2 + 4 t Conjugate[t]]))))/((a - b) (Conjugate[a] -
Conjugate[b]) + 4 t Conjugate[t] +   Sqrt[(a - b)^2 + 4 t Conjugate[t]]
Conjugate[Sqrt[(a - b)^2 + 4 t Conjugate[t]]]), {{a,
b, ω} ∈ Reals, t ∈ Complexes}]


Does not yield any simplification. However, if I replace

t Conjugate[t] -> Abs[t]^2


or, if I change $t$ to be real, I find the desired result $\frac{b-\omega}{ |t|^2-(a-\omega)(b-\omega)}$

PS: I just realized this is appears to be the same problem as posted here: FullSimplify on complex numbers seems inconsistent. However I'd much appreciate a less "crazy" solution…

• may be ComplexExpand[t Conjugate[t]]. Lookup up ComplexExpand in the help. – Nasser Jul 1 '17 at 9:09
• Thanks, but that does not help. In my case I get terms like Arg[(a - b)^2 + 4 t Conjugate[t]] which are zero as the argument is positive. – Leo Stenzel Jul 1 '17 at 10:57
• If split $t$ into real and imaginary part explicitly, and tell Simplify that both parts are real, then I find the final simplified result. But… that's not a great solution? – Leo Stenzel Jul 1 '17 at 11:01
• Adding TransformationFunctions -> {Automatic, # /. x_ Conjugate[x_] :> Abs[x]^2 &} does give the result you want, for what it's worth. – Mr.Wizard Jul 1 '17 at 11:53

You can use ComplexExpand with a suitable TargetFunctions option and Simplify. Here is your expression:

expr = (2 (-((Abs[a - b + Sqrt[(a - b)^2 + 4 t Conjugate[t]]]^2 +
4 t Conjugate[t])/(2 (a + b - 2 ω +
Sqrt[(a - b)^2 + 4 t Conjugate[t]]))) + (Abs[-a + b +
Sqrt[(a - b)^2 + 4 t Conjugate[t]]]^2 +
4 t Conjugate[t])/(2 (-a - b + 2 ω +
Sqrt[(a - b)^2 + 4 t Conjugate[t]]))))/((a - b) (Conjugate[a] -
Conjugate[b]) + 4 t Conjugate[t] +
Sqrt[(a - b)^2 + 4 t Conjugate[t]] Conjugate[
Sqrt[(a - b)^2 + 4 t Conjugate[t]]]);


Then, you can use:

Simplify[
ComplexExpand[expr, t, TargetFunctions->{Abs}],
(a | b | ω) ∈ Reals
]


(b - ω)/((a - ω) (-b + ω) + Abs[t]^2)

• Thanks, I had not looked into the documentation of ComplexExpand, properly. It bugs me that Mathematica is so sensitive form of the input, but your answer is a pretty good "workaround". – Leo Stenzel Jul 1 '17 at 15:09