Imaginary part of expression too difficult to calculateFinding real and imaginary partsMathematica taking too long to calculate recursive functionComplex Plot with Imaginary Part encoded in colorGetting the real part of a expressionAbout Complex Numbers, Real part and Imaginary part (symbolic calculus)Bug in HypergeometricPFQRegularized?Equivalence of ComplexExpand and assuming real argumentsSummation of complex and complex conjugate - elimination of imaginary partHow to get the real part of a complex expressionRoots of an expression

If I cast the Enlarge/Reduce spell on an arrow, what weapon could it count as?

What (if any) is the reason to buy in small local stores?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

Why doesn't the fusion process of the sun speed up?

pipe commands inside find -exec?

Jem'Hadar, something strange about their life expectancy

How to remove space in section title at KOMA-Script

Writing in a Christian voice

Why does Surtur say that Thor is Asgard's doom?

Why is participating in the European Parliamentary elections used as a threat?

Is VPN a layer 3 concept?

Imaginary part of expression too difficult to calculate

Turning a hard to access nut?

Are hand made posters acceptable in Academia?

Do I need an EFI partition for each 18.04 ubuntu I have on my HD?

Have any astronauts/cosmonauts died in space?

"Marked down as someone wanting to sell shares." What does that mean?

Why is "la Gestapo" feminine?

Does fire aspect on a sword, destroy mob drops?

Difficulty understanding group delay concept

When should a starting writer get his own webpage?

How to read string as hex number in bash?

What is the difference between something being completely legal and being completely decriminalized?

What will the Frenchman say?



Imaginary part of expression too difficult to calculate


Finding real and imaginary partsMathematica taking too long to calculate recursive functionComplex Plot with Imaginary Part encoded in colorGetting the real part of a expressionAbout Complex Numbers, Real part and Imaginary part (symbolic calculus)Bug in HypergeometricPFQRegularized?Equivalence of ComplexExpand and assuming real argumentsSummation of complex and complex conjugate - elimination of imaginary partHow to get the real part of a complex expressionRoots of an expression













2












$begingroup$


I am trying to calculate the imaginary part of a long expression. It's a long enough expression that Mathematica "hangs" when you run:



imFUN2 = ComplexExpand[Im[expression]];


Is there something I can do that can help speed things up?



Here is my full code:



