13

Recently was asked on the site the question : how to compute $$f(t)=\int_0^t\frac{\mu^x}{\Gamma(x+1)}\ dx$$ for which I assumed $0 \leq t \leq 1$. There is no antiderivative available from any CAS I tried.

My first idea was to approximate $\Gamma(x+1)$ by a more or less constrained polynomial in $x$, then to use partial fraction decomposition. This leads to a linear combination of elliptic integrals.

Later, I found that $\Big[\Gamma(1+x)\Big]^{-1}$ looks to be very similar to a Gibbs excess energy diagram for a binary system. Some models of this physical properties are very simple (Van Laar, Margules), but they only have two parameters which is not enough for an "accurate" representation of the function. Much more accurate are Scatchard-Hildebrand, Wilson, NRTL or Uniquac models but their complexity would not allow the required integration.

So, with a limited choice, I decided to try with a model looking like the one proposed by Redlich-Kister which contains a pure polynomial component. So my idea was to write $$\frac{1}{\Gamma(x+1)}\sim 1+x(x-1) \sum_{k=0}^p d_k\, x^k$$ $$f(t)=\frac{\mu ^t-1}{L}+$$ $$\sum_{k=0}^p (-1)^k\,d_k L^{-(k+3)} (L\, \Gamma (k+2,-L t)+\Gamma (k+3,-L t)-(k+L+2) \Gamma (k+2))$$ where $L=\log(\mu)$ (provided that $\Re(\log (\mu ))<0\land \Re(k)>-2$).

Willing to stay non-empirical, in my answer, I used $p=3$ and the $d_k$'s were computed in order to match the function and first derivative values at $x=0$, $x=\frac 12$ and $x=1$. The result were no too bad.

For the art for art's sake, I decided to use $p=6$, the $d_k$'s were computed in order to match the function, first and second derivative values at $x=0$, $x=\frac 12$ and $x=1$. This leads to $$d_0=-\gamma \qquad d_1=-\gamma -\frac{\gamma ^2}{2}+\frac{\pi ^2}{12}$$

$$4 \sqrt \pi\,d_2=6 (178+3 \gamma (8+\gamma )) \sqrt{\pi }+32 \pi ^2-3 \pi ^{5/2}-64 \left(P^2+4 P+36\right)$$ $$3 \sqrt \pi\,d_3=-3 (1356+\gamma (111+16 \gamma )) \sqrt{\pi }-144 \pi ^2+8 \pi ^{5/2}+96 \left(3 P^2+8 P+92\right)$$ $$3 \sqrt \pi\,d_4=2 \left(3 (1376+\gamma (61+14 \gamma )) \sqrt{\pi }+156 \pi ^2-7 \pi ^{5/2}-24 \left(13 P^2+20 P+372\right)\right)$$ $$\frac{\sqrt{\pi }}{4}\,d_5=-\left(628+9 \gamma +6 \gamma ^2\right) \sqrt{\pi }-24 \pi ^2+\pi ^{5/2}+16 \left(3 P^2+2 P+84\right)$$ $$3 \sqrt \pi\,d_6=-4 \left(-6 (106+(\gamma -1) \gamma ) \sqrt{\pi }-24 \pi ^2+\pi ^{5/2}+48 \left(P^2+28\right)\right)$$ where $P=\psi \left(\frac{3}{2}\right)=2-\gamma -2\log (2)$

The maximum absolute error is $1.5 \times 10^{-8}$ which seems to be decent.

Making the numbers rational, this would give $$\frac{1}{\Gamma(x+1)}\sim 1+x(1-x) P_6(x)$$ $$P_6(x)=\frac{2807}{4863}-\frac{247}{3140}x-\frac{461 }{3820}x^2+\frac{66 }{1435}x^3+\frac{11 }{3303}x^4-\frac{15 }{2726}x^5+\frac{3 }{2750}x^6$$

