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

What are the rules for concealing thieves' tools (or items in general)?

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

Help with identifying unique aircraft over NE Pennsylvania

Is there any common country to visit for uk and schengen visa?

Single word to change groups

The English Debate

How are passwords stolen from companies if they only store hashes?

10 year ban after applying for a UK student visa

How to test the sharpness of a knife?

How can an organ that provides biological immortality be unable to regenerate?

Imaginary part of expression too difficult to calculate

Should I be concerned about student access to a test bank?

Is "inadequate referencing" a euphemism for plagiarism?

Why doesn't the chatan sign the ketubah?

Someone scrambled my calling sign- who am I?

Norwegian Refugee travel document

Have the tides ever turned twice on any open problem?

Error in master's thesis, I do not know what to do

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

Writing in a Christian voice

Homology of the fiber

Isn't the word "experience" wrongly used in this context?

Why are there no stars visible in cislunar space?

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



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 4 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 4 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

          How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

          Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"

          inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX