Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Mathematica to compare some constants. Before playing around with those constants, I would like to check that I didn't make any mistake in typing them. So my question is the following: "What is the command that return the expression I typed?"

Just to be clear. The expression

4*Sum[Log[Gamma[k]], {k, 3, IntegerPart[n] + 2*(n - IntegerPart[n])}]


enter image description here

And that is what I want. On the other hand, the expression

Sum[(2*n - 2*m - 1)*Log[n*(m + 1)], {m, 0, IntegerPart[n] - 1}]


enter image description here

and that is what I want to avoid!

share|improve this question
You can use Hold and its variants. – b.gatessucks Mar 25 '13 at 10:58
And it's best to post code, so people can copy/paste and try for themselves. – b.gatessucks Mar 25 '13 at 10:59
Thank you for the fast reply! I'm sorry for non-posting code. I'll keep it in mind for next questions. – Giovanni De Gaetano Mar 25 '13 at 11:02
Just edit the question and paste in the actual code. This makes for a better question and a better site. – Jagra Mar 25 '13 at 11:58
@Jagra You're definitely right! I edited my question, is it fine now? :) – Giovanni De Gaetano Mar 25 '13 at 13:38
up vote 5 down vote accepted

What you want is probably HoldForm but I don't understand why you cannot just check what you typed and why you need it to be printed again:

HoldForm[Sum[(2 n - 2 m - 1)*Log[n (m + 1)], {m, 0, IntegerPart[n] - 1}]]

Mathematica graphics

share|improve this answer
Yes, this is exactly what I was looking for! At the beginning I was trying to do that because it's just simpler to check long expression in the form I'm used to do that. After I while I was just refusing to believe that there wasn't a proper command on Mathematica (I could't find it googling around)! – Giovanni De Gaetano Mar 25 '13 at 13:32
Welcome to the 20K club. Congratulations! :-) – Mr.Wizard Mar 25 '13 at 19:11

What you could do is

SetOptions[Sum, Method -> None]


Sum[(2 n - 2 m - 1)*Log[n (m + 1)], {m, 0, IntegerPart[n] - 1}]

does not evaluate, similar to like @halirutans solution. The advantage is that you can control this globally and do not have to put HoldForm everywhere.

share|improve this answer
Thanks for the answer! In this specific case I'm fine with the "local" solution, but it's good to have another tool at disposal if needed. – Giovanni De Gaetano Mar 25 '13 at 15:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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