Code:
Post #10, we transform I by using substitution: y = pi/2-x, dy = -dx
We can continue substitutions: t = tan(y), dt = (1+t^2) dy
This shift integration limit from y = 0 .. pi/2, to t = 0 .. infinity
One more substitution, t = (1-u)/u, dt = (-1/u^2) du
This shift back integration limit back to finite: u = 0 .. 1
This remove all use of trigonometric functions, or constant PI :)
10 INPUT "K? ";K @ C=2^(-1/K) @ P=.0000000001
20 DEF FNU(U)=LN((.5+ABS((1-U)/U+C)^K)/(.5+ABS((1-U)/U-C)^K))/(U*(1-U))
30 T=TIME @ S=1/(C+1)
40 S1=INTEGRAL(0,S,P,FNU(IVAR))/K
50 S2=INTEGRAL(S,1,P,FNU(IVAR))/K
60 DISP S1;"+";S2;"=";S1+S2,TIME-T
>RUN
k? 2.021
1.53125007397 + .936151026314 = 2.46740110028 .66
>RUN
k? 1
1.43674636688 + 1.03065473339 = 2.46740110027 .66
>RUN
k? 2
1.52994302476 + .937458075515 = 2.46740110028 .65
>RUN
k? 3
1.57553816687 + .891862933407 = 2.46740110028 .66
reference:
http://fmnt.info/blog/20180818_infinite-integrals.html