# Tag Info

5

There is no need for numerical computation here. First, $T(q)$ is a well-known function, the logarithmic integral. Repeated integration by parts gives an asymptotic expansion $$\mathrm{Li}(q) = \frac{q}{\log q}\sum_{k=0}^{K-1} \frac{k!}{\log^k q} + O\left(\frac{q}{\log^{K+1}q}\right).$$ There's also a fairly rapidly convergent representation due to ...

4

You write $S(q)$ and $T(q)$ as integrals, but it is easier to think of them as solutions of ODEs: $$S'(q) = \sin^2\left(\frac{π\Gamma(q)}{2q}\right)$$ with initial conditions $$S(2) = 0,$$ and similarly for $T(q)$. You can then use any of the common ODE integrators in matlab, mathematica, maple, ..., to solve and plot the solutions so that you can ...

3

The only chance you stand to deal with this problem from a numerical perspective is oscillatory integration methods. Filon/Levin-type methods can sometimes handle problems like this, particularly when they are of $\sin$ or $\cos$ type, though the $\Gamma$ function and its run-away growth may be prohibitive for the $q$ you are hoping for. In any case, I was ...

1

The reason you didn't find 2D quadrature is that we haven't implemented it yet. As to your compilation failure, this does the trick: #include <boost/math/quadrature/gauss_kronrod.hpp> #include <iostream> int main(int argc, char *argv[]) { using namespace boost::math::quadrature; auto f1 = [](double t, double s) { return std::exp(-(t*t+...

2

There's a closed form solution. For $a,b,c,d,x_0 > 0$, $$\int_{x_0}^\infty \frac{dx}{x\sqrt{(a+bx)(c+dx)}} = \\ \frac{\log(2 \sqrt{b d (a + b/x_0) (c + d/x_0)} + a d + b c + 2 b d/x_0) - \log(2 \sqrt{b d a c} + a d + b c)}{\sqrt{b d}}$$ a <- 1 b <- 644.153 c <- 4.17e-5 d <- 0.145 x <- 1/1095 (log(2*sqrt(b*d*(a+b*x)*(c+d*x)) + a*d + b*c + ...

1

I think that you don't need a change of variable (yourself) for this problem. Quadpack seems to work just fine for it. It uses a Gauss-Kronrod quadrature. I tried it (in Python) and it seems to work. import numpy as np from scipy.integrate import quad fun = lambda x: 1/(x*np.sqrt((x + 644.153)*(4.15e-5*x + 0.145))) inte, err = quad(fun, 1095, np.inf) ...

4

You are almost there, just put $t$ under the square root, and it will become $\displaystyle\int_0^{1/1095} {\frac{dt}{\sqrt{(1+644.153t)(4.17 \cdot 10^{-5} + 0.145 t)}}},$ which eliminates the singularity at $t=0$

Top 50 recent answers are included