4

While there is this question with a very similar title, it does not answer my question, which is:

I have part of an input, in my case

Re[Exp[I*x]]

which Mathematica "simplifies" to

Cos[Re[x]]/E^Im[x]

So I am wondering how to tell Mathematica to leave this expression, whether it's alone or part of a longer formula, in its previous form rather than to change it as shown here.

Update

I should probably add I am still running version 6, hoping this is not causing the issue.

Bernd
  • 965
  • 9
  • 19
  • I can not reproduce your problem. Re[Exp[I*x]] does not automatically simplify to anything. Evaluating it leaves it unchanged. Evaluating Re[Exp[I*x]] // Simplify doesn't change it either. – m_goldberg Jul 15 '13 at 12:47
  • Maybe this is because I am still running Mathematica v6? But should it behave differently in such a way? If I evaluate Re[Exp[I*x]] in a new notebook, I get the above expression. – Bernd Jul 15 '13 at 12:51
  • i agree with @m_goldberg, but if you want to suppress on the fly simplification from Mathematica enclose it in a HoldForm expression. Is that what you're asking for? – Stefan Jul 15 '13 at 12:51
  • @Stefan, HoldForm might work but it seems be a little tricky to use in this case if I want to use the expression in a longer formula e.g. involving slots (#) where the evaluation must not be stopped. I was hoping there would be some solution of the form expression //SomeForm? – Bernd Jul 15 '13 at 12:58
  • @Bernd what about Defer@Integrate[x^# Exp[-x], {x, 0, 1}]&/@Range[2] ? – Stefan Jul 15 '13 at 13:07
  • @Stefan It seems like Defer does the trick, thanks a lot! – Bernd Jul 16 '13 at 07:04
  • @Stefan Me too :) I'm just randomly scanning unanswered questions from time to time :) – Kuba Mar 31 '14 at 17:47
  • @Kuba that is absolutely valuable. Thank you for that. – Stefan Mar 31 '14 at 17:48

1 Answers1

4

In case you want Mathematica to suppress on the fly simplification and having slots (#) involved, you might consider using Defer:

Defer@Integrate[x^# Exp[-x], {x, 0, 1}]&/@Range[2] 

enter image description here

Kuba
  • 136,707
  • 13
  • 279
  • 740
Stefan
  • 5,347
  • 25
  • 32