I have encountered recently a replacement and I tried to look up documentation but could not quite find anything and hope to get some explanation from experts. The replacement is the following:
Gamma[2*x+c] /. Gamma[t:2*g_ + d_:0 ] -> 1/Sqrt[Pi]*2^(t-1)*Gamma[t/2]*Gamma[(t+1)/2]
I have never seen this way of conditional replacement. This gives correct replacement for any
Gamma[2*x+c].
What I want to know if anyone can explain the piece, what it does:
Gamma[t:2*g_ + d_:0 ]
What I understood is that whenever it sees argument of the type 2*x+c, it replaces and in the replaced output it does the following:
t-> 2*x+c
and +d_:0 is needed to recognise any argument of type
2*x+c
I will be grateful if anyone can explain this type of notations for replacement and what are the scopes and how it will look for multiple variable replacement.
t:2*g_ + d_
matches2 x + c
,t:2*g_
matches2 x
, andt:2*g_ + d_:0` (or
t:2*g_ + d_.) matches both
2x` and2 x +c
. $\endgroup$