# How does one expand an expression within a Gamma function?

I'd like to convert expressions such as

Gamma[(1/10)*(13 + 10*n)]


to

Gamma[13/10 + n]


I tried the rule

Gamma[r_] -> Gamma[Expand[r]]


but that doesn't seem to work.

• You want :> instead of ->. Alternatively just use ExpandAll on the complete expression. Aug 23, 2016 at 16:00
• FullSimplify@Gamma[(1/10)*(13 + 10*n)] works as well. Aug 23, 2016 at 20:05
• An alternative is to use FunctionExpand@ Gamma[(1/10)*(13 + 10*n)]
– user31159
Oct 22, 2016 at 22:42
• ExpandAll also works. Oct 23, 2016 at 8:31

There's also ExpandAll:

ExpandAll[Gamma[(1/10)*(13 + 10*n)]]
(*  Gamma[13/10 + n]  *)


You need to use a delayed version of the rule

Gamma[r_]:>Gamma[Expand[r]]


rather than

Gamma[r_]->Gamma[Expand[r]]


otherwise the 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 Head Gamma and has the added effect of matching multiple argument versions of Gamma and expanding each of their arguments independently.