expression = -((I Ωc (4 γa^4 + 16 Δd^4 - 48 Δd^3 Δp + 48 Δd^2 Δp^2 - 16 Δd Δp^3 + 4 I γa^3 
(3 Δc + 6 Δd - 4 Δp - Δs) - 16 Δd^3 Δs + 32 Δd^2 Δp Δs - 16 Δd Δp^2 Δs - 4 Δd^2 Ωc^2 +
4 Δd Δp Ωc^2 + 4 Δd Δs Ωc^2 - 4 I dephasing Δd Ωd^2 + 12 Δd^2 Ωd^2 +
4 I dephasing Δp Ωd^2 - 24 Δd Δp Ωd^2 + 12 Δp^2 Ωd^2 - 8 Δd Δs Ωd^2 +
8 Δp Δs Ωd^2 - Ωc^2 Ωd^2 + Ωd^4 + 4 Δc^2 (4 Δd^2 - 4 Δd Δp + Ωd^2) -
2 γa^2 (4 Δc^2 + 26 Δd^2 + 10 Δp^2 + 2 Δc (13 Δd - 7 Δp - 2 Δs) +
6 Δp Δs - 2 Δd (18 Δp + 5 Δs) - Ωc^2 + 4 Ωd^2) + 4 Δc (8 Δd^3 - 4 Δd^2 (4 Δp + Δs) -
(4 Δp + Δs) Ωd^2 + Δd (8 Δp^2 + 4 Δp Δs - Ωc^2 + 4 Ωd^2)) - 2 I γa (24 Δd^3 +
4 Δc^2 (3 Δd - Δp) - 4 Δp^3 - 4 Δp^2 Δs - 4 Δd^2 (13 Δp + 4 Δs) + Δp Ωc^2 + Δs Ωc^2 -
2 I dephasing Ωd^2 - 10 Δp Ωd^2 - 3 Δs Ωd^2 + Δc (36 Δd^2 + 8 Δp^2 + 4 Δp Δs -
4 Δd (11 Δp + 3 Δs) - Ωc^2 + 7 Ωd^2) + Δd (32 Δp^2 + 20 Δp Δs - 3 Ωc^2 + 10 Ωd^2))))/
((γa + 2 I Δd) (2 γa^2 - 4 Δc^2 + 4 Δd Δp - 4 Δp^2 + 4 Δd Δs - 8 Δp Δs - 4 Δs^2 +
2 I γa (3 Δc + Δd - 3 (Δp + Δs)) + Δc (-4 Δd + 8 (Δp + Δs)) + Ωd^2) (4 I γa^3 (Δc - Δp) -
16 Δc^2 Δd Δp - 16 Δc Δd^2 Δp + 16 Δc^2 Δp^2 + 48 Δc Δd Δp^2 + 16 Δd^2 Δp^2 - 32 Δc Δp^3 -
32 Δd Δp^3 + 16 Δp^4 - 4 Δc Δd Ωc^2 - 4 Δd^2 Ωc^2 + 8 Δc Δp Ωc^2 + 8 Δd Δp Ωc^2 -
8 Δp^2 Ωc^2 + Ωc^4 - 4 Δc^2 Ωd^2 - 4 Δc Δd Ωd^2 + 8 Δc Δp Ωd^2 + 8 Δd Δp Ωd^2 -
8 Δp^2 Ωd^2 - 2 Ωc^2 Ωd^2 + Ωd^4 + 2 γa^2 (-4 Δc^2 - 6 Δc Δd + 14 Δc Δp + 6 Δd Δp -
10 Δp^2 + Ωc^2 + Ωd^2) - 2 I γa (4 Δc^2 (Δd - 3 Δp) - 4 Δd^2 Δp + Δd (20 Δp^2 -
3 Ωc^2 - Ωd^2) + Δc (4 Δd^2 - 24 Δd Δp + 28 Δp^2 - 3 Ωc^2 - Ωd^2) + 4 Δp (-4 Δp^2 +
Ωc^2 + Ωd^2)) + 2 dephasing (2 γa^3 + 2 I γa^2 (2 Δc + 3 Δd - 5 Δp) + γa (-4 Δd^2 -
4 Δc (Δd - 3 Δp) + 20 Δd Δp - 16 Δp^2 + Ωc^2 + Ωd^2) + 2 I (4 Δd^2 Δp - 8 Δd Δp^2 +
4 Δp^3 - Δp Ωc^2 + Δd Ωd^2 - Δp Ωd^2 + Δc (4 Δd Δp - 4 Δp^2 + Ωd^2)))))) /.
γa -> 1, dephasing -> 10^-4;

imFUN2 = ComplexExpand[Im[expression]];









share|improve this question











