For example, I hate that Mathematica uses Pochhammer symbol in outputs and prefer all the expressions in Gamma function. How can I ban usage of Pochhammer? I also want all outputs to use HurwitzZeta rather than Zeta.

In another instance I want the results to use my own variant of Polygamma function (modified). How can I mandate its usage when possible?

  • $\begingroup$ I cannot give an exact example right now, but I think it quite ofthen appears. I am looking for a general solution that would work everywhere. $\endgroup$
    – Anixx
    Apr 15, 2012 at 16:56
  • $\begingroup$ There might be a way to set this as the default, but I think that FunctionExpand[ expr ] can take the argument TargetFunctions->{Gamma,HurwitzZeta}. $\endgroup$
    – Eli Lansey
    Apr 15, 2012 at 17:31
  • $\begingroup$ I want FullSimplify to follow these rules. $\endgroup$
    – Anixx
    Apr 15, 2012 at 17:53
  • $\begingroup$ An example would be helpful, but what about FullSimplify[expr, TransformationFunctions -> {Gamma,HurwitzZeta}] $\endgroup$
    – Eli Lansey
    Apr 15, 2012 at 18:18
  • $\begingroup$ @EliLansey I think that's ComplexExpand not FunctionExpand (having TargetFunctions option). And there it can only take {Re,Im,Abs,Arg,Conjugate,Sign} as values. $\endgroup$ Apr 15, 2012 at 20:55

3 Answers 3


You may try for example something like:

f[e_] := 100 Count[e, _Pochhammer, {0, Infinity}] + LeafCount[e];
FullSimplify[Pochhammer[k, n], ComplexityFunction -> f]

->Gamma[k + n]/Gamma[k]
  • $\begingroup$ Does Mathematica provide access to the default complexity function, so you can just amend it instead of completely replacing? $\endgroup$
    – celtschk
    Apr 15, 2012 at 21:58
  • 5
    $\begingroup$ @celtschk LeafCount[] IS the default Complexity function $\endgroup$ Apr 15, 2012 at 22:17
  • 2
    $\begingroup$ @celtschk: not quite true that LeafCount is the default complexity function. As the docs ref/ComplexityFunction say, "forms are ranked primarily according to their LeafCount, with corrections to treat integers with more digits as more complex." $\endgroup$
    – murray
    Apr 16, 2012 at 0:21
  • 1
    $\begingroup$ @Anixx by user defined 'functions' do you mean things like f[x_]:=Pochammer[x+1]? If so, then the reason is that MMA replaces any instance of f[x] with the RHS (it is actually not a Function), BEFORE any simplification is done (unless holds are in place), and hence doesn't know about simplification rules for it (see mathematica.stackexchange.com/questions/704/…). As to creating those rules: no idea $\endgroup$
    – tkott
    Apr 16, 2012 at 11:19
  • 1
    $\begingroup$ @celtschk, the default complexity function can be found in the Properties & Relations section of the ComplexityFunction documentation. $\endgroup$ Sep 4, 2012 at 8:04

Perhaps you will find utility in Format and related functions?


Format[Pochhammer[k_, n_]] := HoldForm[ Gamma[k + n]/Gamma[k] ]


Pochhammer[a, b]
Gamma[a + b]/Gamma[a]

Similar things can be done with $PrePrint:

$PrePrint = # /. Pochhammer[k_, n_] :> HoldForm[ Gamma[k + n]/Gamma[k] ] &;

Pochhammer[a, b]
Gamma[a + b]/Gamma[a]

I have found ReplaceAll to be useful for when I want to replace instances of Gamma or Binomial calls to show as a factorial.

    x*Gamma[a] + x^2*Gamma[b] - 
  3*Binomial[z, c] /. {Gamma[n_] -> (n - 1)!, 
  Binomial[n_, k_] -> ((n)!/((n - k)!*k!))}


   x (-1 + a)! + x^2 (-1 + b)! - (3 z!)/(c! (-c + z)!)
  • $\begingroup$ but note that it's up to you to know that the replacement is equivalent. $\endgroup$
    – T. Webster
    Sep 4, 2012 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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