Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in Mathematica's standard tools under the name of BarnesG[x]. However, Mathematica often does not deal with it efficiently. For instance, there is an identity stating BarnesG[1+x]=Gamma[x]BarnesG[x] where Gamma[x] is Euler gamma function. Mathematica does not seem to "know" it. Execution of

Simplify[ BarnesG[1 + x] - Gamma[x] BarnesG[x]] 

results in no real simplification.

What is the most efficient way to "teach" Mathematica such kind of identities?

The only tool that I'm aware of is to create a corresponding transformation function and then use it in the process of simplification. In the case under discussion transformation function would be

tf[e_] := e /. {BarnesG[1 + x_] :> Gamma[x] BarnesG[x]};

Then evaluation of

Simplify[ BarnesG[1 + x] - Gamma[x] BarnesG[x], TransformationFunctions->{Automatic,tf}]

indeed gives zero. However, it does not help to work with numerical values. For example I still have no simplification for

Simplify[ BarnesG[7/6] - BarnesG[1/6] Gamma[1/6], 
          TransformationFunctions -> {Automatic, tf}]

So my questions are

  1. What is the most convenient way of solving my problem?
  2. If the one that I'm already using is OK, then how to extend it to numerical computations?
  3. A little bit off topic: how can I bring Mathematica to use new transformation function by default in opposite to explicit indication for this in every Simplify command?

Any help is appreciated/ I'm sorry if I won't be quick enough with my replies.

share|improve this question
There are typos in your code, sometimes you use Barnes[x] instead of BarnesG[x]. –  rcollyer Sep 30 '13 at 13:31

1 Answer 1

up vote 13 down vote accepted

If you modify your TransformationFunction so that it considers numerical values as a special case, you can get both of your examples to work

In[1]:= tf[e_] := 
 e /. {BarnesG[x_?NumberQ /; x > 1] :> Gamma[x - 1] BarnesG[x - 1], 
   BarnesG[1 + x_] :> Gamma[x] BarnesG[x]}

In[2]:= Simplify[BarnesG[1 + x] - Gamma[x] BarnesG[x], 
 TransformationFunctions -> {Automatic, tf}]

Out[2]= 0

In[3]:= Simplify[BarnesG[7/6] - BarnesG[1/6] Gamma[1/6], 
 TransformationFunctions -> {Automatic, tf}]

Out[3]= 0
share|improve this answer

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.