1 Introduction and motivation

The problem of approximating the factorial function n!,  \(n=1,2,3,\ldots \) and its extension gamma function \(\Gamma \) to positive real numbers x,  defined by

$$\begin{aligned} \Gamma \left( x\right) =\int _{0}^{\infty }t^{x-1}\mathrm{e}^{-t}\mathrm{d}t, \end{aligned}$$

is widely studied by the researchers. Only in the recent past, many formulas were presented. We refer for example to Batir and Chen (2012), Batir (2010), Burnside (1917), Chen (2013), Chen and Lin (2012), Chen and Mortici (2012), Dubourdieu (1939), Gosper (1978), Kalmykov and Karp (2013), Laforgia and Natalini (2013), Lu (2014), Lu (2014), Lu and Wang (2013), Mortici (2009), Mortici (2010), Nemes (2012), where also estimates for polygamma and other related functions were stated. Starting from the Stirling’s formula

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi }x^{x+\frac{1}{2}}\mathrm{e}^{-x} \end{aligned}$$
(1.1)

and Burnside’s formula (Burnside 1917)

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi }\left( \frac{x+\frac{1}{2}}{e} \right) ^{x+\frac{1}{2}}, \end{aligned}$$
(1.2)

Mortici (2009) considered the following approximations for every \(p\in \left[ 0,1\right] \):

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi e}\mathrm{e}^{-p}\left( \frac{x+p}{e}\right) ^{x+\frac{1}{2}} \end{aligned}$$
(1.3)

and proved that the best results are obtained when

$$\begin{aligned} p=\frac{3\pm \sqrt{3}}{6}. \end{aligned}$$

The following asymptotic series is associated to Stirling’s formula (1.1)

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi }x^{x+\frac{1}{2}}\mathrm{e}^{-x}\times \exp \left\{ \sum _{m=1}^{\infty }\frac{B_{2m}}{2m\left( 2m-1\right) x^{2m-1}} \right\} , \quad \left( x\in \mathbb {R} ;\ x\rightarrow \infty \right) , \end{aligned}$$

where \(B_{j}\) are the Bernoulli numbers defined by

$$\begin{aligned} \frac{x}{\mathrm{e}^{x}-1}=\sum _{j=0}^{\infty }\frac{B_{j}}{j!}x^{j}. \end{aligned}$$

For details, see Abramowitz and Stegun (1972, Rel. 6.1.40, p. 257).

Chen and Lin (2012) gave the entire asymptotic series associated to the Gosper’s formula Gosper (1978)

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x} \sqrt{1+\frac{1}{6x}} \end{aligned}$$

and Ramanujan’s formula (Ramanujan 1988)

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x} \root 6 \of {1+\frac{1}{2x}+\frac{1}{8x^{2}}+\frac{1}{240x^{3}}}. \end{aligned}$$

We present in this paper the following formulas:

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi \mathrm{e}^{1+\sqrt{2}}}\left( \frac{x}{e} \right) ^{\frac{1}{2}+\frac{\sqrt{2}}{3}}\left( \frac{x-\frac{1}{\sqrt{2}}}{e }\right) ^{x-\frac{\sqrt{2}}{3}} \end{aligned}$$
(1.4)

and

$$\begin{aligned} \Gamma \left( x+1\right) \sim \rho \left( x\right) :=\sqrt{2\pi \mathrm{e}^{1-\sqrt{2} }}\left( \frac{x}{e}\right) ^{\frac{1}{2}-\frac{\sqrt{2}}{3}}\left( \frac{x+ \frac{1}{\sqrt{2}}}{e}\right) ^{x+\frac{\sqrt{2}}{3}}, \end{aligned}$$
(1.5)

which are part of the general formula

$$\begin{aligned} \Gamma \left( x+1\right) \sim k\frac{\left( x+a\right) ^{x+b+\frac{1}{2}}}{ x^{b}}\mathrm{e}^{-x},\quad \left( x\rightarrow \infty ;a,b,k\in \mathbb {R} \right) . \end{aligned}$$
(1.6)

This is an extension of Stirling’s formula, as the factor \(x^{x+\frac{1}{2}}\) is replaced by \(\left( x+a\right) ^{x+b+\frac{1}{2}}/x^{b}\). By imposing the natural condition

$$\begin{aligned} \lim _{x\rightarrow \infty }\Gamma \left( x+1\right) /\left( k\frac{\left( x+a\right) ^{x+b+\frac{1}{2}}}{x^{b}}\mathrm{e}^{-x}\right) =1, \end{aligned}$$

we can easily find \(k=\sqrt{2\pi }\mathrm{e}^{-a},\) so (1.6) becomes

$$\begin{aligned} \Gamma \left( x+1\right) \sim \mu \left( a,b,x\right) :=\sqrt{2\pi }\frac{ \left( x+a\right) ^{x+b+\frac{1}{2}}}{x^{b}}\mathrm{e}^{-\left( x+a\right) },\quad \left( x\rightarrow \infty \right) . \end{aligned}$$
(1.7)

Remark that the particular approximations \(\Gamma \left( x+1\right) \sim \mu \left( 0,0,x\right) ,\) \(\Gamma \left( x+1\right) \sim \mu (\frac{1}{2} ,0,x) \) and \(\Gamma \left( x+1\right) \sim \mu \left( p,0,x\right) \) are (1.1), (1.2) and (1.3), respectively.

Next we show that the most accurate approximations among all approximations (1.7) are

$$\begin{aligned} \Gamma \left( x+1\right) \sim \mu \left( -\frac{1}{\sqrt{2}},-\frac{1}{2}- \frac{\sqrt{2}}{3},x\right) \end{aligned}$$

and

$$\begin{aligned} \Gamma \left( x+1\right) \sim \mu \left( \frac{1}{\sqrt{2}},-\frac{1}{2}+ \frac{\sqrt{2}}{3},x\right) , \end{aligned}$$

that are (1.4) and (1.5), respectively. Their geometric mean