A few values of the definite integral (just for comparison) $$\left( \begin{array}{cccc} \mu & t & \text{approximation} & \text{exact} \\ 0.25 & 0.2 & 0.182857067200 & 0.182857068268 \\ 0.25 & 0.4 & 0.329965795201 & 0.329965797571 \\ 0.25 & 0.6 & 0.443007596935 & 0.443007599310 \\ 0.25 & 0.8 & 0.526656210875 & 0.526656212492 \\ 0.25 & 1.0 & 0.586607844050 & 0.586607845209 \\ & & & \\ 0.50 & 0.2 & 0.195704099746 & 0.195704100926 \\ 0.50 & 0.4 & 0.376453536397 & 0.376453539149 \\ 0.50 & 0.6 & 0.535922898037 & 0.535922900791 \\ 0.50 & 0.8 & 0.671420159082 & 0.671420160584 \\ 0.50 & 1.0 & 0.782934567076 & 0.782934567750 \\ & & & \\ 0.75 & 0.2 & 0.203784473259 & 0.203784474510 \\ 0.75 & 0.4 & 0.407825165336 & 0.407825168343 \\ 0.75 & 0.6 & 0.602995831714 & 0.602995834721 \\ 0.75 & 0.8 & 0.782793915893 & 0.782793917219 \\ 0.75 & 1.0 & 0.943235581611 & 0.943235581767 \end{array} \right)$$

I am more than happy with these results but,again, just for the art for art's sake, I would like to be even better. For sure, I could use $p=9$ and obtain the parameters in order to match the function, first, second and third derivative values at $x=0$, $x=\frac 12$ and $x=1$; this would lead to monstreous expressions.

