# How to stop evaluation of Zeta with even arguments

It could be a duplicate question. However I could not find much after a huge searching. I have a huge expression in mathematica involving many Zetas. I want not to evaluate the even Zetas which Mathematica does automatically.

This question has been raised before in a slightly different context in here:

Stop the Zeta function from evaluating

However I would like to know if there is any better way to do this.

Code:

exp= c2*Zeta+c3*Zeta+c4*Zeta+c5*Zeta;


The expected output would be the same i.e.

c2*Zeta+c3*Zeta+c4*Zeta+c5*Zeta


but Mathematica does

(c2 Pi^2)/6 + (c4 Pi^4)/90 + c3 Zeta + c5 Zeta


Using the Inactive option:

Block[{Zeta = Inactive[Zeta]},c2*Zeta + c3*Zeta + c4*Zeta + c5*Zeta];

c2 Inactive[Zeta] + c3 Inactive[Zeta] + c4 Inactive[Zeta] + c5 Inactive[Zeta]


which when I Activate/Replace again gives the same problem. I am not using notebook interface where this solution 'works', I am using mathematica from terminal.

• Use zeta instead of Zeta. – AccidentalFourierTransform Nov 19 '18 at 16:13
• Okay. this already occurred to me :) I can always do that to avoid these kind of things and save time. I was expecting some inbuilt solution which I don't know of. – Boogeyman Nov 19 '18 at 16:16

You can use the following code

Unprotect[Zeta]; Zeta[n_] := "Zeta"[n] /; EvenQ[n];


to do what you want on a global level. For example

ex = c2*Zeta + c3*Zeta + c4*Zeta + c5*Zeta


returns an expression that prints the same.

Later, when you want the actual values of the even Zetas use this

ex /. {"Zeta"[n_] :> Sum[1/k^n, {k, Infinity}]} // InputForm


which returns

(c2*Pi^2)/6 + (c4*Pi^4)/90 + c3*Zeta + c5*Zeta

• But if I save or print the expression, it will show c3 Zeta + c5 Zeta + c2 Inactive[Zeta] + c4 Inactive[Zeta] instead of c3 Zeta + c5 Zeta + c2 Zeta + c4 Zeta. However its helpful to know the global setting. – Boogeyman Mar 15 '19 at 15:53
• @Boogeyman I have changed to "Zeta" instead and it should print the way you want. Of course, there are way to make Mathematica change the way it prints expressions. That is one possiblity. – Somos Mar 15 '19 at 15:56