0
$\begingroup$

I am interested in understanding the growth of the following function for $n\geq 2$ $$I(n) = \int_{0}^{1/2}\frac{ds}{s^{1-1/n}+(1-s)^{1-1/n}-1}.$$

I can explicitly compute $I(n)$ for various values of $n$ using NIntegrate

phi[n_, s_] = s^(1 - 1/n) + (1 - s)^(1 - 1/n) - 1;
NIntegrate[1/phi[2, s], {s, 0, 1/2}]

but I would like to plot this on a graph for integer values $2\leq n\leq 100$ however I am not sure how to do this in Mathematica. Any suggestions will be much appreciated.

$\endgroup$
3
  • 1
    $\begingroup$ Do you mean something like: phi[n_, s_] := s^(1 - 1/n) + (1 - s)^(1 - 1/n) - 1; i[n_] := NIntegrate[1/phi[n, s], {s, 0, 1/2}]; ListPlot[Table[{n, i[n]}, {n, 2, 200}]]? Note, however, that there are precision issues for $n\geq 8$. $\endgroup$
    – Domen
    Jul 25 at 12:50
  • 3
    $\begingroup$ To avoid messages use phi[n_, s_] := s^(1 - 1/n) + (1 - s)^(1 - 1/n) - 1; i[n_] := NIntegrate[1/phi[n, s], {s, 0, 1/2}, PrecisionGoal -> 2, AccuracyGoal -> 5] $\endgroup$ Jul 25 at 15:55
  • 2
    $\begingroup$ This gives an accurate table in 3.3 sec.: data = Table[NIntegrate[1/phi[n, s], {s, 0, 1/10, 1/2}, Method -> {"GlobalAdaptive", "SingularityHandler" -> {"IMT", "TuningParameters" -> 2}, "SingularityDepth" -> 2, "SymbolicProcessing" -> 0, Method -> {"GaussKronrodRule", "Points" -> 11}}, PrecisionGoal -> 6, WorkingPrecision -> 24], {n, 2, 200}]; $\endgroup$
    – Michael E2
    Jul 25 at 23:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.