# Limit of an integral involving a general $f(x)$

Let $$f:[0,1]\to\Bbb R$$ be a continuous function. Calculate $$\lim_{{n\to\infty}} \frac{\sqrt{n}}{\ln{n}} \int_0^1 \left( \sqrt{n+1+x+x^2+x^3+\ldots+x^{n-1}} - \sqrt{n} \right) f(x) \, dx.$$

I have absolutely no clue how to solve this kind of limit; I tried rationalization, simplifying it using the GP formula and then trying to break it into different integrals, and using Newton Leibniz rule (and L'Hopital's rule) to differentiate the inner term wrt $$n.$$ Can anyone please help me out with this?

• when i plug that integral in wolfram alpha, it shows standard time exceeded so im unable to integrate it numerically and also, what gave you the hint that it should tend to 0? Oct 16, 2023 at 15:40
• @ThànhNguyễn I think it is not zero. Simply use: $\sqrt{n+1+x+\ldots+x^{n-1}} - \sqrt{n} = \frac{1 + x + \cdots + x^{n-1}}{\sqrt{n+1+x+\ldots+x^{n-1}} + \sqrt{n}} \ge \frac{1 + x + \cdots + x^{n-1}}{\sqrt{n+n} + \sqrt{n}}$. Oct 17, 2023 at 2:16
• @RiverLi You forgot the term $\dfrac{\sqrt{n}}{\ln n}$ Oct 17, 2023 at 2:20
• @ThànhNguyễn I give the details: \begin{align*} &\frac{\sqrt{n}}{\ln{n}} \int_0^1 \left( \sqrt{n+1+x+x^2+x^3+\ldots+x^{n-1}} - \sqrt{n} \right)\mathrm{d} x \\ ={}& \frac{\sqrt{n}}{\ln{n}} \int_0^1 \frac{1 + x + x^2 + \cdots + x^{n-1}}{\sqrt{n+1+x+x^2+x^3+\ldots+x^{n-1}} + \sqrt{n}}\,\mathrm{d} x\\ \ge{}& \frac{\sqrt{n}}{\ln{n}} \int_0^1 \frac{1 + x + x^2 + \cdots + x^{n-1}}{\sqrt{n+n} + \sqrt{n}}\,\mathrm{d} x\\ ={}& \frac{1}{(\sqrt 2 + 1)\ln{n}}\sum_{k=1}^{n} \frac{1}{k}\\ \ge{}& \frac{1}{\sqrt 2 + 1}. \end{align*} Oct 17, 2023 at 2:21
• @Cognoscenti I think Svyatoslav's comment makes sense. It seems the limit is not related to $f(0)$. I wrote a long comment. Oct 19, 2023 at 6:42

Solution.

Let $$g_n(x) := 1 + x + x^2 + \cdots + x^{n-1}$$. We have \begin{align*} &\sqrt{n + g_n(x)} - \sqrt n\\ ={}& \sqrt{n}\sqrt{1 + \frac{g_n(x)}{n}} - \sqrt{n}\\[6pt] ={}& \sqrt{n} \left(\sqrt{1 + \frac{g_n(x)}{n}} - 1 - \frac{g_n(x)}{2n}\right) + \sqrt{n}\left(1 + \frac{g_n(x)}{2n}\right) - \sqrt{n}\\[6pt] ={}& \frac{g_n(x)}{2\sqrt n} - \frac{1}{\sqrt n}\cdot \frac{[g_n(x)]^2}{4n + 2g_n(x) + 4\sqrt{n^2 + n g_n(x)}}. \tag{1} \end{align*}

Using (1), we have \begin{align*} &\frac{\sqrt{n}}{\ln{n}} \int_0^1 \left( \sqrt{n+1+x+x^2+x^3+\ldots+x^{n-1}} - \sqrt{n} \right)f(x)\, \mathrm{d} x \\[6pt] ={}& \frac{1}{2\ln n}\int_0^1 g_n(x) f(x)\,\mathrm{d} x - \frac{1}{\ln n}\int_0^1 \frac{[g_n(x)]^2f(x)}{4n + 2g_n(x) + 4\sqrt{n^2 + n g_n(x)}} \,\mathrm{d} x\\[6pt] ={}& \frac{1}{2\ln n}\int_0^1 g_n(x) f(1)\,\mathrm{d} x + \frac{1}{2\ln n}\int_0^1 g_n(x) [f(x) - f(1)]\,\mathrm{d} x \\[6pt] &\qquad - \frac{1}{\ln n}\int_0^1 \frac{[g_n(x)]^2f(x)}{4n + 2g_n(x) + 4\sqrt{n^2 + n g_n(x)}} \,\mathrm{d} x\\[6pt] ={}& \frac{f(1)}{2\ln n}\sum_{k=0}^{n-1}\frac{1}{k+1} + \frac{1}{2\ln n}\int_{1-1/\ln n}^1 g_n(x) [f(x) - f(1)]\,\mathrm{d} x \\[6pt] &\qquad + \frac{1}{2\ln n}\int_0^{1-1/\ln n} g_n(x) [f(x) - f(1)]\,\mathrm{d} x \\[6pt] &\qquad - \frac{1}{\ln n}\int_0^1 \frac{[g_n(x)]^2f(x)}{4n + 2g_n(x) + 4\sqrt{n^2 + n g_n(x)}} \,\mathrm{d} x. \tag{2} \end{align*}

