Consider this code example:

ComplexExpand[Re[Integrate[f[t], {t, a, b}]]]

Mathematica gives me the result as

Re[Integrate[f[t], {t, a, b}]]

which is obviously not helpful and not what should happen in my understanding. If all variables are real - and that's what ComplexExpand assumes according to the documentation - then Re can be dropped from the expression. The same happens for Im. This seems to confuse FullSimplify which leaves me with a long expression that could be shorted. Why is this the case? How can I get Integrate (and Re) to evaluate properly to simply

Integrate[f[t], {t, a, b}]
  • 1
    $\begingroup$ It works on inactive integrals in V12.1.1. $\endgroup$ – Michael E2 Aug 6 at 21:29
  • $\begingroup$ Let me rephrase: It does what you wanted done. $\endgroup$ – Michael E2 Aug 6 at 21:37
  • 1
    $\begingroup$ Whenever you alter an expression, it reevaluates (unless held). Evaluating Integrate is often very expensive; depending on the version, IIRC, some parts cannot be interrupted. Blithely letting Simplify etc. hack away at it might be the last thing the kernel would ever do: You'd have to kill (force-quit) it and restart the kernel. If it were my system, I think I'd protect the user from that and maybe invent Inactive -- actually, I was using Hold for years to do that before they introduced Inactive. That said, the algebra of inactive integrals (and sums) is not fully realized. $\endgroup$ – Michael E2 Aug 6 at 21:49
  • $\begingroup$ @MichaelE2 I think I understand what you mean. But how can I resolve this? $\endgroup$ – HerpDerpington Aug 6 at 22:25
  • 1
    $\begingroup$ My comment was my limited user-view response to your question, "Why is this the case?" But perhaps your real question is how to get ComplexExpand to work on Integrate or implement such a function. $\endgroup$ – Michael E2 Aug 6 at 22:47

Your Answer

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

Browse other questions tagged or ask your own question.