$$\begin{aligned} \Gamma \left( x+1\right) \sim \sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x}\left( 1-\frac{1}{x\sqrt{2}}\right) ^{\frac{x}{2}-\frac{\sqrt{2}}{6} }\left( 1+\frac{1}{x\sqrt{2}}\right) ^{\frac{x}{2}+\frac{\sqrt{2}}{6}} \end{aligned}$$
(1.8)

is an approximation of the same order.

We associate to (1.7), the function

$$\begin{aligned} F_{a,b}\left( x\right) =\ln \frac{\Gamma \left( x+1\right) }{\sqrt{2\pi } \frac{\left( x+a\right) ^{x+b+\frac{1}{2}}}{x^{b}}\mathrm{e}^{-\left( x+a\right) }} \end{aligned}$$

to establish the following sharp inequalities, for every real \(x\ge 1\):

$$\begin{aligned}&\alpha \times \sqrt{2\pi \mathrm{e}^{1+\sqrt{2}}}\left( \frac{x}{e}\right) ^{\frac{1 }{2}+\frac{\sqrt{2}}{3}}\left( \frac{x-\frac{1}{\sqrt{2}}}{e}\right) ^{x- \frac{\sqrt{2}}{3}} \nonumber \\&\quad \le \Gamma \left( x+1\right) \nonumber \\&\quad \le \beta \times \sqrt{2\pi \mathrm{e}^{1+\sqrt{2}}}\left( \frac{x}{e}\right) ^{ \frac{1}{2}+\frac{\sqrt{2}}{3}}\left( \frac{x-\frac{1}{\sqrt{2}}}{e}\right) ^{x-\frac{\sqrt{2}}{3}}, \end{aligned}$$
(1.9)
$$\begin{aligned}&\alpha \times \sqrt{2\pi \mathrm{e}^{1-\sqrt{2}}}\left( \frac{x}{e}\right) ^{\frac{1 }{2}-\frac{\sqrt{2}}{3}}\left( \frac{x+\frac{1}{\sqrt{2}}}{e}\right) ^{x+ \frac{\sqrt{2}}{3}} \nonumber \\&\quad \le \Gamma \left( x+1\right) \nonumber \\&\quad \le \delta \times \sqrt{2\pi \mathrm{e}^{1-\sqrt{2}}}\left( \frac{x}{e}\right) ^{ \frac{1}{2}-\frac{\sqrt{2}}{3}}\left( \frac{x+\frac{1}{\sqrt{2}}}{e}\right) ^{x+\frac{\sqrt{2}}{3}}, \end{aligned}$$
(1.10)

and

$$\begin{aligned}&\alpha \times \sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x}\left( 1-\frac{1}{x \sqrt{2}}\right) ^{\frac{x}{2}-\frac{\sqrt{2}}{6}}\left( 1+\frac{1}{x\sqrt{2} }\right) ^{\frac{x}{2}+\frac{\sqrt{2}}{6}} \nonumber \\&\quad \le \Gamma \left( x+1\right) \nonumber \\&\quad \le \sigma \times \sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x}\left( 1-\frac{1}{ x\sqrt{2}}\right) ^{\frac{x}{2}-\frac{\sqrt{2}}{6}}\left( 1+\frac{1}{x\sqrt{2 }}\right) ^{\frac{x}{2}+\frac{\sqrt{2}}{6}}, \end{aligned}$$
(1.11)

with \(\alpha =1\) and

$$\begin{aligned} \beta= & {} \frac{\mathrm{e}^{1-\frac{\sqrt{2}}{2}}}{\sqrt{2\pi }\left( 1-\frac{\sqrt{2}}{2 }\right) ^{1-\frac{\sqrt{2}}{3}}}=1.02330953\ldots ,\\ \delta= & {} \frac{\mathrm{e}^{1+\frac{\sqrt{2}}{2}}}{\sqrt{2\pi }\left( 1+\frac{\sqrt{2}}{ 2}\right) ^{1+\frac{\sqrt{2}}{3}}}=1.001261911\ldots , \end{aligned}$$

and

$$\begin{aligned} \sigma =\frac{e}{\sqrt{2\pi }\left( 1-\frac{\sqrt{2}}{2}\right) ^{\frac{1}{2} -\frac{\sqrt{2}}{6}}\left( 1+\frac{\sqrt{2}}{2}\right) ^{\frac{1}{2}+\frac{ \sqrt{2}}{6}}}=1.012225694\ldots . \end{aligned}$$

2 The best constants in a class of approximations

We concentrate in this section in the problem of finding the most accurate approximations among all approximations (1.7). Whenever an approximation formula \(f\left( n\right) \sim g\left( n\right) ,\) as \(n\rightarrow \infty ,\) is given, we define the sequence \(w_{n}\) by the relations

$$\begin{aligned} f\left( n\right) =g\left( n\right) \exp w_{n}~,\quad n=1,2,3,\ldots , \end{aligned}$$

and we consider the approximation \(f\left( n\right) \sim g\left( n\right) \) to be better when the sequence \(w_{n}\) converges to zero faster.

The following result is a main tool for evaluating the convergence rate of the sequence \(w_{n}\):

Lemma 1

Let \(w_{n}\) be a sequence converging to zero, such that

$$\begin{aligned} \lim _{n\rightarrow \infty }n^{k}\left( w_{n}-w_{n+1}\right) =l\in \mathbb {R} , \end{aligned}$$

for some \(k>1.\) Then

$$\begin{aligned} \lim _{n\rightarrow \infty }n^{k-1}w_{n}=\frac{l}{k-1}. \end{aligned}$$

For details and several applications, see, e.g., Batir and Chen (2012), Batir (2010), Chen (2013), Chen and Lin (2012), Chen and Mortici (2012), Lu (2014), Lu and Wang (2013), or Mortici (2010).

For the sequence \(w_{n}=w_{n}\left( a,b\right) \) associated to (1.7):

$$\begin{aligned} \Gamma \left( n+1\right) =\sqrt{2\pi }\frac{\left( n+a\right) ^{n+b+\frac{1}{ 2}}}{n^{b}}\mathrm{e}^{-\left( n+a\right) }\exp w_{n}, \end{aligned}$$

