# How to enlarge Mathematica's knowledge about certain functions?

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.

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

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:= tf[e_] :=
e /. {BarnesG[x_?NumberQ /; x > 1] :> Gamma[x - 1] BarnesG[x - 1],
BarnesG[1 + x_] :> Gamma[x] BarnesG[x]}

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

Out= 0

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

Out= 0