So, my question is : without any curve fit and avoiding so many terms, is there a way to obtain a better (mathematically based) approximation of $\Big[\Gamma(1+x)\Big]^{-1}$ for $0 \leq x \leq 1$

  • See my own question https://math.stackexchange.com/questions/3709724/conjectured-upper-bound-frac-gammaxn-gammax-and-limit-at-infinity – Miss and Mister cassoulet char Sep 01 '20 at 13:35
  • @njuffa. This is a nice and interesting obervation. I shall look around. Thanks. – Claude Leibovici Sep 02 '20 at 07:30
  • Claude have you considered the function $f(x)=ax\ln(x)+1$ with $0<a<1$ to make an approximation of the $\Gamma(x+1)$ with $0\leq x\leq 1$ ?Good day ! – Miss and Mister cassoulet char Sep 05 '20 at 12:29
  • @c-love-garlic. Good idea but bad result ! This would give $a\sim -0.34$. Any idea or suggestion is welcomed. Cheers :-) – Claude Leibovici Sep 05 '20 at 12:43
  • @ClaudeLeibovici have you considered $f(x)=\Gamma(x^x+1)$ the abscissa of the minimum is near from $e^{-e^{-1}}$ ? – Miss and Mister cassoulet char Oct 26 '20 at 17:30
  • @ErikSatie. I do not understand since the minimum of $f(x)=\Gamma(x^x+1)$ occurs at $x=\frac 1e$. Please clarify. Cheers :-) – Claude Leibovici Oct 27 '20 at 02:58
  • @ClaudeLeibovici Well you're right there is a problem of calculations with Geogebra . Anyway if we can make an approximation of $f(x)$ using the minimum then we can use the Lambert's function to solve $x^x=y$ and deduce something usefull (?) . It is a good idea ? . Cheers :-). – Miss and Mister cassoulet char Oct 27 '20 at 11:36
  • @ErikSatie. Interesting idea ! I shall look at it. Cheers :-) – Claude Leibovici Oct 27 '20 at 11:38
  • @ClaudeLeibovici Using the idea describe above we have $f(x)=\Gamma(x^x+1)\approx g(x)=e^{x^{4.2}\alpha-e^{-4.2}\alpha}f(e^{-1})$ where $\alpha$ verifying $g(1)=1$ for $e^{-1}\leq x\leq 1$ . It's the best I can do and it's a little bit bad :-( . – Miss and Mister cassoulet char Oct 28 '20 at 15:27
  • @ErikSatie. I think that I could do the same as for $\Big[\Gamma(1+x)\Big]^{-1}$. I shall try tomorrow morning (almost dinner time here). Taking into account your username and your profile, I think that we share many things beside mathematics. Do you know his house ? I love this place. Cheers :-) – Claude Leibovici Oct 28 '20 at 15:35
  • @ErikSatie. I have built a quite good approxiamtion of $\Gamma(x^x+1)$ for $0 \leq x \leq \frac 34$. – Claude Leibovici Oct 29 '20 at 11:04
  • @ClaudeDebussy what tools you have used ? quite as $<10^{-3}$ ? cheers :-) – Miss and Mister cassoulet char Oct 29 '20 at 17:48
  • @ErikSatie. Around $0.005$ using something like a $[2,2]$ Padé approximant. The parameters are derived from function and derivative values at $x=0$, $x=\frac 1 e$ and $x=1$. Send me an e-mail (my adress is in my profile) and I shall send you all this stuff. May be, you could post a question here to see what comes. Cheers (and thanks for my new last name). :-) – Claude Leibovici Oct 29 '20 at 18:13
  • @ClaudeLeibovici Hi I have good news as in one of my previous question have you considered the function $f(x)=\Gamma(x+1)^{x^x}$ ? (the minimum is near $x=0.5$) .Good day !!! – Miss and Mister cassoulet char Nov 19 '20 at 12:55
  • @ErikSatie. I think that this one could be quite simple. Cheers :-) – Claude Leibovici Nov 19 '20 at 13:10
  • @ClaudeLeibovici It's not ironic I suppose. – Miss and Mister cassoulet char Nov 19 '20 at 14:00
  • @ErikSatie. I am serious. The formulae will be awful because the minimum is not at a known value but the same kind of method would work. – Claude Leibovici Nov 19 '20 at 14:05
  • Hi Claude Are you fine see $\Gamma{(x^{\Gamma{(x^{\Gamma{(x^2)}}})}-x^{\Gamma{(x)}}+x})\geq \Gamma{(x)}$ from https://math.stackexchange.com/questions/4242661/refinement-about-gammax-gammax-gammax2-x-gammaxx-ge .Un petit rien pour vous !:-)Good night in Pau . – Miss and Mister cassoulet char Sep 05 '21 at 19:17
  • For the improper case, please try the mu function. – Тyma Gaidash Sep 25 '21 at 17:31
  • @TymaGaidash. Could you please elaborate ? By the way, you produce extremely interesting problems that I always follow. My problem is that 99.999999% of the time I am just unable to contribute. Cheers :-) – Claude Leibovici Sep 26 '21 at 01:29
  • @ClaudeLeibovici The mu function is defined fairly by “ Erdélyi et al. 1981a, p. 388; Prudnikov et al. 1990, p. 798; Gradshteyn and Ryzhik “, as seen in the link. It is a generalized version of the Mellin transform of the gamma function, so it can solve $$\int_0^\infty\frac{t^n k^t}{(x+a)!}$$ in closed form, in terms of the Nu or Mu function. By the way, the same people also defined the Lambda function equation (3) generalizing the integral of the factorial. For $t=\infty$, use ν(a,x). – Тyma Gaidash Sep 26 '21 at 01:44
  • @ClaudeLeibovici Thanks. [+1] You put good effort into your questions, but mine are normal questions. I thought you could use these rare, nu, mu, and lambda, special functions for your problem. Does this help? – Тyma Gaidash Sep 26 '21 at 01:51
  • @ClaudeLeibovici look at : $$g\left(x\right)=\frac{2x}{x^{0.85x}+1}-\frac{\left(x\left(1-x\right)\right)^{2}}{8}-\frac{\left(x\left(1-x\right)\right)^{4}}{2}-6\left(x\left(1-x\right)\right)^{6}-6\left(x\left(1-x\right)\right)^{8}-12\left(x\left(1-x\right)\right)^{10}-\sum_{n=5}^{\infty}n^{e}\left(x\left(1-x\right)\right)^{2\left(n+1\right)},1-\ln\left(\frac{g\left(x\right)}{x}\right)\simeq x!$$ around $x=1$ – Miss and Mister cassoulet char Nov 29 '22 at 15:07
  • @ErikSatie. This is amazing ! Thanks & cheers – Claude Leibovici Nov 29 '22 at 15:16
  • @ClaudeLeibovici A last one for the the pleasure : $$f\left(x\right)=1-\ln\left(\frac{2}{\left(x^{0.85x^{1.27}}+1\right)}\right)+\frac{x\left(1-x\right)}{32}-\frac{\left(x^{2}\left(1-x\right)\right)^{2}}{4}-\frac{\left(x\left(1-x^{2}\right)\right)^{4}}{25}-\frac{\left(x^{2}\left(1-x\right)\right)^{6}}{4}-\frac{\left(x\left(1-x^{2}\right)\right)^{8}}{4}-10000\left(x^{2}\left(1-x\right)\right)^{10}-3\left(x\left(1-x^{2}\right)\right)^{12}-650000\left(x^{2}\left(1-x\right)\right)^{14}-0.2\left(x\left(1-x^{2}\right)\right)^{16}\simeq x!$$ Try for $x=0.7128$ – Miss and Mister cassoulet char Dec 06 '22 at 08:42
  • Let : $$f\left(x\right)=\frac{x!}{x^{2}+1}$$ then define : $g\left(x\right)=1+f'\left(0\right)x,a_{1}\left(x\right)=\frac{\left|f\left(x\right)-g\left(x\right)\right|}{x+1},a_{2}\left(x\right)=x\left(0.5-x\right)a_{1}\left(0.25\right),a_{3}\left(x\right)=\frac{\left|a_{1}\left(x\right)-a_{2}\left(x\right)\right|}{x+1},a_{4}\left(x\right)=x\left(0.5-x\right)a_{3}\left(0.25\right),\operatorname{and so on...}$ then it seems to converges around $x\in[0,\epsilon]$ where $\epsilon<0.25$.Now multiply by $x+1$, $n$ times and you got something I think ...Give me your feedback ! – Miss and Mister cassoulet char Jan 27 '23 at 13:23
  • See $$\left(f\left(x\right)\left(\left(\frac{1}{x}\right)!\right)^{-1}\right)+\frac{1}{50}\left(15\left(x-0.5689\right)^{2}\left(1-x\right)^{2}+160\left(x-0.5689\right)^{2}\left(1-x\right)^{4}+1000\left(x-0.5689\right)^{4}\left(1-x\right)^{4}\right),f\left(x\right)=x^{-\left(\frac{x-1}{x+1}\right)^{2}-\frac{4}{3}\left(\frac{x-1}{x+1}\right)^{4}-\frac{9}{5}\left(\frac{x-1}{x+1}\right)^{6}-2\left(\frac{x-1}{x+1}\right)^{8}+\ln\left(x\right)},x!$$ Cheers ! – Miss and Mister cassoulet char Jun 15 '23 at 12:13