we have:

$$\begin{aligned} w_{n}-w_{n+1}=\frac{t_{2}}{n^{2}}+\frac{t_{3}}{n^{3}}+\frac{t_{4}}{n^{4}} +O\left( \frac{1}{n^{5}}\right) , \end{aligned}$$
(2.1)

where

$$\begin{aligned} t_{2}\left( a,b\right)= & {} -\frac{1}{12}( 6a+12ab-6a^{2}-1) ; \\ t_{3}\left( a,b\right)= & {} \frac{1}{12}( 6a+12ab-8a^{3}+12a^{2}b-1); \\ t_{4}\left( a,b\right)= & {} -\frac{1}{40}(20a+40ab+10a^{2}-20a^{3}-30a^{4}+60a^{2}b+40a^{3}b-3). \end{aligned}$$

By (2.1), if \(t_{2}\ne 0,\) then the speed of convergence of \( w_{n}-w_{n+1}\) is \(n^{-2}\) and by Lemma 1, the sequence \(w_{n}\) converges to zero as \(n^{-1}.\)

If \(t_{2}=0,\) then by (2.1), the speed of convergence of \(w_{n}-w_{n+1}\) is at least \(n^{-3},\) so the speed of convergence of \(w_{n}\) is at least \( n^{-2}.\)

As we are interested in finding the fastest sequence \(w_{n},\) we should have at least \(t_{2}=0.\)

Similarly, the sequence \(w_{n}\) has the highest speed of convergence when \( t_{2}=0\) and \(t_{3}=0,\) that is

