Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to do a series expansion of an expression containing Gamma functions with specific arguments. An example is the following:

Series[Gamma[I p/x + z /x], {x, 0, 0}, Assumptions -> {x > 0, p > 0, z > 0}]

(* (2^-Floor[1/2 + Arg[(I p)/x + z/x]/(2 π)]) ... *)

The result then depends on expressions containing Floor functions:

 Floor[1/2 + Arg[(I p)/x + z/x]/(2 π)]

However, because I am assuming all variables to be positive (and nonzero) the Arg[] will not return any values outside the open interval (-π/2, π/2). Therefore, the Floor expresisons should simplify to just 0.

Now I would like to know how I can get Mathematica to do this simplification automatically.

Maybe this is something that can be done by adding rules to FullSimplify with the option TransformationFunctions?

share|improve this question

I'll use FullSimplify here, even though Simplify can also be used and gives results that are almost as simple.

First of all, the simplification goes further if you convert the SeriesData output into a normal expression:

 Normal[Series[Gamma[I p/x + z/x], {x, 0, 0}]],
 Assumptions -> {x > 0, p > 0, z > 0}

$$\begin{cases} \sqrt{2\pi}e^{-\frac{z+ip}{x}}\left(\frac{z+ip}{x}\right)^{-\frac{1}{2}+\frac{z+ip}{x}} & \arg(z+ip)<\pi\\ \sqrt{\frac{\pi}{2}}e^{-\frac{z+ip}{x}}\left(-\frac{z+ip}{x}\right)^{-\frac{1}{2}+\frac{z+ip}{x}}\csc\left(\frac{\pi(z+ip)}{x}\right) & \text{True} \end{cases} $$

From this output we can see what needs to be done in order to get an even simpler result:

This seems to be one of those situations where the border case is preventing a further simplification. Although it's really impossible to get the equality Arg[I p + z] == π under the given assumptions, Mathematica needs us to say so explicitly:

 Normal[Series[Gamma[I p/x + z/x], {x, 0, 0}]],
 Assumptions -> {x > 0, p > 0, z > 0, Arg[I p + z] < Pi}

$$\sqrt{2 \pi } e^{-\frac{z+i p}{x}} \left(\frac{z+i p}{x}\right)^{-\frac{1}{2}+\frac{z+i p}{x}}$$

share|improve this answer
Thanks for the quick reply. The point of my question is how to somehow implement the last assumption automatically and not by hand. The reason for this is that I am working with an expression than results in a much larger output with multiple different Floor[..Arg[]] combinations. And it is a bit of a pain finding them and adding the extra assumption for all separate cases. (Maybe in the end implementing something like this will be more work than just adding the assumptions, but I am also curious if and how such an implementation would be possible) – michael Jun 11 '14 at 23:27

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.