I'd like to convert expressions such as
Gamma[(1/10)*(13 + 10*n)]
Gamma[13/10 + n]
I tried the rule
Gamma[r_] -> Gamma[Expand[r]]
but that doesn't seem to work.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
ExpandAll[Gamma[(1/10)*(13 + 10*n)]] (* Gamma[13/10 + n] *)
You need to use a delayed version of the rule
Expand is applied to
r (returning simply
r) before the substitution is attempted.
A slightly briefer alternative is
r_Gamma :> Expand/@r
This matches any expression that has
Gamma and has the added effect of matching multiple argument versions of
Gamma and expanding each of their arguments independently.