3
$\begingroup$

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…

$\endgroup$
4
  • 2
    $\begingroup$ may be ComplexExpand[t Conjugate[t]]. Lookup up ComplexExpand in the help. $\endgroup$
    – Nasser
    Commented Jul 1, 2017 at 9:09
  • $\begingroup$ 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. $\endgroup$ Commented Jul 1, 2017 at 10:57
  • $\begingroup$ 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? $\endgroup$ Commented Jul 1, 2017 at 11:01
  • 1
    $\begingroup$ Adding TransformationFunctions -> {Automatic, # /. x_ Conjugate[x_] :> Abs[x]^2 &} does give the result you want, for what it's worth. $\endgroup$
    – Mr.Wizard
    Commented Jul 1, 2017 at 11:53

1 Answer 1

7
$\begingroup$

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)

$\endgroup$
1
  • $\begingroup$ 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". $\endgroup$ Commented Jul 1, 2017 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.