Update: \begin{align*} |I_n-J_n| = (\pi-S_n)\sum_{k=0}^n |\frac{a_kp_k(\ln\pi)}{\ln^{k+1}\pi}| \end{align*} and \begin{align*} |I_n| = \sum_{k=0}^n | \frac{a_k\pi p_k(\ln\pi)}{\ln^{k+1}\pi} -\sum_{k=0}^n\frac{a_kk!}{\ln^{k+1}\pi}| \leq |\sum_{k=0}^n \frac{a_k\pi p_k(\ln\pi)}{\ln^{k+1}\pi} | + |\sum_{k=0}^n\frac{a_kk!}{\ln^{k+1}\pi}|\\ \implies - |\sum_{k=0}^n \frac{a_k\pi p_k(\ln\pi)}{\ln^{k+1}\pi} | \leq |\sum_{k=0}^n\frac{a_kk!}{\ln^{k+1}\pi}| -|I_n| \\\implies |I_n-J_n| = (S_n-\pi)\sum_{k=0}^n -|\frac{a_kp_k(\ln\pi)}{\ln^{k+1}\pi}|\\ \leq (S_n-\pi)\left(|\sum_{k=0}^n\frac{a_kk!}{\ln^{k+1}\pi}|-|I_n|\right) \end{align*} where I believe the $a_k$'s are the coeffcients of the shifted legendre polynomials. I believe $a_k<k!$ for every non negative $k$ because since $I_n= \sum_{k=0}^n \frac{a_k}{\ln^{k+1}(\pi)} ( \pi p_k(\ln\pi) - k! )$ goes to $0$ as $n$ grows larger, that means that $( \pi p_k(\ln\pi) - k! )$ goes to $0$ (in a factorial rate) faster than $a_k$'s goes to infinity, as $n$ grows larger.
Question
I asked this in another forum but hoping someone will help me here.
For some positive integer $n$, define $I_n$ as \begin{align} I_n&=\int_0^1 \frac{(x-x^2)^n}{n!} \pi^x\ln^n\pi dx \\ \end{align} this integral has the following form \begin{align*} I_n&=\sum_{k=0}^n \frac{a_k}{\ln^{k+1}(\pi)} ( \pi p_k(\ln\pi) - k! ) \tag{1} \end{align*} where $a_k$ are integers and $p_k(\ln\pi)$ are polynomials with degree $k$ evaluated at $\ln\pi$.
This integral is positive and will always converge, and $\lim_{n\to\infty}I_n=0$. Notice that $\pi$ is present in expression $(1)$. (I'm not talking about $\pi$ inside the $\ln$ but rather the factor the multiplies $p_k$). What will happen if we change this $\pi$ to an approximation of it? Consider the expression, \begin{align*} J_n&=\sum_{k=0}^n \frac{a_k}{\ln^{k+1}(\pi)} ( S_n p_k(\ln\pi) - k! ) \end{align*} where $S_n$ is a truncated series such that $\lim_{n\to\infty}S_n=\pi$. For example, consider the truncated BBP formula \begin{align*} S_{n}=\sum_{k=0}^{f(n)}\left( \frac{4}{16^k(8k+1)} -\frac{2}{16^k(8k+4)} -\frac{1}{16^k(8k+5)} -\frac{1}{16^k(8k+6)}\right) \end{align*} where $f(n)$ is some function in $n$ such that the following must be true \begin{align*} \lim_{n\to\infty} \frac{16^{f(n)}e^{8f(n)}}{n!}=0. \tag{2} \end{align*}
I noticed that if we choose a bad $f(n)$ such as $f(n)=n$, our $S_n$ will approximate $\pi$ very slowly, and $J_n$ will diverge to infinity or negative infinity as $n$ grows larger. For example, with $f(100)=100$ we must only iterate the BBP formula $100$ times giving a bad approximation to $\pi$ which results in the large difference between $I_{100}=7.7472...\cdot 10^{-241}$ and $J_{100}=-3.2990\cdot 10^{84}$.
However, if we choose $f(n)=\lfloor n(\ln n)^{0.99}\rfloor$ the limit $(2)$ will be true (I used SageMath to evaluate this), and it gives a much better approximation. For example, now $f(100)=453$, and iterating the BBP formula $453$ times, gives a better approximation for $\pi$ and now $J_{100}=7.7472...\cdot10^{-241}$ has $75$ correct digits when comparing with $I_{100}$.
With this $f(n)=\lfloor n(\ln n)^{0.99}\rfloor$ will the truncated BBP formula always produce an approximation of $\pi$ good enough so that $\lim_{n\to\infty}J_n=0$ ? And how close it is from $I_n$ ? In the end of this post there is an upper bound for $I_n$. I need an upper bound for $J_n$. If this $f(n)$ is not good enough, there exists a $f(n)$ respecting $(2)$ that will make $J_n$ always converge when $n$ goes to infinity?
Example: Consider $n=2$ \begin{align} I_2&= (12 (-1 + π) - 6 (1 + π) \log(π) + (-1 + π) \log^2(π))/(\log^3(π)) \approx 0.0396. \end{align} To find $J_2$ we must find $S_2$: \begin{align*} S_{2}=\sum_{k=0}^{f(2)}\left( \frac{4}{16^k(8k+1)} -\frac{2}{16^k(8k+4)} -\frac{1}{16^k(8k+5)} -\frac{1}{16^k(8k+6)}\right) \end{align*} where $f(2)=1$, which gives the following approximation for $\pi$: $S_2=102913/32760.$ Therefore we have, \begin{align} J_2&= (12 (-1 + 102913/32760) - 6 (1 + 102913/32760) \log(π) + (-1 + 102913/32760) \log^2(π))/(\log^3(π)) \approx 0.0388. \end{align}
More information:
For some $b>0$, \begin{align*} \int_0^1 x^n b^x dx = \int_0^1 x^n e^{\ln(b) x} dx = \frac{1}{\ln^{n+1}(b)} \int_0^{\ln(b)} x^n e^x dx. \end{align*} Let's change $x^n$ for a polynomial $P_n(x)=\sum_{k=0}^n a_kx^k$, \begin{align*} \int_0^1 P_n(x) b^x dx = \sum_{k=0}^n \frac{a_k}{\ln^{k+1}(b)} \int_0^{\ln(b)} x^k e^x dx \end{align*} where $\int x^ke^xdx$ has the shape $e^xp_k(x)$ where $p_k(x)$ is a polynomial with degree $k$ and has integer coefficients. The independent coefficient is $k!$. Integrating from $0$ to $\ln b$ we have $\int_0^{\ln b} x^ke^xdx=e^{\ln b} p_k(\ln b)-e^0p_k(0) = bp_k(\ln b)-k!$. Take $b=\pi$. Thus, \begin{align*} I_n&=\int_0^1 P_n(x) \pi^x dx = \sum_{k=0}^n \frac{a_k}{\ln^{k+1}(\pi)} \int_0^{\ln(\pi)} x^k e^x dx\\ &=\sum_{k=0}^n \frac{a_k}{\ln^{k+1}(\pi)} ( \pi p_k(\ln\pi) - k! ). \end{align*} Denote the above integral by $I_n$, where $P_n(x)$ is the following polynomial \begin{align*} P_n(x)=\frac{d^n}{dx^n} \frac{(x-x^2)^n}{n!}. \end{align*} We can integrate by parts $n$ times $I_n$ using the following rule \begin{align*} \int_a^b \frac{d^n}{dx^n}f(x)g(x)dx=(-1)^n\int_a^b f(x)\frac{d^n}{dx^n}g(x)dx \end{align*} if $f(a)g(a)=f(b)g(b)=0.$
\begin{align*} \int_0^1 \frac{d^n}{dx^n} \frac{(x-x^2)^n}{n!} \pi^x dx &=(-1)^n \int_0^1 \frac{(x-x^2)^n}{n!} \frac{d^n}{dx^n} \pi^xdx \\ &=(-1)^n\int_0^1 \frac{(x-x^2)^n}{n!} \pi^x\ln^n\pi dx. \end{align*} Thus, \begin{align*} |I_n|&=\int_0^1 \frac{(x-x^2)^n}{n!} \pi^x\ln^n\pi dx \\ &\leq\frac{1}{n!}\int_0^1 [max(x-x^2)]^n \pi^x \ln^n\pi dx \\ &=\frac{1}{n!} (1/4)^n \ln^n\pi \int_0^1\pi^xdx \\ &= \frac{1}{n!} (1/4)^n \ln^n\pi \frac{\pi-1}{\ln\pi}. \end{align*}