1
$\begingroup$

I am wondering why this simplification does not work,

FullSimplify[Im[1/Sin[a]], Assumptions -> Element[a, Reals]]
(*Out[1]= Im(csc(a))*)

while this does:

FullSimplify[ComplexExpand[Im[1/Sin[a]]]]
(*Out[2]= 0*)

I would think the two lines are equivalent? I understand of course that the denominator can become zero, but that does not create an imaginary part... In this particular case I can of course simply use the second version, but I have a problem where ComplexExpand takes very long, so I would like to avoid it. (Mathematica version: 11.1.0.0 for Linux)

$\endgroup$
  • 1
    $\begingroup$ The implicit assumption of real values in ComplexExpand does not carry over to the outside function FullSimplify. Not sure if that answers your question though. $\endgroup$ – Daniel Lichtblau Mar 8 '18 at 16:58
1
$\begingroup$
FullSimplify[Im[1/Sin[a]], Assumptions -> {Element[a, Reals], Sin[a] != 0}]

0

Note that there is a pole in 1/Sin[a], which FullSimplify will not automatically discard. Since the pole is indeterminate, there's no actual guarantee that it doesn't have an imaginary part.

I am not entirely sure why ComplexExpand discards the pole.

$\endgroup$
  • $\begingroup$ As I said, I understand that there's a pole. I would have thought that the inverse of a real number is real, and ComplexExpand seems to think so, too. Explicitly excluding 0 for the denominator is of course an option, I was hoping for something more general (since there might be many explicit exclusions I'd have to make). $\endgroup$ – Martin J. Mar 8 '18 at 16:09
  • $\begingroup$ @MartinJ Infinity isn't exactly a real number, so division isn't closed within the reals if the denominator is 0. While it's perfectly reasonable in almost all cases to assume that the division of a real number by a real number is real, it's not actually the case. Add in that division by 0 isn't clear on which infinity it implies (if any), and there's a whole host of issues that result in FullSimplify leaving it alone. ComplexExpand is a little bit looser with its assumptions. $\endgroup$ – eyorble Mar 8 '18 at 16:15
0
$\begingroup$

Mathematica is not so careful with Conjugate, so you could do:

Block[{Im = (#-Conjugate[#])/(2I)&},
    FullSimplify[Im[1/Sin[a]], Assumptions->Element[a,Reals]]
]

0

On the other hand, I'm surprised that ComplexExpand is slow, I would have expected the FullSimplify of the ComplexExpand output to be slow.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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