1
$\begingroup$

Any tips for evaluating the integral

$$ I_{2n} = \frac{\pi}{2} \int_{-\infty}^\infty \int_{-\infty}^\infty \: \text{sech}(\pi x) \text{sech}(\pi y)\tanh^{2n}(\pi(x-y)) \: \text{d}x \text{d}y? $$

in a numerical but precise fashion? In particular, I'm interested in guessing the exact answer from the resultant decimal expression. Here's the current attempt ($2n = 8$):

exp = NIntegrate[1/2 π Sech[π x] Sech[π y] Tanh[π(x-y)]^8,       
    {x, -∞, ∞}, {y, -∞, ∞}, 
    PrecisionGoal -> 10];

Rationalize[exp, 10^-5]

Mathematica can easily do $2n =4,6$ with NIntegrate, but begins to run into problems for $2n = 8,10$ (values of interest). I've played around with various settings, but none seem to help.

$\endgroup$
6
  • $\begingroup$ Those dx and dy should be on the end. $\endgroup$
    – bobbym
    Feb 5, 2017 at 6:12
  • $\begingroup$ The code has been added. $\endgroup$
    – Ultima
    Feb 5, 2017 at 6:14
  • $\begingroup$ Your current run is working properly and produces 149/219. $\endgroup$
    – zhk
    Feb 5, 2017 at 6:20
  • $\begingroup$ Just remove , PrecisionGoal you will get 47/74 in the case 2n=10. $\endgroup$
    – zhk
    Feb 5, 2017 at 6:25
  • 5
    $\begingroup$ I'm voting to close this question as off-topic because I cannot reproduce the problem the user is experiencing $\endgroup$
    – m_goldberg
    Feb 5, 2017 at 8:29

1 Answer 1

1
$\begingroup$

There doesn't seem to be any problem. The integral seems to be well-behaved.

int[n_] :=
  NIntegrate[
    1/2 π Sech[π x] Sech[π y] Tanh[π (x - y)]^(2 n), {x, -∞, ∞}, {y, -∞, ∞}]]
vals = Table[int[n], {n, 6}]

{1., 0.833333, 0.741667, 0.680357, 0.635144, 0.599776}

vals = Table[int[n], {n, 6}]
ListPlot[vals]

plot

These results obtained running V11.0.1 on OS X 10.10.2

$\endgroup$
2
  • $\begingroup$ Is the Block necessary? NIntegrate already localises x and y $\endgroup$ Feb 5, 2017 at 11:54
  • $\begingroup$ @SimonWoods. I forgot that. $\endgroup$
    – m_goldberg
    Feb 5, 2017 at 16:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.