How Many Digits of an Integral can be Accurately Computed?

102 Views Asked by At

Assuming $I$ is an integral, and we want to approximate $I$ with numerical integration, if the question asks you 'how many digits of $I$ can you accurately compute', how can you calculate that?

Is the result of $|\text{abs}_{\text{err}} - \text{approx}_{\text{err}}|$ the number of accurate digits?

Edit

Here's the original question

enter image description here enter image description here

2

There are 2 best solutions below

0
On

The question is essentially asking how accurately can you approximate your given integral with

$$\int_\epsilon^1\frac{\sin(\ln(x)/x)}x~\mathrm dx$$

for $\epsilon>0$. An analysis of this may be done by substituting $u=-\ln(x)$ i.e. $x=e^{-u}$ to get

$$-\int_0^{-\ln(\epsilon)}\sin(ue^u)~\mathrm du$$

Notice the relation to $b_i$: they are where $\sin(ue^u)$ changes sign. Taking advantage of this, rewrite the integral as

$$-\sum_{i=0}^n\int_{b_i}^{b_{i+1}}\sin(ue^u)~\mathrm du$$

This gives us an alternating sum whose terms are eventually monotonically decreasing in magnitude, so the error between this and the original integral is bounded above by the magnitude of the first omitted term:

$$|I-Q_n|\le\int_{b_{n+1}}^{b_{n+2}}|\sin(ue^u)|~\mathrm du\le\int_{b_{n+1}}^{b_{n+2}}1~\mathrm du=b_{n+2}-b_{n+1}$$

And so the question essentially boils down to how far apart are consecutive $b_n$? The definition of $b_n$ is given as:

$$b_n\exp(b_n)=n\pi$$

which means we have

$$b_n=W(\pi n)$$

where $W$ is the Lambert W function. Knowing how this function really works is not so important though, since we can see from the definition that we should have for large $b_n$

$$\exp(b_n)=\frac{n\pi}{b_n}\Rightarrow b_n=\ln(n\pi)-\ln(b_n)$$

which provides an easy way to compute $b_n$ using fixed-point iteration, with initial value $b_n\approx\ln(n\pi)$.

For example, with $n=500$, we have

$b_{501}\approx\ln(501\pi)\approx7.361$

$b_{501}\approx\ln(501\pi)-\ln(7.361)\approx5.365$

$b_{501}\approx\ln(501\pi)-\ln(5.365)\approx5.681$

Spamming my calculator with this will quickly give $b_{501}\approx5.632739987$. Similarly we have $b_{502}\approx5.634433411$.

Hence, we have

$$|I-Q_{500}|\le0.001693424$$

and since $Q_{500}\approx-0.4588$ we know that $Q_{500}$ approximates $I$ accurately to 2 significant digits.

0
On

Starting from Simply Beautiful Art's answer, just as he/she did, we need to consider the asymptotic behavior of $$\Delta_n=b_{n+1}-b_n=W((n+1)\pi)-W(n \pi)$$ Here is given a series expansion of $W(t)$ for large values of $t$ $$W(t)=L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}+\cdots$$ where $L_1=\log(t)$ and $L_2=\log(L_1)$.

Using it and limiting to the first term $$\Delta_n \sim \frac 1 n \left(1- \frac 1 {\log(n\pi)} \right)$$ which gives almost the same result.