7 Answers7

5

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\on}[1]{\operatorname{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\bbox[5px,#ffd]{1 \over \Gamma\pars{x + 1}} = {1 \over x!} = {x + 1 \over \pars{x + 1}!} = {\pars{x + 2}\pars{x + 1} \over \pars{x + 2}!} \\[5mm] = &\ \cdots = {\prod_{k = 1}^{n}\pars{x + k} \over \pars{x + n}!} \\[5mm] \approx &\ {\prod_{k = 1}^{n}\pars{x + k} \over \root{2\pi}\pars{x + n}^{x + n + 1/2}\,\,\,\expo{-n - x}} = {\tt mySol}\pars{x,n} \end{align}

enter image description here

Felix Marin
  • 89,464
  • 5
    Very interesting approach ! Thanks for it. By the way, when I see some answers, I know they are from you since you have a very personal style. I suppose that you don't remember but we met in Caracas some 30+ years ago. Cheers :-) – Claude Leibovici Nov 20 '20 at 07:51
4

My try : we have on $x\in[1,2]$ :

$$1+4(x-1)(x-2)\left(1-\Gamma\left(\left(\frac{\left(1+\sqrt{2}\right)}{2}\right)^{2}\right)\right)\simeq \Gamma(x)$$

It's not really tight but it's simple in the form.

Hope it helps you Claude.

Edit :

Around $x=2$ we have :

$$\Gamma(x)\simeq ((1-x)\frac{1}{2}(\gamma-1)+1+\frac{1}{2}(\gamma-1))^x$$

Edit 2:

Using the inverse function of the Lambert's function and denotes by :

$$g(x)=\left(1+\frac{1}{2}xe^x\right)^{x+1}$$

We have $1\leq x \leq 2$:

$$\Gamma(x)\simeq (g(1-x))^x$$



We have on $(-1,0)$ the approximation :

$$(\operatorname{W}(-ex))^{(\operatorname{W}(-x))^{1.45}}\simeq (\Gamma(1-x))^{\frac{1}{1-x}}$$



For $1\leq x\leq 2$ it seems we have the inequality :

$$f(x)=\left(\Gamma(x)\tanh(x)\right)^{\frac{2}{x(1+\tanh(e^{-1}x))}}$$

$$f(x)\leq \frac{f(1)-f(2)}{-1}(x-1)+f(1)$$

And the difference is less than $1*10^{-3}$

Last edit :

$$f(x)=\left(\Gamma(x)\tanh(x)\right)^{\frac{2}{x(1+\tanh(0.25x))}}$$

For $1\leq x\leq 2$ it seems we have the inequality :

$$(f(x))''>0$$

So we can get using convexity an arbitrary accuracy following the lenght of the interval .

3

Letting $x!=\Gamma(x+1)$, the Gamma function may be defined through the following limit for an arbitrary $\alpha$ where $x\approx0$ and $x\approx\alpha^2$ for $\alpha\approx1$ are most accurate:

$$x!=\lim_{n\to\infty}\left(n+\alpha\right)^x\prod_{k=1}^n\left(1+\frac xk\right)^{-1}$$

which has simple inverse given by

$$x!^{-1}=\lim_{n\to\infty}\left(n+\alpha\right)^{-x}\prod_{k=1}^n\left(1+\frac xk\right)$$

In the given problem, this leads to an integrand of the form $P(x)\phi^x$ for polynomial $P$ and constant $\phi$, which can be evaluated elementarily.

It's also worth pointing out that refining the estimate by taking larger $n$ does not involve a lot of recalculation since it is just one additional term on the product. However, the convergence is not very fast.

Choosing something such as $\alpha=0.9$ should lead to a good balance of over- and under-estimates of the Gamma function.

1

This answer is curve fitting, but it involves only 3 parameters. The accuracy is better than 0.13% over all $0<x<1$; good, but nothing like Claude's 8 digits or so. The idea is that the local max is not exactly at 1/2, as implied the factor $x(1-x)$ in Claude's analysis.

$$ \frac{1}{\Gamma(1+x)} \approx 1+ A \ x^b (1-x)^c $$ $$ A=0.538 , \ b=0.971 ,\ c=1.095 $$

The error is close to minimax; that is, the amplitudes of the difference curve are approximately equal.

Gary
  • 31,845
user321120
  • 6,740
  • Thanks for answering ! But, as I wrote, I do not want any empirical curve fit. Next, how would you compute the integral $f(t)$ ? "My" maximum is not at $x=1/2$; for the rigorous function, the coordinates of the extremum are $(0.461632145,1.12917389)$ and for the approximation $(0.461632154,1.12917389)$. Cheers and thanks again for the effort. – Claude Leibovici Sep 02 '20 at 04:41
1

What is below is exactly what I do not want to do. It is just posted to show that high order polynomials are highly significant.

What I did was to generate $10001$ equally spaced data points of $$f(x)=\frac{1}{(x-1) x}\left(\frac{1}{\Gamma (x+1)}-1\right)\qquad \qquad -\gamma \leq f(x) \leq -1+\gamma$$ using high precision.

Then, polynomial regressions; below is an example of the results for a polynomial of degree $9$ (it leads to maximum absolute errors $\sim 10^{-11}$).

$$\begin{array} \text{ } & \text{Estimate of } d_k & \sigma\text{ for }d_k \\ 1 & -0.5772156649 & 2.449\times 10^{-13} \\ x & +0.0786624078 & 1.399\times 10^{-11} \\ x^2 & +0.1206650090 & 2.600\times 10^{-10} \\ x^3 & -0.0458731951 & 2.221\times 10^{-9} \\ x^4 & -0.0036781095 & 1.028\times 10^{-8} \\ x^5 & +0.0059542170 & 2.790\times 10^{-8} \\ x^6 & -0.0012903855 & 4.563\times 10^{-8} \\ x^7 & -0.0000841706 & 4.421\times 10^{-8} \\ x^8 & +0.0000893923 & 2.336\times 10^{-8} \\ x^9 & -0.0000138358 & 5.183\times 10^{-9} \end{array}$$

Edit

In view of these results, I made the calculations for $p=9$ matching the function, first, second and third derivative values at $x=0$, $x=\frac 12$ and $x=1$; this effectively leads to monstrous expressions (I shall not type them but they are available); as one could expect, the same constants plus $\zeta(3)$ appear in their expressions. The maximum absolute error is $1.1 \times 10^{-11}$.

Now, the same table as before $$\left( \begin{array}{cccc} \mu & t & \text{approximation} & \text{exact} \\ 0.25 & 0.2 & 0.182857068266992 & 0.182857068267690 \\ 0.25 & 0.4 & 0.329965797569747 & 0.329965797571307 \\ 0.25 & 0.6 & 0.443007599308124 & 0.443007599309699 \\ 0.25 & 0.8 & 0.526656212489610 & 0.526656212491646 \\ 0.25 & 1.0 & 0.586607845206624 & 0.586607845208931 \\ & & & \\ 0.50 & 0.2 & 0.195704100925464 & 0.195704100926239 \\ 0.50 & 0.4 & 0.376453539146954 & 0.376453539148764 \\ 0.50 & 0.6 & 0.535922900789419 & 0.535922900791250 \\ 0.50 & 0.8 & 0.671420160581682 & 0.671420160584277 \\ 0.50 & 1.0 & 0.782934567746625 & 0.782934567749710 \\ & & & \\ 0.75 & 0.2 & 0.203784474509130 & 0.203784474509953 \\ 0.75 & 0.4 & 0.407825168340619 & 0.407825168342596 \\ 0.75 & 0.6 & 0.602995834719402 & 0.602995834721404 \\ 0.75 & 0.8 & 0.782793917216033 & 0.782793917219063 \\ 0.75 & 1.0 & 0.943235581763057 & 0.943235581766778 \end{array} \right)$$

  • For comparison, coefficients of minimax $P_{9}$ (matches at $x=0$, $x=1$) with maximum absolute error $< 10^{-12}$: 5.7721566490547482e-1, -7.8662407402331200e-2, -1.2066501595952826e-1, 4.5873243335408945e-2, 3.6779360284088752e-3, -5.9538708486641407e-3, 1.2900033631901313e-3, 8.4380677149800901e-5, -8.9427608944409487e-5, 1.3828612244534447e-5 – njuffa Sep 02 '20 at 17:54
  • @njuffa. Thanks ! This is nice but the problem with minimax is that you do not have any idea about the significance of resulting parameters. – Claude Leibovici Sep 03 '20 at 06:29
  • @gary. No idea ? Cheers :-) – Claude Leibovici Sep 12 '20 at 09:48
1

Partial second answer.

Inspired by @FelixMarin's answer I found :

Let $2/3<x<1$ and define :

$$f\left(x\right)=\sqrt{2\pi x}\left(\frac{x}{e}\right)^{x}e^{\frac{1}{12x+\left(e-2\right)x^{-x}\cdot2^{-x}-\left(e-2\right)x^{x^{x}}+1-C}}$$

Where $C$ is the Catalan's constant .

Then it seems we have :

$$0<\frac{f\left(x\right)}{f\left(1\right)}-x!<8*10^{-5}$$

1

Hi Claude I find the following nice:

Let $x\in(0,1)$ and

$$f(x)=x!^{\frac{1}{x-1}},\quad g(x)=\frac{ f(0)-f(1) }{-1}\left(x-1\right)+f(1)+\sum_{n=1}^{\infty}\ln\left(1+\frac{x^{2n}\left(1-x\right)^{2n}}{\left(2\pi\right)^{n}}\right).$$

Then $k=10$

$$\left(g(x)\right)^{x-1}+k-\sum_{n=1}^{k}\exp\left(\frac{x^{\frac{4}{\pi}}\left(1-x\right)^{8+n}}{8^{2}}\right)>x!$$