Limit of function which is product of $x^x$ primitives

I'm trying to analytically derive the following limit: $$\lim_{x\to \infty}\left(\frac{1}{8}\right)\left(e^{1-\frac{\sqrt{x}}{2}}\right)\left(\frac{x}{x-\frac{\sqrt{x}}{2}+1}\right)^{x-\frac{\sqrt{x}}{2}+1}$$ I've found it extremely difficult because, as you apply L'Hospital's rule, you need to differentiate $x$ times, thus getting an infinite chain of differentiations (each one invoking the product rule).

WorlframAlpha says the limit is equal to $\frac{1}{8e^{1/8}}$ which seems to match perfectly the numerical estimates I've made with my computer up to $x=2\times10^4$, but it gives no explanation for how it derives this result. How can I analytically evaluate this limit? On it's face, it seems intractable. Yet there appears to be an analytical solution.

The purpose of evaluating this limit is to calculate the following limit of a combinatorial probability: $$\lim_{N\to\infty}\left(\frac{M^2(N!)}{2N^M(N-M+1)!}\right)$$ Where $M=\frac{N^{1/2}}{2}$.

The original limit above can be found by applying Sterling's Approximation on the second limit. If anyone is aware of any alternative techniques for analytically evaluating this second limit, that would be just as helpful.

$$\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \left( e^{ 1-\frac { \sqrt { x } }{ 2 } } \right) \left( \frac { x }{ x-\frac { \sqrt { x } }{ 2 } +1 } \right) ^{ x-\frac { \sqrt { x } }{ 2 } +1 }=\\ =\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \left( e^{ 1-\frac { \sqrt { x } }{ 2 } } \right) \left( \frac { 1 }{ 1+\frac { 1 }{ x } -\frac { 1 }{ 2\sqrt { x } } } \right) ^{ x-\frac { \sqrt { x } }{ 2 } +1 }=\\ =\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \left( e^{ 1-\frac { \sqrt { x } }{ 2 } } \right) \left( 1+\frac { 1 }{ x } -\frac { 1 }{ 2\sqrt { x } } \right) ^{ \frac { \sqrt { x } }{ 2 } -x-1 }=\\ =\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \left( e^{ 1-\frac { \sqrt { x } }{ 2 } } \right) \left( 1+\frac { 2-\sqrt { x } }{ 2x } \right) ^{ \frac { \sqrt { x } }{ 2 } -x-1 }=\\ =\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \left( e^{ 1-\frac { \sqrt { x } }{ 2 } } \right) { \left[ \left( 1+\frac { 2-\sqrt { x } }{ 2x } \right) ^{ \frac { 1 }{ \frac { 2-\sqrt { x } }{ 2x } } } \right] }^{ \left( \frac { 2-\sqrt { x } }{ 2x } \right) \cdot \left( \frac { \sqrt { x } }{ 2 } -x-1 \right) }=\\ =\lim _{ x\to \infty } \left( \frac { 1 }{ 8 } \right) \cdot e^{ 1-\frac { \sqrt { x } }{ 2 } }\cdot { { e }^{ \left( \frac { 2-\sqrt { x } }{ 2x } \right) \cdot \left( \frac { \sqrt { x } }{ 2 } -x-1 \right) } }=\frac { 1 }{ 8 } { e }^{ \lim _{ x\to \infty } \left( 1-\frac { \sqrt { x } }{ 2 } +\frac { 1 }{ 2\sqrt { x } } -1-\frac { 1 }{ x } -\frac { 1 }{ 4 } +\frac { \sqrt { x } }{ 2 } +\frac { 1 }{ 2\sqrt { x } } \right) }=\\ \\ =\frac { 1 }{ 8{ e }^{ 1/4 } }$$

• There seems to be an error in the second to last line, all the limits above it will evaluate to $\frac 1{8e^{1/8}}$. Commented Feb 8, 2017 at 23:22
• @Ennar,i checked it more times,i don' t see any error Commented Feb 9, 2017 at 4:29
• Here is the error. Let $f(x) = \frac{2-\sqrt x}{2x}$, $g(x) = \frac{\sqrt x} 2 - x - 1$. What you claim is that $$\lim_{x\to\infty}e^{1-\frac{\sqrt x}2}(1+f(x))^{g(x)} = \lim_{x\to\infty}e^{1-\frac{\sqrt x}2}e^{f(x)g(x)}$$ but this is not true. You would need to have $$\lim_{x\to\infty} \frac{(1+f(x))^{g(x)}}{e^{f(x)g(x)}} = 1$$ However, the last limit is actually $e^{1/8}$, and this difference is why you finally get $e^{1/4}$ instead of correct $e^{1/8}$. Commented Feb 9, 2017 at 13:11
• @Ennar, I really didn't understand your argument.Why $\lim_{x\to\infty}e^{1-\frac{\sqrt x}2}(1+f(x))^{g(x)} = \lim_{x\to\infty}e^{1-\frac{\sqrt x}2}e^{f(x)g(x)}$ is not true,i will be thankful if you help me to elaborate my answer Commented Feb 9, 2017 at 18:00
• Well, for starters, the first one equals $e^{-1/8}$ and the other one equals $e^{-1/4}$. Secondly, if those limits are equal, then divide one by the other to get $\lim_{x\to\infty}\frac{(1+f(x))^{g(x)}}{e^{f(x)g(x)}} = 1$ which is contradiction, since it is actually equal to $e^{1/8}$. Commented Feb 9, 2017 at 18:53

Define $f(x) = 1 - \frac{\sqrt x}{2}$, and thus your limit becomes:

\begin{align} \lim_{x\to\infty} \frac 18e^{f(x)}\left(\frac x{x+f(x)}\right)^{x+f(x)}&=\frac 18\lim_{x\to\infty} e^{f(x)}\left(1-\frac {f(x)}{x+f(x)}\right)^{x+f(x)}\\ &=\frac 18\exp\lim_{x\to\infty}\left( f(x)+(x+f(x))\ln\left(1-\frac {f(x)}{x+f(x)}\right) \right)\end{align}

Note that $\lim_{x\to\infty}\frac {f(x)}{x+f(x)}=0$ so we can use Taylor expansion of $\ln(1+x)$ around $0$ and your limit becomes:

$$\frac 18\exp\lim_{x\to\infty}\left[f(x) + (x+f(x))\left( -\frac {f(x)}{x+f(x)} - \frac {f(x)^2}{2(x+f(x))^2} + O\left(\frac {f(x)^3}{(x+f(x))^3}\right)\right)\right]\\ = \frac 18\exp\lim_{x\to\infty}\left(-\frac {f(x)^2}{2(x+f(x))} + O\left(\frac {f(x)^3}{(x+f(x))^2}\right)\right) \stackrel{(*)}{=} \frac 1{8e^{1/8}}$$

$(*)$ $$\lim_{x\to\infty}\frac {f(x)^2}{2(x+f(x))} = \lim_{x\to\infty}\frac {1-\sqrt x + \frac x4}{2(x+1-\frac{\sqrt x}2)} = \frac 18$$

$$\lim_{x\to\infty}\frac {f(x)^3}{(x+f(x))^2} = \lim_{x\to\infty}\frac {x^{3/2}+\small\text{lower order terms}}{x^2 + \small\text{lower order terms}} = 0$$