$$\begin{aligned} \left\{ \begin{array}{l} 6a+12ab-6a^{2}-1=0 \\ 6a+12ab-8a^{3}+12a^{2}b-1=0 \end{array} \right. . \end{aligned}$$

The solutions of this system,

$$\begin{aligned} a_{*}=-\frac{1}{\sqrt{2}},\quad b_{*}=-\frac{1}{2}-\frac{\sqrt{2}}{3} \end{aligned}$$

and

$$\begin{aligned} a_{\#}=\frac{1}{\sqrt{2}},\quad b_{\#}=-\frac{1}{2}+\frac{\sqrt{2}}{3}, \end{aligned}$$

produce the following approximations:

$$\begin{aligned} \Gamma \left( n+1\right) \sim \sqrt{2\pi \mathrm{e}^{1+\sqrt{2}}}\left( \frac{n}{e} \right) ^{\frac{1}{2}+\frac{\sqrt{2}}{3}}\left( \frac{n-\frac{1}{\sqrt{2}}}{e }\right) ^{n-\frac{\sqrt{2}}{3}}, \end{aligned}$$
(2.2)

respectively

$$\begin{aligned} \Gamma \left( n+1\right) \sim \sqrt{2\pi \mathrm{e}^{1-\sqrt{2}}}\left( \frac{n}{e} \right) ^{\frac{1}{2}-\frac{\sqrt{2}}{3}}\left( \frac{n+\frac{1}{\sqrt{2}}}{e }\right) ^{n+\frac{\sqrt{2}}{3}}, \end{aligned}$$
(2.3)

In these cases,

$$\begin{aligned} w_{n}\left( a_{*},b_{*}\right) -w_{n+1}\left( a_{*},b_{*}\right) =\frac{1}{80n^{4}}+O\left( \frac{1}{n^{5}}\right) \end{aligned}$$

and

$$\begin{aligned} w_{n}\left( a_{\#},b_{\#}\right) -w_{n+1}\left( a_{\#},b_{\#}\right) =\frac{1 }{80n^{4}}+O\left( \frac{1}{n^{5}}\right) , \end{aligned}$$

so by Lemma 1, we conclude that

$$\begin{aligned} \lim _{n\rightarrow \infty }n^{3}w_{n}\left( a_{*},b_{*}\right) =\lim _{n\rightarrow \infty }n^{3}w_{n}\left( a_{\#},b_{\#}\right) =\frac{1}{ 240}. \end{aligned}$$

For every pair \(\left( a,b\right) \) with \(\left( a,b\right) \ne \left( a_{*},b_{*}\right) \) and \(\left( a,b\right) \ne \left( a_{\#},b_{\#}\right) ,\) the speed of convergence of the sequence \( w_{n}\left( a,b\right) \) is at most \(n^{-2}.\) Other approximations (1.7) are of order at most \(n^{-2},\) which is less than (2.2) and (2.3).

3 Asymptotics and truncations

In the first part of this section we construct the asymptotic series associated to (1.7). Recall that an asymptotic series is of great interest in approximation theory, since truncations of this series at any m -th term provide estimates of order \(n^{-\left( m+1\right) },\) for every integer \(m\ge 1.\)

Theorem 1

The following formula holds true, for every integer \(n\ge 1\):

$$\begin{aligned} \Gamma \left( x+1\right) =\mu \left( a,b,x\right) \exp \left\{ \sum _{m=1}^{n} \frac{s_{m}}{x^{m}}+O\left( \frac{1}{x^{n+1}}\right) \right\} \quad \left( x\rightarrow \infty \right) , \end{aligned}$$
(3.1)

where

$$\begin{aligned} s_{m}=\left( -1\right) ^{m}a^{m}\left[ \left( b+\frac{1}{2}\right) \frac{1}{m }-\frac{a}{m+1}\right] +\frac{B_{m+1}}{m\left( m+1\right) }\quad \left( 1\le m\le n\right) . \end{aligned}$$

Proof

Using (1.7), we get

$$\begin{aligned} \frac{\Gamma \left( x+1\right) }{\mu \left( a,b,x\right) }&=\frac{\sqrt{2\pi } x^{x+\frac{1}{2}}\mathrm{e}^{-x}}{\sqrt{2\pi }\frac{\left( x+a\right) ^{x+b+\frac{1}{2 }}}{x^{b}}\mathrm{e}^{-\left( x+a\right) }}\times \frac{\Gamma \left( x+1\right) }{ \sqrt{2\pi }x^{x+\frac{1}{2}}\mathrm{e}^{-x}}\nonumber \\&\sim \mathrm{e}^{a}\left( \frac{x}{x+a}\right) ^{x}\left( 1+\frac{a}{x}\right) ^{-\left( b+\frac{1}{2}\right) }\exp \left\{ \sum _{m=1}^{\infty }\frac{B_{2m} }{2m\left( 2m-1\right) x^{2m-1}}\right\} . \end{aligned}$$
(3.2)

As

$$\begin{aligned} a+x\ln \frac{x}{a+x}=\sum _{m=1}^{\infty }\frac{\left( -1\right) ^{m-1}a^{m+1} }{\left( m+1\right) x^{m}} \end{aligned}$$

and

$$\begin{aligned} \left( b+\frac{1}{2}\right) \ln \left( 1+\frac{a}{x}\right) =\left( b+\frac{1 }{2}\right) \sum _{m=1}^{\infty }\frac{\left( -1\right) ^{m-1}a^{m}}{mx^{m}}, \end{aligned}$$

we obtain

$$\begin{aligned} a+x\ln \frac{x}{a+x}=\sum _{m=1}^{n}\frac{\left( -1\right) ^{m-1}a^{m+1}}{ \left( m+1\right) x^{m}}+O\left( \frac{1}{x^{n+1}}\right) \quad \left( x\rightarrow \infty \right) , \end{aligned}$$

respectively

$$\begin{aligned} \left( b+\frac{1}{2}\right) \ln \left( 1+\frac{a}{x}\right) =\left( b+\frac{1 }{2}\right) \sum _{m=1}^{n}\frac{\left( -1\right) ^{m-1}a^{m}}{mx^{m}} +O\left( \frac{1}{x^{n+1}}\right) \quad \left( x\rightarrow \infty \right) . \end{aligned}$$

Now the conclusion follows by replacing in (3.2). \(\square \)

Precisely, the first terms in (3.1) are the following:

$$\begin{aligned} \Gamma \left( x+1\right)= & {} \mu \left( a,b,x\right) \\&\times \exp \left\{ -\frac{6a+12ab-6a^{2}-1}{12x}+\frac{a^{2}\left( 6b-4a+3\right) }{12x^{2}}\right. \\&\left. -\frac{60a^{3}-90a^{4}+120a^{3}b+1}{360x^{3}}+\frac{a^{4}\left( 10b-8a+5\right) }{40x^{4}}+\cdots \right\} . \end{aligned}$$

In particular,

$$\begin{aligned} \Gamma \left( x+1\right)= & {} \mu \left( a_{*},b_{*},x\right) \\&\times \exp \left\{ \frac{1}{240x^{3}}+\frac{1}{240x^{4}}\sqrt{2}+\frac{5}{ 1008x^{5}}+\frac{1}{504x^{6}}\sqrt{2}+\cdots \right\} ; \end{aligned}$$
$$\begin{aligned} \Gamma \left( x+1\right)= & {} \mu \left( a_{\#},b_{\#},x\right) \nonumber \\&\times \exp \left\{ \frac{1}{240x^{3}}-\frac{1}{240x^{4}}\sqrt{2}+\frac{5}{ 1008x^{5}}-\frac{1}{504x^{6}}\sqrt{2}+\cdots \right\} . \end{aligned}$$
(3.3)

As usually, truncations of an asymptotic series offer increasingly accurate approximations. Sometimes, it can be proved that these truncations are under- or over-approximations. We are in a position to present the following result.

Theorem 2

The following inequalities hold true, for every integer \(n\ge 1\):

$$\begin{aligned} \exp \left\{ \frac{1}{240n^{3}}-\frac{1}{240n^{4}}\sqrt{2}\right\} <\frac{ \Gamma \left( n+1\right) }{\mu \left( a_{\#},b_{\#},n\right) }<\exp \left\{ \frac{1}{240n^{3}}\right\} . \end{aligned}$$

Proof

By taking the logarithms, we define the sequences

$$\begin{aligned} a_{n}=\ln \frac{\Gamma \left( n+1\right) }{\mu \left( a_{\#},b_{\#},n\right) }-\left( \frac{1}{240n^{3}}-\frac{1}{240n^{4}}\sqrt{2}\right) \end{aligned}$$

and

$$\begin{aligned} b_{n}=\ln \frac{\Gamma \left( n+1\right) }{\mu \left( a_{\#},b_{\#},n\right) }-\frac{1}{240n^{3}}. \end{aligned}$$

We asserted \(a_{n}>0\) and \(b_{n}<0,\) but as \(a_{n}\) and \(b_{n}\) converge to zero, it suffices to prove that \(a_{n}\) is strictly decreasing and \(b_{n}\) is strictly increasing. In this sense, we have \(a_{n+1}-a_{n}=u\left( n\right) \) and \(b_{n+1}-b_{n}=v\left( n\right) ,\) where

$$\begin{aligned} u\left( x\right)= & {} \ln \left( x+1\right) \\&-\left[ \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \ln \frac{x+1}{e} +\left( x+1+\frac{\sqrt{2}}{3}\right) \ln \frac{x+1+\frac{1}{\sqrt{2}}}{e} \right] \\&+\left[ \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \ln \frac{x}{e} +\left( x+\frac{\sqrt{2}}{3}\right) \ln \frac{x+\frac{1}{\sqrt{2}}}{e}\right] \\&-\left( \frac{1}{240\left( x+1\right) ^{3}}-\frac{1}{240\left( x+1\right) ^{4}}\sqrt{2}\right) +\left( \frac{1}{240x^{3}}-\frac{1}{240x^{4}}\sqrt{2} \right) \end{aligned}$$

and

$$\begin{aligned} v\left( x\right)= & {} \ln \left( x+1\right) \\&-\left[ \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \ln \frac{x+1}{e} +\left( x+1+\frac{\sqrt{2}}{3}\right) \ln \frac{x+1+\frac{1}{\sqrt{2}}}{e} \right] \\&+\left[ \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \ln \frac{x}{e} +\left( x+\frac{\sqrt{2}}{3}\right) \ln \frac{x+\frac{1}{\sqrt{2}}}{e}\right] \\&-\frac{1}{240\left( x+1\right) ^{3}}+\frac{1}{240x^{3}}. \end{aligned}$$

We have

$$\begin{aligned} u^{\prime \prime }\left( x\right) =-\frac{U\left( x\right) }{960x^{6}\left( x+1\right) ^{6}\left( x+\frac{\sqrt{2}}{2}\right) ^{2}\left( x+\frac{\sqrt{2} }{2}+1\right) ^{2}}<0 \end{aligned}$$

and

$$\begin{aligned} v^{\prime \prime }\left( x\right) =\frac{V\left( x\right) }{960x^{5}\left( x+1\right) ^{5}\left( x+\frac{\sqrt{2}}{2}\right) ^{2}\left( x+\frac{\sqrt{2} }{2}+1\right) ^{2}}>0, \end{aligned}$$

where

$$\begin{aligned} U\left( x\right)= & {} x(576\sqrt{2}+764) +1000x^{8}+x^{7}(1360\sqrt{2}+4000) \\&+x^{2}(2420\sqrt{2}+3240) +x^{3}(5800\sqrt{2} +8004) +x^{6}(4760\sqrt{2}+9052) \\&+x^{4}(8660\sqrt{2}+12632) +x^{5}(8224\sqrt{2} +13156) +80+60\sqrt{2} \end{aligned}$$

and

$$\begin{aligned} V\left( x\right)= & {} 480x^{7}\sqrt{2}+x(216\sqrt{2}+324) +x^{2}(864\sqrt{2}+1272) \\&+x^{6}(1680\sqrt{2}+920) +x^{3}(2016\sqrt{2}+2816) +x^{5}(2880\sqrt{2}+2760) \\&+x^{4}(3000\sqrt{2}+3708) +36+24\sqrt{2}. \end{aligned}$$

Now u is strictly concave, v is strictly convex on \([1,\infty ),\) with \( u\left( \infty \right) =v\left( \infty \right) =0,\) so \(u<0\) and \(v>0\) on \( [1,\infty ).\) As we explained, the proof is now completed. \(\square \)

Using a similar method, we also proved the following better inequalities for every integer \(n\ge 1\):

$$\begin{aligned}&\exp \left\{ \frac{1}{240n^{3}}-\frac{1}{240n^{4}}\sqrt{2}+\frac{5}{ 1008n^{5}}-\frac{1}{504n^{6}}\sqrt{2}\right\} \\&\quad \le \frac{\Gamma \left( n+1\right) }{\mu \left( a_{\#},b_{\#},n\right) } \\&\quad \le \exp \left\{ \frac{1}{240n^{3}}-\frac{1}{240n^{4}}\sqrt{2}+\frac{5}{ 1008n^{5}}\right\} . \end{aligned}$$

Moreover, our computations proved that by truncation the series (3.3) at the first few terms, under-approximations are obtained. As an example, the following inequality holds true for every integer \(n\ge 1\):

$$\begin{aligned} \Gamma \left( n+1\right) >\mu \left( a_{*},b_{*},n\right) \exp \left\{ \frac{1}{240n^{3}}+\frac{1}{240n^{4}}\sqrt{2}\right\} . \end{aligned}$$

We can establish a similar result for an entire class of real numbers ab.

Theorem 3

Let ab be real numbers, \(a\ne 0,\) such that

$$\begin{aligned} b>\frac{4a-3}{6}\quad and \quad ab>\frac{90a^{4}-60a^{3}-1}{120a^{2}}. \end{aligned}$$

Then there exists a real number m such that the following inequalities are valid, for every integer \(n\ge m\):

$$\begin{aligned}&\mu \left( a,b,n\right) \exp \left\{ -\frac{6a+12ab-6a^{2}-1}{12n}\right\} \\&\quad \le \Gamma \left( n+1\right) \\&\quad \le \mu \left( a,b,n\right) \exp \left\{ -\frac{6a+12ab-6a^{2}-1}{12n}+\frac{ a^{2}\left( 6b-4a+3\right) }{12n^{2}}\right\} . \end{aligned}$$

Proof

We use the same procedure as in the proof of Theorem 2. Let

$$\begin{aligned} x_{n}=\ln \frac{\Gamma \left( n+1\right) }{\mu \left( a,b,n\right) }+\frac{ 6a+12ab-6a^{2}-1}{12n} \end{aligned}$$

and

$$\begin{aligned} y_{n}=\ln \frac{\Gamma \left( n+1\right) }{\mu \left( a,b,n\right) }+\frac{ 6a+12ab-6a^{2}-1}{12n}-\frac{a^{2}\left( 6b-4a+3\right) }{12n^{2}}. \end{aligned}$$

If fg are the functions defined by \(f\left( n\right) =x_{n+1}-x_{n}\) and \(g\left( n\right) =y_{n+1}-y_{n},\) then

$$\begin{aligned} f^{\prime \prime }\left( x\right) =-\frac{F\left( x\right) }{6x^{3}\left( x+1\right) ^{3}\left( x+a\right) ^{2}\left( x+1+a\right) ^{2}} \end{aligned}$$
(3.4)

and

$$\begin{aligned} g^{\prime \prime }\left( x\right) =\frac{G\left( x\right) }{6x^{4}\left( x+1\right) ^{4}\left( x+a\right) ^{2}\left( x+1+a\right) ^{2}}, \end{aligned}$$
(3.5)

where F and G are polynomials of fifth and sixth degrees, respectively:

$$\begin{aligned} F\left( x\right)= & {} 12a^{2}\left( 6b-4a+3\right) x^{5}+\cdots \\ G\left( x\right)= & {} (60a^{3}-90a^{4}+120a^{3}b+1) x^{6}+\cdots . \end{aligned}$$

The conditions from the hypotheses assure that the leading coefficients of F and G are positive. As a consequence, there is a real number \(m_{0}\) such that \(F>0\) and \(G>0\) on \([m_{0},\infty ).\) By (3.4)–(3.5), f is strictly concave, g is strictly convex on \([m_{0},\infty ),\) with \( f\left( \infty \right) =g\left( \infty \right) =0,\) so \(f<0\) and \(g>0\) on \( [m_{0},\infty ).\) Thus \(x_{n}\) decreases to zero, while \(y_{n}\) increases to zero, so \(x_{n}>0\) and \(y_{n}<0,\) for every \(n>m_{0}.\) \(\square \)

4 Complete monotonicity arguments

Recall that a function z is completely monotonic on \(\left( 0,\infty \right) \) if it has derivatives of all orders and the following inequalities are valid for every integer \(n\ge 0\) and \(x\in \left( 0,\infty \right) \):

$$\begin{aligned} \left( -1\right) ^{n}z^{\left( n\right) }\left( x\right) \ge 0. \end{aligned}$$
(4.1)

The function z is completely monotonic on \(\left( 0,\infty \right) \) if and only if

$$\begin{aligned} z\left( x\right) =\int _{0}^{\infty }\mathrm{e}^{-xt}d\mu \left( t\right) , \end{aligned}$$

where \(\mu \) is a non-negative measure on \((0,\infty )\) such that the integral converges for all \(x>0\). See widder (1981, p. 161).

The logarithmic derivative of the gamma function

$$\begin{aligned} \psi \left( x\right) =\frac{\mathrm{d}}{\mathrm{d}x}\left( \ln \Gamma \left( x\right) \right) = \frac{\Gamma ^{\prime }\left( x\right) }{\Gamma \left( x\right) } \end{aligned}$$

is called the digamma function, while the derivatives \(\psi ^{\prime },\) \( \psi ^{\prime \prime },\) ... are known as trigamma, tetragamma functions, and in general, polygamma functions. In what follows, we use the following integral representations, for every real \(x>0\) and positive integer n

$$\begin{aligned} \psi ^{\left( n\right) }\left( x\right) =\left( -1\right) ^{n-1}\int _{0}^{\infty }\frac{t^{n}\mathrm{e}^{-xt}}{1-\mathrm{e}^{-t}}\mathrm{d}t \end{aligned}$$
(4.2)

and for every \(r>0,\)

$$\begin{aligned} \frac{1}{x^{r}}=\frac{1}{\Gamma \left( r\right) }\int _{0}^{\infty }t^{r-1}\mathrm{e}^{-xt}\mathrm{d}t. \end{aligned}$$
(4.3)

See, e.g., Abramowitz and Stegun (1972)\(. \)

Related to (1.7), we use (4.2)–(4.3), to present the following

Lemma 2

Let

$$\begin{aligned} F_{a,b}\left( x\right) =\ln \frac{\Gamma \left( x+1\right) }{\mu \left( a,b,x\right) }. \end{aligned}$$

Then \(F_{a,b}^{\prime \prime }\) admits the following integral representation:

$$\begin{aligned} F_{a,b}^{\prime \prime }\left( x\right) =\int _{0}^{\infty }\frac{\phi _{a,b}\left( t\right) }{\mathrm{e}^{t}-1}\mathrm{e}^{-t\left( x+a\right) }\mathrm{d}t \end{aligned}$$
(4.4)

where

$$\begin{aligned} \phi _{a,b}\left( t\right) =t\mathrm{e}^{\left( a+1\right) t}-(\mathrm{e}^{t}-1) \left[ 1+\left( b+1\right) t\mathrm{e}^{at}+\left( a-b-\frac{1}{2}\right) t\right] . \end{aligned}$$

In terms of power series in t,  the following formula is valid:

$$\begin{aligned} \phi _{a,b}\left( t\right) =\sum _{n=3}^{\infty }\frac{\phi _{n}\left( a,b\right) }{\left( n-1\right) !}t^{n}, \end{aligned}$$

where

$$\begin{aligned} \phi _{n}\left( a,b\right) =b-a+\frac{n-2}{2n}+\left( b+1\right) a^{n-1}-b\left( a+1\right) ^{n-1}. \end{aligned}$$

Proof

As

$$\begin{aligned} F_{a,b}\left( x\right) =\ln \Gamma \left( x+1\right) +b\ln x-\left( x+b+ \frac{1}{2}\right) \ln \left( x+a\right) +x+a-\ln \sqrt{2\pi }, \end{aligned}$$
(4.5)

we have

$$\begin{aligned} F_{a,b}^{\prime }\left( x\right) =\psi \left( x\right) +\frac{b+1}{x}-\ln \left( x+a\right) +\frac{a-b-\frac{1}{2}}{x+a}, \end{aligned}$$
(4.6)

then

$$\begin{aligned} F_{a,b}^{\prime \prime }\left( x\right) =\psi ^{\prime }\left( x\right) - \frac{1}{x+a}-\frac{b+1}{x^{2}}+\frac{b-a+\frac{1}{2}}{\left( x+a\right) ^{2} } \end{aligned}$$

(we used the recurrence formula \(\psi \left( x+1\right) =\psi \left( x\right) +1/x\)). With the help of (4.2)–(4.3), we deduce

$$\begin{aligned} F_{a,b}^{\prime \prime }\left( x\right)= & {} \int _{0}^{\infty }\frac{t}{ 1-\mathrm{e}^{-t}}\mathrm{e}^{-tx}\mathrm{d}t-\int _{0}^{\infty }\mathrm{e}^{-t\left( x+a\right) }\mathrm{d}t \\&-\left( b+1\right) \int _{0}^{\infty }t\mathrm{e}^{-tx}\mathrm{d}t+\left( b-a+\frac{1}{2} \right) \int _{0}^{\infty }t\mathrm{e}^{-t\left( x+a\right) }\mathrm{d}t. \end{aligned}$$

After some standard computations, we get

$$\begin{aligned} F_{a,b}^{\prime \prime }\left( x\right) =\int _{0}^{\infty }\left\{ t\mathrm{e}^{(a+1) t}-(\mathrm{e}^{t}-1) \left[ 1+\left( b+1\right) t\mathrm{e}^{at}+\left( a-b-\frac{1}{2}\right) t\right] \right\} \frac{\mathrm{e}^{-t\left( x+a\right) }}{\mathrm{e}^{t}-1}\mathrm{d}t, \end{aligned}$$

which is the first assertion in this lemma. The expression in powers of t of \(\phi \) follows easily using the classical formula

$$\begin{aligned} \mathrm{e}^{s}=\sum _{n=0}^{\infty }\frac{s^{n}}{n!}. \end{aligned}$$

\(\square \)

Now we can state the following result about the complete monotonicity of the function \(F_{a,b}\).

Theorem 4

Let ab be real numbers such that \(\phi _{n}\left( a,b\right) \ge 0,\) for every integer \(n\ge 3.\) Then the function \(F_{a,b}\) is completely monotonic on \(\left( 0,\infty \right) .\)

Proof

As \(\phi _{n}\left( a,b\right) \ge 0,\) for every integer \(n\ge 3,\) we deduce that \(\phi _{a,b}\ge 0\). By (4.4), the function \( F_{a,b}^{\prime \prime }\) is completely monotonic. This means that \(\left( -1\right) ^{n}( F_{a,b}^{\prime \prime }\left( x\right) ) ^{\left( n\right) }\ge 0,\) for every \(x\in \left( 0,\infty \right) \) and integer \(n\ge 0.\) Equivalently,

$$\begin{aligned} \left( -1\right) ^{n}(F_{a,b}\left( x\right) ) ^{\left( n\right) }\ge 0, \end{aligned}$$
(4.7)

for every \(x\in \left( 0,\infty \right) \) and integer \(n\ge 2.\)

The function \(F_{a,b}^{\prime }\) is increasing (as a result of \( F_{a,b}^{\prime \prime }\ge 0\)), with \(\lim _{x\rightarrow \infty }F_{a,b}^{\prime }\left( x\right) =0\) [see (4.6)], so \(F_{a,b}^{\prime }\le 0.\)

The function \(F_{a,b}\) is decreasing (as a result of \(F_{a,b}^{\prime }\le 0 \)), with \(\lim _{x\rightarrow \infty }F_{a,b}\left( x\right) =0\) [see (4.5)], so \(F_{a,b}\ge 0.\)

Now (4.7) holds also for \(n=0\) and \(n=1,\) so \(F_{a,b}\) is completely monotonic on \(\left( 0,\infty \right) .\) \(\square \)

Related to the above theorem, a natural question arises. Namely we wonder whether there exist indeed real numbers ab satisfying \(\phi _{n}\left( a,b\right) \ge 0,\) for every integer \(n\ge 3.\) The answer is affirmative for an infinite class of pairs \(\left( a,b\right) ,\) as we can see from the following example.

Corollary 1

Assume that ab are real numbers satisfying one of the following conditions:

  1. (i)

    \(-1<a<0\) and \(b>0.\)

  2. (ii)

    \(\frac{1}{6}\sqrt{15}-\frac{3}{2}<a<0\) and

$$\begin{aligned} \frac{6a^{2}+6a-1}{12\left( a+1\right) }<b<0. \end{aligned}$$
(4.8)

Then the function \(F_{a,b}\) is completely monotonic on \(\left( 0,\infty \right) .\)

Proof

In order to provide the argument of the fact that \(\phi _{n}\left( a,b\right) >0,\) we need \(b+1>0.\) This is true in case (i), since \(b>0.\) In case (ii), we have

$$\begin{aligned} b+1>\frac{6a^{2}+6a-1}{12\left( a+1\right) }+1=\frac{6a^{2}+18a+11}{12\left( a+1\right) }>0 \end{aligned}$$

(\(\frac{1}{6}\sqrt{15}-\frac{3}{2}\) is the greatest root of the second degree polynomial \(6a^{2}+18a+11\)).For every integer \(n\ge 3,\) we have

$$\begin{aligned}&\phi _{n}\left( a,b\right) \\&\quad =b-a+\frac{n-2}{2n}+\left( b+1\right) a^{n-1}-b\left( a+1\right) ^{n-1} \nonumber \\&\quad \ge b-a+\frac{n-2}{2n}-\left( b+1\right) \left| a\right| ^{n-1}-\left| b\right| \left( a+1\right) ^{n-1} \nonumber \\&\quad \ge b-a+\frac{1}{6}-\left( b+1\right) a^{2}-\left| b\right| \left( a+1\right) ^{2} \nonumber \\&\quad \le 0. \nonumber \end{aligned}$$
(4.9)

If \(b>0\) (case (i)),  then the last inequality in (4.9) becomes

$$\begin{aligned} b-a+\frac{1}{6}-\left( b+1\right) a^{2}-b\left( a+1\right) ^{2}>0, \end{aligned}$$

or

$$\begin{aligned} -2a\left( a+1\right) b-a^{2}-a+\frac{1}{6}>0. \end{aligned}$$

This is true, since \(-a^{2}-a+\frac{1}{6}>0\) and \(-2a\left( a+1\right) b>0,\) for every \(-1<a<0\) and \(b>0.\)

In case (ii), we have \(b<0\), so the last inequality in (4.9) becomes

$$\begin{aligned} b-a+\frac{1}{6}-\left( b+1\right) a^{2}+b\left( a+1\right) ^{2}>0, \end{aligned}$$

or

$$\begin{aligned} 2\left( a+1\right) b-a^{2}-a+\frac{1}{6}>0, \end{aligned}$$
(4.10)

which is true (as \(a+1>0,\) the inequality (4.10) follows by multiplying the inequality (4.8) by \(a+1\)).

As the hypotheses of Theorem 4 are fulfilled, the function \(F_{a,b}\) is completely monotonic on \(\left( 0,\infty \right) .\) \(\square \)

Related to our main formulas (1.4)–(1.5), obtained for privileged values \(a_{*}=-\frac{1}{\sqrt{2}},\) \(b_{*}=-\frac{\sqrt{2}}{3}-\frac{ 1}{2},\) respectively \(a_{\#}=\frac{1}{\sqrt{2}},\quad b_{\#}=\frac{\sqrt{2}}{ 3}-\frac{1}{2},\) we can state the following result.

Lemma 3

The following inequalities hold true, for every integer \(n\ge 3\):

$$\begin{aligned} \phi _{n}\left( a_{*},b_{*}\right) \ge 0. \end{aligned}$$
(4.11)

In consequence, the function \(F_{a_{*},b_{*}}\) is completely monotonic on \(\left( 0,\infty \right) .\)

Proof

We have

$$\begin{aligned} \phi _{n}\left( a_{*},b_{*}\right) =\frac{\sqrt{2}}{6}+\left( \frac{1 }{2}-\frac{\sqrt{2}}{3}\right) \left( -\frac{\sqrt{2}}{2}\right) ^{n-1}+\left( \frac{\sqrt{2}}{3}+\frac{1}{2}\right) \left( 1-\frac{\sqrt{2}}{ 2}\right) ^{n-1}-\frac{1}{n}. \end{aligned}$$

The required inequality follows by adding the next three inequalities:

$$\begin{aligned} -\left( \frac{\sqrt{2}}{3}+\frac{1}{2}\right) \left( 1-\frac{\sqrt{2}}{2} \right) ^{n-1}< & {} 0,\\ -\left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \left( -\frac{\sqrt{2}}{2} \right) ^{n-1}< & {} \frac{\sqrt{2}}{12} \end{aligned}$$

and

$$\begin{aligned} \frac{1}{n}<\frac{\sqrt{2}}{12}. \end{aligned}$$
(4.12)

Indeed, for every integer \(n\ge 3,\) we have:

$$\begin{aligned}&-\left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \left( -\frac{\sqrt{2}}{2} \right) ^{n-1} \\&\quad \le \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \left( \frac{\sqrt{2}}{2} \right) ^{n-1} \\&\quad \le \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \left( \frac{\sqrt{2}}{2} \right) ^{2}<\frac{\sqrt{2}}{12} \end{aligned}$$

Inequality (4.12) holds for every integer \(n\ge 9,\) so (4.11) is valid for every integer \(n\ge 9.\) It is also true for every integer \( n=3,4,\ldots ,8,\) which can be verified by direct (numerical) computation. \(\square \)

Lemma 4

The following inequalities hold true, for every integer \(n\ge 3\):

$$\begin{aligned} \phi _{n}\left( a_{\#},b_{\#}\right) \ge 0. \end{aligned}$$

In consequence, the function \(F_{a_{\#},b_{\#}}\) is completely monotonic on \( \left( 0,\infty \right) .\)

Proof

We have

$$\begin{aligned} \phi _{n}\left( a_{\#},b_{\#}\right) =\left( \frac{1}{2}+\frac{\sqrt{2}}{3} \right) \left( \frac{\sqrt{2}}{2}\right) ^{n-1}+\left( \frac{1}{2}-\frac{ \sqrt{2}}{3}\right) \left( 1+\frac{\sqrt{2}}{2}\right) ^{n-1}-\frac{1}{n}- \frac{\sqrt{2}}{6}. \end{aligned}$$

The following relations are valid for every integer \(n\ge 9\):

$$\begin{aligned} \phi _{n}\left( a_{\#},b_{\#}\right)> & {} \left( \frac{1}{2}-\frac{\sqrt{2}}{3} \right) \left( 1+\frac{\sqrt{2}}{2}\right) ^{n-1}-1-\frac{\sqrt{2}}{6} \\> & {} \left( \frac{1}{2}-\frac{\sqrt{2}}{3}\right) \left( 1+\frac{\sqrt{2}}{2} \right) ^{8}-1-\frac{\sqrt{2}}{6} \\> & {} 0. \end{aligned}$$

Inequality \(\phi _{n}\left( a_{\#},b_{\#}\right) >0\) is true for every integer \(n\ge 9,\) and cases \(n=3,4,\ldots ,8\) were directly verified by us. \(\square \)

Theorem 5

The function

$$\begin{aligned} G\left( x\right) =\ln \frac{\Gamma \left( x+1\right) }{\sqrt{2\pi x}\left( \frac{x}{e}\right) ^{x}\left( 1-\frac{1}{x\sqrt{2}}\right) ^{\frac{x}{2}- \frac{\sqrt{2}}{6}}\left( 1+\frac{1}{x\sqrt{2}}\right) ^{\frac{x}{2}+\frac{ \sqrt{2}}{6}}} \end{aligned}$$

associated to approximation formula (1.8) is completely monotonic on \( \left( 0,\infty \right) .\)

The proofs follow from the relation

$$\begin{aligned} G=\frac{1}{2}F_{a_{*},b_{*}}+\frac{1}{2}F_{a_{\#},b_{\#}}. \end{aligned}$$

Thus G is completely monotonic, as the sum of two completely monotonic functions.

We showed how the completely monotonic functions can help in the problem of discovering sharp inequalities related to gamma function.

The function \(F_{a_{*},b_{*}}\) is completely monotonic, in particular strictly decreasing. As a consequence, the following inequalities are valid for every real number \(x\ge 1\):

$$\begin{aligned} 0=F_{a_{*},b_{*}}\left( \infty \right) <F_{a_{*},b_{*}}\left( x\right) \le F_{a_{*},b_{*}}\left( 1\right) . \end{aligned}$$

By exponentiating, we deduce (1.9). Similarly, the inequalities (1.10)–(1.11) follow from the monotonicity of the functions \( F_{a_{\#},b_{\#}}\) and G.

Furthermore, the monotonicity of the derivatives of higher order of the functions \(F_{a,b}\) can be used to establish sharp estimates for digamma, trigamma and polygamma functions in general.