# Numerical calculation of Integral of Si(x)/x

I'm interested in evaluating

$$\begin{equation} \int_0^x \frac{Si(t)}{t}\;dt \end{equation}$$

Where

$$\begin{equation} Si(x) = \int_0^x \frac{\sin t}{t}\;dt \end{equation}$$

I've found a nice method for evaluating $$Si(x)$$ using Pade and Chebyshev-Pade approximations in https://arxiv.org/pdf/1407.7676.pdf but I'm unable to find an existing equivalent method of the integral above.

I can probably derive the small $$x$$ Pade approximation without too much difficulty, as the integral has a relatively simple Taylor series expansion, but I'm unsure how to approach the large $$x$$ part.

Does anyone have a reference for calculatin such an integral? Or even a good reference for deriving the large $$x$$ Chebyshev-Pade approximation for a similar integral?

• Have you seen this question and answer? I think your integral falls into the same category, especially the second answer. – Bort Aug 12 at 11:33
• @Bort That's a neat answer, but I think its geared towards infinite integrals, rather than definite integrals. If you can see a way to adapt it to this case, I'd love a pointer. – Michael Anderson Aug 13 at 2:52

For large $$x$$, you can use the same approach as the one in the paper you cite. They define these auxiliary functions that link $$\mathrm{Si},\mathrm{Ci}$$ with $$\sin,\cos$$, and the point of why this works is that the relationship between these two pairs of functions is in general a $$2\times 2$$ matrix, but this matrix only has two independent functions in its components.
Using Mathematica (code gist), I computed the same auxiliary functions for your case. The integral you give is $$\mathrm{Si}(x)\log x - \int_0^x t^{-1}\sin t\log t\,\mathrm{d}t.$$ Consider the four integrals $$\int_x^\infty t^{-1}\big( \sin t, \cos t, \sin t\log t, \cos t\log t \big)\,\mathrm{d}t.$$ These are equal to $$\begin{gathered} f_1 \cos x + f_2\sin x,\\ f_2\cos x - f_1\sin x,\\ -f_3\cos x+f_1\cos x\log x+f_4\sin x+f_2\sin x\log x,\\ -f_4\cos x+f_2\cos x\log x-f_3\sin x-f_1\sin x\log x. \end{gathered}$$ To compute this, I applied integration by parts to each integral up to order $$O(x^{-10})$$, and then read off the coefficients of $$(\cos x,\sin x,\cos x\log x,\sin x\log x)$$, which are the auxiliary functions. The power series for them are: \begin{aligned} f_1 &= \frac{1}{x} - \frac{2}{x^3} + \frac{24}{x^5} - \frac{720}{x^7} + \frac{40320}{x^9}+\cdots,\\ f_2 &= \frac{1}{x^2} - \frac{6}{x^4} + \frac{120}{x^6} - \frac{5040}{x^8} + \frac{362880}{x^{10}} - \cdots,\\ f_3 &= \frac{3}{x^3} - \frac{50}{x^5} + \frac{1764}{x^7} - \frac{109584}{x^9}+\cdots,\\ f_4 &= \frac{1}{x^2} - \frac{11}{x^4} + \frac{274}{x^6} - \frac{13068}{x^8} + \frac{1026576}{x^{10}}-\cdots. \end{aligned} Here $$f_1,f_2$$ should be equal to $$f,g$$ in the paper. To find closed forms for $$f_{3,4}$$, they are the $$(\Im,-\Re)$$ parts of the integral $$\int_x^\infty t^{-1}\log(t/x)e^{\mathrm{i}(t-x)}\,\mathrm{d}t,$$ change the contour of integration to $$(x,x+\mathrm{i}\infty)$$ and use $$t=x(1+\mathrm{i}v)$$. Then $$f_3 = \int_0^\infty \frac{\frac12 \log(1+v^2) + v\arctan v}{1+v^2}e^{-v x}\,\mathrm{d}v,\\ f_4 = \int_0^\infty \frac{-\frac12 v \log(1+v^2) + \arctan v}{1+v^2}e^{-v x}\,\mathrm{d}v,$$ which are easy to evaluate numerically.
Because there is a one-to-one mapping between the $$f$$'s and the four integrals (a system of four linear equations in $$f$$'s for each value of $$x$$), this is enough information to numerically compute the Pade approximations of the auxiliary functions $$f_{1,2,3,4}$$ just like they do in the paper.
• Since you are using Mathematica, don't you think it's a little weird that, in Mathematica, Integrate[SinIntegral[z]/z, {z, 0, a}] shows an exact result in terms of HypergeometricPFQ? – David Aug 15 at 4:23
• Worth noting the coefficients of f1, f2 are just pulled alternatively from n!, and those for f3,f4 look like they come from oeis.org/A000254, which can be generated by : $a_{n+1} =(n+1)*a_n+n!$. – Michael Anderson Aug 15 at 5:04
• @David From a numerical perspective there's a problem with using hypergeometric functions. It is a very general class of functions, encompassing pretty much all the standard ones (dlmf.nist.gov/15), and as a result it is very hard to compute accurately, requiring a combination of different approaches chosen depending on the argument and the parameters (dlmf.nist.gov/15.19; mpmath.org/doc/current/functions/hypergeometric.html). $\mathrm{Si}(x)$ can also be expressed terms of hypergeometrics (dlmf.nist.gov/6.11), but it's computed as in dlmf.nist.gov/6.18. – Kirill Aug 15 at 12:20