# Maple Error on Asymptotic Analysis of $\ln(n)!$

In Maple, the command asmypt($f$,$x$) computes the asymptotic expansion of the function $f$ with respect to the variable $x$ (as $x \rightarrow \infty$).

The command

asympt(ln(n)!,n);

gives the error

Error, (in asympt) unable to compute series.

Other functions having non-integer output (such as $\frac{1}{n}$ or $\sqrt{n}$) go through just fine. Is there something mathematically significant about $\ln(n)$ that is causing an error, or is this some peculiarity of Maple? Regardless, what can I do to get asymptotics for this function?

-
It may be that the factorial function is undefined for non-integer values in MAPLE. For non integer values, use the gamma function where $n!=\Gamma(n+1)$. – Daryl Aug 28 '12 at 22:00
@Daryl Maple had no trouble with functions like $\left(\frac{1}{n}\right)!$ or $(\sqrt{n})!$, so the trouble does not seem to lie with evaluating non-integer inputs. – Austin Mohr Aug 29 '12 at 1:58

restart:

asympt(ln(n)!,n);
Error, (in asympt) unable to compute series

asympt(GAMMA(ln(n)+1),n);
Error, (in asympt) unable to compute series

series(ln(n)!,n=infinity);
Error, (in asympt) unable to compute series

series(GAMMA(ln(n)+1),n=infinity);
Error, (in asympt) unable to compute series

unprotect(series):
series:=MultiSeries:-series:
protect(series):

ans1:=series(ln(n)!,n=infinity):
ans2:=series(GAMMA(ln(n)+1),n=infinity):

ans1s:=simplify(ans1) assuming n>0;

exp(lnGAMMA(ln(n) + 1))
ans1s := -----------------------
(1/2)
(1/2) /  1  \
ln(n)      |-----|
\ln(n)/

ans2s:=simplify(ans2) assuming n>0;

exp(lnGAMMA(ln(n) + 1))
ans2s := -----------------------
(1/2)
(1/2) /  1  \
ln(n)      |-----|
\ln(n)/

evalf[20](eval(ans1,n=900)): evalf[10](%);
3393.043111

evalf[20](eval(ans2,n=900)): evalf[10](%);
3393.043111

evalf[20](eval(ln(n)!,n=900)): evalf[10](%);
3393.043111

evalf[20](eval(GAMMA(ln(n)+1),n=900)): evalf[10](%);
3393.043111

-
I walked to the corner store, and it occurred to me that my answer is pretty silly. Well, that's what I get for not thinking. Sorry. – acer Aug 29 '12 at 0:35
Actually, the change to MultiSeries:-series allowed my original code to go through unchanged. What is different about that package that could account for this? – Austin Mohr Aug 30 '12 at 19:38

See WIKI. I get $$(\log n)! \approx \; n^{\log \log n \, - 1} \; \; \sqrt{2 \pi \log n} \; \; \; e^{ \left(\frac{1}{12 \log n} - \frac{1}{360 \, \log^3 n} \right) }$$

Alright, checked with my programmable calculator, which has a factorial function for positive reals. This approximation is really quite good.

-

Asymptotics for $(\log n)!$ are the same as asymptotics for $m!$ where we substitute $m=\log n$ afterward. So Will is right, Stirling's approximation will do it.

In Maple 16...

-