Post Reply 
[VA] SRC #008 - 2021 is here !
01-04-2021, 03:00 PM
Post: #9
RE: [VA] SRC #008 - 2021 is here !
Code:


For #2, it seems constant 2.021 can be changed, and still gives same integral result.
Why ?



Let k = 2.021, c = 2^(-1/k)

I = ∫ [(ln(|sin(x)|^k/2 + |cos(x)+c*sin(x)|^k) / (k*sin(x)*cos(x))] dx  , x = 0 .. pi

Let y=pi/2-x, dy=-dx:  sin → cos, cos → sin:

I = ∫ [(ln(|cos(y)|^k/2 + |sin(y)+c*cos(y)|^k) / (k*sin(y)*cos(y))] dy  , y = -pi/2 .. pi/2
  = ∫ f(y) dy            , y = -pi/2 .. pi/2
  = ∫ [f(y) + f(-y)] dy  , y = 0 .. pi/2

          |cos(y)|^k/2 + |sin(y)+c*cos(y)|^k        sec(y)^2
I = ∫ ln(------------------------------------) × (------------) dy  , y = 0 .. pi/2
          |cos(y)|^k/2 + |sin(y)-c*cos(y)|^k       k * tan(y)

          1/2 + |t+c|^k       1 + t^2
  = ∫ ln(---------------) × (---------) dy  , where t = tan(y)      , y = 0 .. pi/2
          1/2 + |t-c|^k        k * t

For HP-71B INTEGRAL command, it preferred smooth curve.
So, we split the integral into 2 parts, when |t-c| = 0, or x = atan(c)

10 INPUT "K? ";K @ C=2^(-1/K) @ P=.0000000001
20 DEF FNT(T)=LN((.5+ABS(T+C)^K)/(.5+ABS(T-C)^K))*(1/T+T)
30 T=TIME @ S=ATAN(C)
40 S1=INTEGRAL(0,S,P,FNT(TAN(IVAR)))/K
50 S2=INTEGRAL(S,PI/2,P,FNT(TAN(IVAR)))/K
60 DISP S1;"+";S2;"=";S1+S2,TIME-T

>RUN
k? 2.021
 .936151026289 + 1.53125007399 = 2.46740110028                  .44
>RUN
k? 1
 1.0306547334 + 1.43674636688 = 2.46740110028                   .55
>RUN
k? 2
 .937458075515 + 1.52994302478 = 2.4674011003                   .44
>RUN
k? 3
 .891862933413 + 1.57553816686 = 2.46740110027                  .66
>PI*PI/4
 2.46740110027
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-02-2021, 01:49 AM
RE: [VA] SRC #008 - 2021 is here ! - robve - 01-03-2021, 06:33 PM
RE: [VA] SRC #008 - 2021 is here ! - robve - 01-05-2021, 03:39 AM
RE: [VA] SRC #008 - 2021 is here ! - Albert Chan - 01-04-2021 03:00 PM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-04-2021, 05:56 PM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-04-2021, 07:24 PM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-06-2021, 02:54 PM
RE: [VA] SRC #008 - 2021 is here ! - EdS2 - 01-08-2021, 01:32 PM



User(s) browsing this thread: 1 Guest(s)