We have \begin{align*} &\left|\frac{1}{2\ln n}\int_{1-1/\ln n}^1 g_n(x) [f(x) - f(1)]\,\mathrm{d} x\right|\\[6pt] \le{}& \left(\max_{x\in [1-1/\ln n,\, 1]} |f(x) - f(1)|\right)\cdot \frac{1}{2\ln n}\int_{1-1/\ln n}^1 g_n(x)\,\mathrm{d} x \\[6pt] \le{}& \left(\max_{x\in [1-1/\ln n,\, 1]} |f(x) - f(1)|\right)\cdot \frac{1}{2\ln n}\int_0^1 g_n(x)\,\mathrm{d} x\\ ={}& \left(\max_{x\in [1-1/\ln n,\, 1]} |f(x) - f(1)|\right)\cdot \frac{1}{2\ln n}\sum_{k=0}^{n-1} \frac{1}{k+1}\\ \le{}& 2 \max_{x\in [1-1/\ln n,\, 1]} |f(x) - f(1)| \tag{3} \end{align*} where we use $$\frac{1}{2\ln n}\sum_{k=0}^{n-1} \frac{1}{k+1} < 2$$. Note: $$\lim_{n\to \infty} 2 \max_{x\in [1-1/\ln n,\, 1]} |f(x) - f(1)| = 0$$.

Let $$M := \max_{x\in [0, 1]} |f(x) - f(1)|$$. We have \begin{align*} \left|\frac{1}{2\ln n}\int_0^{1-1/\ln{n}} g_n(x) [f(x) - f(1)]\,\mathrm{d} x\right| &\le \frac{M}{2\ln n}\int_0^{1-1/\ln{n}} g_n(x) \,\mathrm{d} x \\ &\le \frac{M}{2\ln n}\int_0^{1-1/\ln{n}} \frac{1}{1 - x} \,\mathrm{d} x\\ &= \frac{M\ln(\ln n)}{2\ln n} \tag{4} \end{align*} where we use $$g_n(x) \le \frac{1}{1 - x}$$ on $$[0, 1 - \frac{1}{\ln n}]$$. Also, we have \begin{align*} &\left|\frac{1}{\ln n}\int_0^1 \frac{[g_n(x)]^2f(x)}{4n + 2g_n(x) + 4\sqrt{n^2 + n g_n(x)}} \,\mathrm{d} x\right|\\[6pt] \le{}& \frac{1}{\ln n}\int_0^1 \frac{[g_n(x)]^2M}{8n} \,\mathrm{d} x\\[6pt] ={}& \frac{M}{8n\ln n}\int_0^{1-1/n} [g_n(x)]^2\,\mathrm{d} x + \frac{M}{8n\ln n}\int_{1-1/n}^1 [g_n(x)]^2\,\mathrm{d} x\\[6pt] \le{}& \frac{M}{8n\ln n}\int_0^{1-1/n} \frac{1}{(1-x)^2}\,\mathrm{d} x + \frac{M}{8n\ln n}\int_{1-1/n}^1 n^2\,\mathrm{d} x\\ ={}& \frac{M(n-1)}{8n\ln n} + \frac{M}{8\ln n} \tag{5} \end{align*} where we use $$g_n(x) \le \frac{1}{1 - x}$$ on $$[0, 1 - 1/n]$$, and $$g_n(x) \le n$$ for all $$x\in [0, 1]$$.

From (2)-(5), we have \begin{align*} &\lim_{n\to \infty} \frac{\sqrt{n}}{\ln{n}} \int_0^1 \left( \sqrt{n+1+x+x^2+x^3+\ldots+x^{n-1}} - \sqrt{n} \right)f(x)\, \mathrm{d} x \\[6pt] ={}& \lim_{n\to \infty} \frac{f(1)}{2\ln n}\sum_{k=0}^{n-1}\frac{1}{k+1} \\[6pt] ={}& \frac{f(1)}{2}.\tag{6} \end{align*}

• nice detailed solution! Oct 20, 2023 at 4:58
• okay, wow, that was beautiful, thank you very much, it took me about half an hour to work through that but it was so worth it Oct 20, 2023 at 5:28