Determining a specific Lagrange error for an integral

96 Views Asked by At

Consider

$$f(x) = -\int_0^x \frac{\log(1-t)}{t} \, dt, \quad x \in (-1,1)$$

Now let us consider the Taylor expansion around $x = 0$ Our goal is to figure out the order of the Taylor polynomial that would approximate the $f(1/2)$ by the error of order $10^{-16}$. Using the Uniqueness theorem we can determine that the n'th order Taylor polynomial at $x=0$ will be as such:

$$T_n(x) = -1 - \frac{x}{2} -\frac{x^2}{3} -\frac{x^3}{4}... -\frac{x^n}{n+1}$$ Now to consider the error term let us consider the Lagrange error formula at $x=0$:

$$R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!} \cdot (x)^{n+1}$$

Now assuming $f^{(n+1)}(c) \le 1$ I can bound it and easily find the order for $x = \frac{1}{2}$ and $n = 20$ seems to do the trick. The issue is that I am not sure how to show that $f^{(n+1)}(c) \le 1$ is actually true. There is no nice pattern in the derivatives. Any help or hint is appreciated! Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

From $-\log(1-t)=\sum^\infty_{n=1}\frac{t^n}{n}$, $|t|<1$, it follows that $$-\log(1-t)\geq \sum^n_{k=1}\frac{t^k}{k},\qquad 0\leq t<1$$ On the other hand $$-\log(1-t)=\sum^n_{k=1}\frac{t^k}{k} + \sum^\infty_{k=n+1}\frac{t^k}{k}\leq\sum^n_{k=1}\frac{t^k}{k}+\frac{1}{n+1}\frac{t^{n+1}}{1-t}, \qquad 0\leq t<1$$ Thus, for $0\leq t<1$ $$\sum^n_{k=1}\frac{t^{k-1}}{k}\leq-\frac{\log(1-t)}{t}\leq\sum^n_{k=1}\frac{t^{k-1}}{k}+\frac{1}{n+1}\frac{t^n}{1-t} $$

There error $E_n$ made in the integration by using the $n$-th truncated Taylor polynomial is $$0\leq E_n\leq\frac{1}{n+1}\int^x_0\frac{t^n}{1-t}\,dt\leq\frac{1}{(n+1)^2}\frac{1}{1-x}x^{n+1} $$

This bound can also be obtained directly from the expression $$Li_2(x):=-\int^x_0\frac{\log(1-t)}{t}\,dt=\sum^\infty_{n=1}\frac{x^n}{n^2},\qquad |x|\leq1$$ Then, for $0\leq x<1$, $$\sum^n_{k=1}\frac{x^k}{k^2}\leq Li_2(x)<\sum^n_{k=1}\frac{x^k}{k^2}+\frac{1}{(n+1)^2(1-x)}x^{n+1} $$


With $n=20$ the error estimate $E_n<2.162527\cdot 10^{-9}$. Using a simple code (in double precision) yields $Li_2(.5)- \sum^{20}_{k=1}(.5)^k / k^2\approx 1.99156×10^{-9}$

With $n=40$ the error estimate $E_n<5.410438\cdot 10^{-16}$. My simple code yielded $Li_2(.5)- \sum^{40}_{k=1}(.5)^k / k^2\approx 6.66134×10^{-16}$, this means that some numerical error is creeping in.

This discrepancy starts at $n=38$, where the estimated bound to the error $E_n<2.391834\cdot10^{-15}$ but (in my code) $Li_2(.5)- \sum^{38}_{k=1}(.5)^k / k^2\approx 2.44249\cdot 10^{-15}$