$endgroup$
















    2












    $begingroup$


    I am trying to calculate the imaginary part of a long expression. It's a long enough expression that Mathematica "hangs" when you run:



    imFUN2 = ComplexExpand[Im[expression]];


    Is there something I can do that can help speed things up?



    Here is my full code:



    expression = -((I Ωc (4 γa^4 + 16 Δd^4 - 48 Δd^3 Δp + 48 Δd^2 Δp^2 - 16 Δd Δp^3 + 4 I γa^3 
    (3 Δc + 6 Δd - 4 Δp - Δs) - 16 Δd^3 Δs + 32 Δd^2 Δp Δs - 16 Δd Δp^2 Δs - 4 Δd^2 Ωc^2 +
    4 Δd Δp Ωc^2 + 4 Δd Δs Ωc^2 - 4 I dephasing Δd Ωd^2 + 12 Δd^2 Ωd^2 +
    4 I dephasing Δp Ωd^2 - 24 Δd Δp Ωd^2 + 12 Δp^2 Ωd^2 - 8 Δd Δs Ωd^2 +
    8 Δp Δs Ωd^2 - Ωc^2 Ωd^2 + Ωd^4 + 4 Δc^2 (4 Δd^2 - 4 Δd Δp + Ωd^2) -
    2 γa^2 (4 Δc^2 + 26 Δd^2 + 10 Δp^2 + 2 Δc (13 Δd - 7 Δp - 2 Δs) +
    6 Δp Δs - 2 Δd (18 Δp + 5 Δs) - Ωc^2 + 4 Ωd^2) + 4 Δc (8 Δd^3 - 4 Δd^2 (4 Δp + Δs) -
    (4 Δp + Δs) Ωd^2 + Δd (8 Δp^2 + 4 Δp Δs - Ωc^2 + 4 Ωd^2)) - 2 I γa (24 Δd^3 +
    4 Δc^2 (3 Δd - Δp) - 4 Δp^3 - 4 Δp^2 Δs - 4 Δd^2 (13 Δp + 4 Δs) + Δp Ωc^2 + Δs Ωc^2 -
    2 I dephasing Ωd^2 - 10 Δp Ωd^2 - 3 Δs Ωd^2 + Δc (36 Δd^2 + 8 Δp^2 + 4 Δp Δs -
    4 Δd (11 Δp + 3 Δs) - Ωc^2 + 7 Ωd^2) + Δd (32 Δp^2 + 20 Δp Δs - 3 Ωc^2 + 10 Ωd^2))))/
    ((γa + 2 I Δd) (2 γa^2 - 4 Δc^2 + 4 Δd Δp - 4 Δp^2 + 4 Δd Δs - 8 Δp Δs - 4 Δs^2 +
    2 I γa (3 Δc + Δd - 3 (Δp + Δs)) + Δc (-4 Δd + 8 (Δp + Δs)) + Ωd^2) (4 I γa^3 (Δc - Δp) -
    16 Δc^2 Δd Δp - 16 Δc Δd^2 Δp + 16 Δc^2 Δp^2 + 48 Δc Δd Δp^2 + 16 Δd^2 Δp^2 - 32 Δc Δp^3 -
    32 Δd Δp^3 + 16 Δp^4 - 4 Δc Δd Ωc^2 - 4 Δd^2 Ωc^2 + 8 Δc Δp Ωc^2 + 8 Δd Δp Ωc^2 -
    8 Δp^2 Ωc^2 + Ωc^4 - 4 Δc^2 Ωd^2 - 4 Δc Δd Ωd^2 + 8 Δc Δp Ωd^2 + 8 Δd Δp Ωd^2 -
    8 Δp^2 Ωd^2 - 2 Ωc^2 Ωd^2 + Ωd^4 + 2 γa^2 (-4 Δc^2 - 6 Δc Δd + 14 Δc Δp + 6 Δd Δp -
    10 Δp^2 + Ωc^2 + Ωd^2) - 2 I γa (4 Δc^2 (Δd - 3 Δp) - 4 Δd^2 Δp + Δd (20 Δp^2 -
    3 Ωc^2 - Ωd^2) + Δc (4 Δd^2 - 24 Δd Δp + 28 Δp^2 - 3 Ωc^2 - Ωd^2) + 4 Δp (-4 Δp^2 +
    Ωc^2 + Ωd^2)) + 2 dephasing (2 γa^3 + 2 I γa^2 (2 Δc + 3 Δd - 5 Δp) + γa (-4 Δd^2 -
    4 Δc (Δd - 3 Δp) + 20 Δd Δp - 16 Δp^2 + Ωc^2 + Ωd^2) + 2 I (4 Δd^2 Δp - 8 Δd Δp^2 +
    4 Δp^3 - Δp Ωc^2 + Δd Ωd^2 - Δp Ωd^2 + Δc (4 Δd Δp - 4 Δp^2 + Ωd^2)))))) /.
    γa -> 1, dephasing -> 10^-4;

    imFUN2 = ComplexExpand[Im[expression]];









    share|improve this question











    $endgroup$














      2












      2








      2





      $begingroup$


      I am trying to calculate the imaginary part of a long expression. It's a long enough expression that Mathematica "hangs" when you run:



      imFUN2 = ComplexExpand[Im[expression]];


      Is there something I can do that can help speed things up?



      Here is my full code:



      expression = -((I Ωc (4 γa^4 + 16 Δd^4 - 48 Δd^3 Δp + 48 Δd^2 Δp^2 - 16 Δd Δp^3 + 4 I γa^3 
      (3 Δc + 6 Δd - 4 Δp - Δs) - 16 Δd^3 Δs + 32 Δd^2 Δp Δs - 16 Δd Δp^2 Δs - 4 Δd^2 Ωc^2 +
      4 Δd Δp Ωc^2 + 4 Δd Δs Ωc^2 - 4 I dephasing Δd Ωd^2 + 12 Δd^2 Ωd^2 +
      4 I dephasing Δp Ωd^2 - 24 Δd Δp Ωd^2 + 12 Δp^2 Ωd^2 - 8 Δd Δs Ωd^2 +
      8 Δp Δs Ωd^2 - Ωc^2 Ωd^2 + Ωd^4 + 4 Δc^2 (4 Δd^2 - 4 Δd Δp + Ωd^2) -
      2 γa^2 (4 Δc^2 + 26 Δd^2 + 10 Δp^2 + 2 Δc (13 Δd - 7 Δp - 2 Δs) +
      6 Δp Δs - 2 Δd (18 Δp + 5 Δs) - Ωc^2 + 4 Ωd^2) + 4 Δc (8 Δd^3 - 4 Δd^2 (4 Δp + Δs) -
      (4 Δp + Δs) Ωd^2 + Δd (8 Δp^2 + 4 Δp Δs - Ωc^2 + 4 Ωd^2)) - 2 I γa (24 Δd^3 +
      4 Δc^2 (3 Δd - Δp) - 4 Δp^3 - 4 Δp^2 Δs - 4 Δd^2 (13 Δp + 4 Δs) + Δp Ωc^2 + Δs Ωc^2 -
      2 I dephasing Ωd^2 - 10 Δp Ωd^2 - 3 Δs Ωd^2 + Δc (36 Δd^2 + 8 Δp^2 + 4 Δp Δs -
      4 Δd (11 Δp + 3 Δs) - Ωc^2 + 7 Ωd^2) + Δd (32 Δp^2 + 20 Δp Δs - 3 Ωc^2 + 10 Ωd^2))))/
      ((γa + 2 I Δd) (2 γa^2 - 4 Δc^2 + 4 Δd Δp - 4 Δp^2 + 4 Δd Δs - 8 Δp Δs - 4 Δs^2 +
      2 I γa (3 Δc + Δd - 3 (Δp + Δs)) + Δc (-4 Δd + 8 (Δp + Δs)) + Ωd^2) (4 I γa^3 (Δc - Δp) -
      16 Δc^2 Δd Δp - 16 Δc Δd^2 Δp + 16 Δc^2 Δp^2 + 48 Δc Δd Δp^2 + 16 Δd^2 Δp^2 - 32 Δc Δp^3 -
      32 Δd Δp^3 + 16 Δp^4 - 4 Δc Δd Ωc^2 - 4 Δd^2 Ωc^2 + 8 Δc Δp Ωc^2 + 8 Δd Δp Ωc^2 -
      8 Δp^2 Ωc^2 + Ωc^4 - 4 Δc^2 Ωd^2 - 4 Δc Δd Ωd^2 + 8 Δc Δp Ωd^2 + 8 Δd Δp Ωd^2 -
      8 Δp^2 Ωd^2 - 2 Ωc^2 Ωd^2 + Ωd^4 + 2 γa^2 (-4 Δc^2 - 6 Δc Δd + 14 Δc Δp + 6 Δd Δp -
      10 Δp^2 + Ωc^2 + Ωd^2) - 2 I γa (4 Δc^2 (Δd - 3 Δp) - 4 Δd^2 Δp + Δd (20 Δp^2 -
      3 Ωc^2 - Ωd^2) + Δc (4 Δd^2 - 24 Δd Δp + 28 Δp^2 - 3 Ωc^2 - Ωd^2) + 4 Δp (-4 Δp^2 +
      Ωc^2 + Ωd^2)) + 2 dephasing (2 γa^3 + 2 I γa^2 (2 Δc + 3 Δd - 5 Δp) + γa (-4 Δd^2 -
      4 Δc (Δd - 3 Δp) + 20 Δd Δp - 16 Δp^2 + Ωc^2 + Ωd^2) + 2 I (4 Δd^2 Δp - 8 Δd Δp^2 +
      4 Δp^3 - Δp Ωc^2 + Δd Ωd^2 - Δp Ωd^2 + Δc (4 Δd Δp - 4 Δp^2 + Ωd^2)))))) /.
      γa -> 1, dephasing -> 10^-4;

      imFUN2 = ComplexExpand[Im[expression]];









      share|improve this question











      $endgroup$




      I am trying to calculate the imaginary part of a long expression. It's a long enough expression that Mathematica "hangs" when you run:



      imFUN2 = ComplexExpand[Im[expression]];


      Is there something I can do that can help speed things up?



      Here is my full code:



      expression = -((I Ωc (4 γa^4 + 16 Δd^4 - 48 Δd^3 Δp + 48 Δd^2 Δp^2 - 16 Δd Δp^3 + 4 I γa^3 
      (3 Δc + 6 Δd - 4 Δp - Δs) - 16 Δd^3 Δs + 32 Δd^2 Δp Δs - 16 Δd Δp^2 Δs - 4 Δd^2 Ωc^2 +
      4 Δd Δp Ωc^2 + 4 Δd Δs Ωc^2 - 4 I dephasing Δd Ωd^2 + 12 Δd^2 Ωd^2 +
      4 I dephasing Δp Ωd^2 - 24 Δd Δp Ωd^2 + 12 Δp^2 Ωd^2 - 8 Δd Δs Ωd^2 +
      8 Δp Δs Ωd^2 - Ωc^2 Ωd^2 + Ωd^4 + 4 Δc^2 (4 Δd^2 - 4 Δd Δp + Ωd^2) -
      2 γa^2 (4 Δc^2 + 26 Δd^2 + 10 Δp^2 + 2 Δc (13 Δd - 7 Δp - 2 Δs) +
      6 Δp Δs - 2 Δd (18 Δp + 5 Δs) - Ωc^2 + 4 Ωd^2) + 4 Δc (8 Δd^3 - 4 Δd^2 (4 Δp + Δs) -
      (4 Δp + Δs) Ωd^2 + Δd (8 Δp^2 + 4 Δp Δs - Ωc^2 + 4 Ωd^2)) - 2 I γa (24 Δd^3 +
      4 Δc^2 (3 Δd - Δp) - 4 Δp^3 - 4 Δp^2 Δs - 4 Δd^2 (13 Δp + 4 Δs) + Δp Ωc^2 + Δs Ωc^2 -
      2 I dephasing Ωd^2 - 10 Δp Ωd^2 - 3 Δs Ωd^2 + Δc (36 Δd^2 + 8 Δp^2 + 4 Δp Δs -
      4 Δd (11 Δp + 3 Δs) - Ωc^2 + 7 Ωd^2) + Δd (32 Δp^2 + 20 Δp Δs - 3 Ωc^2 + 10 Ωd^2))))/
      ((γa + 2 I Δd) (2 γa^2 - 4 Δc^2 + 4 Δd Δp - 4 Δp^2 + 4 Δd Δs - 8 Δp Δs - 4 Δs^2 +
      2 I γa (3 Δc + Δd - 3 (Δp + Δs)) + Δc (-4 Δd + 8 (Δp + Δs)) + Ωd^2) (4 I γa^3 (Δc - Δp) -
      16 Δc^2 Δd Δp - 16 Δc Δd^2 Δp + 16 Δc^2 Δp^2 + 48 Δc Δd Δp^2 + 16 Δd^2 Δp^2 - 32 Δc Δp^3 -
      32 Δd Δp^3 + 16 Δp^4 - 4 Δc Δd Ωc^2 - 4 Δd^2 Ωc^2 + 8 Δc Δp Ωc^2 + 8 Δd Δp Ωc^2 -
      8 Δp^2 Ωc^2 + Ωc^4 - 4 Δc^2 Ωd^2 - 4 Δc Δd Ωd^2 + 8 Δc Δp Ωd^2 + 8 Δd Δp Ωd^2 -
      8 Δp^2 Ωd^2 - 2 Ωc^2 Ωd^2 + Ωd^4 + 2 γa^2 (-4 Δc^2 - 6 Δc Δd + 14 Δc Δp + 6 Δd Δp -
      10 Δp^2 + Ωc^2 + Ωd^2) - 2 I γa (4 Δc^2 (Δd - 3 Δp) - 4 Δd^2 Δp + Δd (20 Δp^2 -
      3 Ωc^2 - Ωd^2) + Δc (4 Δd^2 - 24 Δd Δp + 28 Δp^2 - 3 Ωc^2 - Ωd^2) + 4 Δp (-4 Δp^2 +
      Ωc^2 + Ωd^2)) + 2 dephasing (2 γa^3 + 2 I γa^2 (2 Δc + 3 Δd - 5 Δp) + γa (-4 Δd^2 -
      4 Δc (Δd - 3 Δp) + 20 Δd Δp - 16 Δp^2 + Ωc^2 + Ωd^2) + 2 I (4 Δd^2 Δp - 8 Δd Δp^2 +
      4 Δp^3 - Δp Ωc^2 + Δd Ωd^2 - Δp Ωd^2 + Δc (4 Δd Δp - 4 Δp^2 + Ωd^2)))))) /.
      γa -> 1, dephasing -> 10^-4;

      imFUN2 = ComplexExpand[Im[expression]];






      performance-tuning simplifying-expressions complex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago









      MarcoB

      37.5k556113




      37.5k556113










      asked 4 hours ago









      Steven SagonaSteven Sagona

      1866




      1866




















          1 Answer
          1






          active

          oldest

          votes


















          5












          $begingroup$

          Not an elegant solution but it works



          num = Numerator[expression];
          den = Denominator[expression];
          reNum, imNum = ComplexExpand[ReIm[num]];
          reDen, imDen = ComplexExpand[ReIm[den]];
          (imNum reDen - reNum imDen)/(reDen^2 + imDen^2)


          I think the problem is the denominator which is huge but I am surprised that my approach is not included in ComplexExpand






          share|improve this answer









          $endgroup$












          • $begingroup$
            This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
            $endgroup$
            – Steven Sagona
            3 hours ago










          Your Answer





          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "387"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193509%2fimaginary-part-of-expression-too-difficult-to-calculate%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5












          $begingroup$

          Not an elegant solution but it works



          num = Numerator[expression];
          den = Denominator[expression];
          reNum, imNum = ComplexExpand[ReIm[num]];
          reDen, imDen = ComplexExpand[ReIm[den]];
          (imNum reDen - reNum imDen)/(reDen^2 + imDen^2)


          I think the problem is the denominator which is huge but I am surprised that my approach is not included in ComplexExpand






          share|improve this answer









          $endgroup$












          • $begingroup$
            This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
            $endgroup$
            – Steven Sagona
            3 hours ago















          5












          $begingroup$

          Not an elegant solution but it works



          num = Numerator[expression];
          den = Denominator[expression];
          reNum, imNum = ComplexExpand[ReIm[num]];
          reDen, imDen = ComplexExpand[ReIm[den]];
          (imNum reDen - reNum imDen)/(reDen^2 + imDen^2)


          I think the problem is the denominator which is huge but I am surprised that my approach is not included in ComplexExpand






          share|improve this answer









          $endgroup$












          • $begingroup$
            This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
            $endgroup$
            – Steven Sagona
            3 hours ago













          5












          5








          5





          $begingroup$

          Not an elegant solution but it works



          num = Numerator[expression];
          den = Denominator[expression];
          reNum, imNum = ComplexExpand[ReIm[num]];
          reDen, imDen = ComplexExpand[ReIm[den]];
          (imNum reDen - reNum imDen)/(reDen^2 + imDen^2)


          I think the problem is the denominator which is huge but I am surprised that my approach is not included in ComplexExpand






          share|improve this answer









          $endgroup$



          Not an elegant solution but it works



          num = Numerator[expression];
          den = Denominator[expression];
          reNum, imNum = ComplexExpand[ReIm[num]];
          reDen, imDen = ComplexExpand[ReIm[den]];
          (imNum reDen - reNum imDen)/(reDen^2 + imDen^2)


          I think the problem is the denominator which is huge but I am surprised that my approach is not included in ComplexExpand







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          HughHugh

          6,58421945




          6,58421945











          • $begingroup$
            This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
            $endgroup$
            – Steven Sagona
            3 hours ago
















          • $begingroup$
            This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
            $endgroup$
            – Steven Sagona
            3 hours ago















          $begingroup$
          This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
          $endgroup$
          – Steven Sagona
          3 hours ago




          $begingroup$
          This works for me, thanks. It is interesting though that you call ComplexExpand[ReIm[num]] inside your function. I guess I should always make sure I don't have fractions-inside-fractions before calling this. Also for completion it might be helpful for others to know that the real part is: (reNum reDen + imNum imDen)/(reDen^2 + imDen^2)
          $endgroup$
          – Steven Sagona
          3 hours ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193509%2fimaginary-part-of-expression-too-difficult-to-calculate%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

          Prove that NP is closed under karp reduction?Space(n) not closed under Karp reductions - what about NTime(n)?Class P is closed under rotation?Prove or disprove that $NL$ is closed under polynomial many-one reductions$mathbfNC_2$ is closed under log-space reductionOn Karp reductionwhen can I know if a class (complexity) is closed under reduction (cook/karp)Check if class $PSPACE$ is closed under polyonomially space reductionIs NPSPACE also closed under polynomial-time reduction and under log-space reduction?Prove PSPACE is closed under complement?Prove PSPACE is closed under union?

          Is my guitar’s action too high? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Strings too stiff on a recently purchased acoustic guitar | Cort AD880CEIs the action of my guitar really high?Μy little finger is too weak to play guitarWith guitar, how long should I give my fingers to strengthen / callous?When playing a fret the guitar sounds mutedPlaying (Barre) chords up the guitar neckI think my guitar strings are wound too tight and I can't play barre chordsF barre chord on an SG guitarHow to find to the right strings of a barre chord by feel?High action on higher fret on my steel acoustic guitar