Post Reply 
HP71B IBOUND fooled
05-21-2021, 07:17 PM (This post was last modified: 05-21-2021 10:46 PM by Albert Chan.)
Post: #1
HP71B IBOUND fooled
Here is an integral, from a very old (2006) thread: So your HP can INTEGRATE ...
Code:
       / Inf
I1 =   |     sin(x)*sin(x^2) .dx
       / 0
Solution from Valentin:
Code:
This is a very difficult integral to compute numerically to any decent accuracy ...
Fortunately, there's a nifty closed form for a generalized family of similar integrals, 
this being but one of the simplest cases, namely:

                  / A                             / A 
    I1 = (Cos(A)* |   Cos(x)/Sqrt(x).dx + Sin(A)* |   Sin(x)/Sqrt(x).dx )/2
                  / 0                             / 0  
where A=1/4 and both non-elementary integrals are particular cases of Fresnel functions.

I tried in emu71, and showed timing and IBOUND

>A=1/4 @ P=1E-12
>X1=COS(A) @ Y1=SIN(A)

>T=TIME @ X2=INTEG(0,A,P,COS(IX)/SQRT(IX))/2 @ TIME-T, IBOUND
40.58       -9.93754844068E-13
>T=TIME @ Y2=INTEG(0,A,P,SIN(IX)/SQRT(IX))/2 @ TIME-T, IBOUND
.11           8.2963337046E-14
>X2, Y2, X1*X2+Y1*Y2
.496880004382       4.14810242686E-2       .491695777984

X2 required much time to calculate. But, IBOUND numbers seems good ...

However, if we rewrite integral, letting x=t^2, dx=2t dt, we get different numbers.
(we might as well do Y2 too, to compare effect of x=t^2 substitution)

>T=TIME @ X2=INTEG(0,.5,P,COS(IX*IX)) @ TIME-T, IBOUND
.11           4.96884313442E-13
>T=TIME @ Y2=INTEG(0,.5,P,SIN(IX*IX)) @ TIME-T, IBOUND
.17           4.14807134341E-14
>X2, Y2, X1*X2+Y1*Y2
.496884029215       4.14810242685E-2       .491699677694

We get exact result (all 12 digits correct !), using much less time.

---

X2 (with sqrt denominator), after u-transformation, end-point is not zero !
INTEGRAL assumed zero endpoints (both side), thus bad results.

\(\displaystyle \int_0^{1\over4} {\cos(x)\over2\sqrt{x}} dx
= \int_0^1 {\cos(t/4)\over4\sqrt{t}} dt
= \int_0^1 {6u(1-u)\cos(u^2(3-2u)/4)\over4\sqrt{u^2(3-2u)}} du
= {\sqrt{3}\over2}\int_0^1 \left(1-{2u\over3}-{u^2\over6}\;-\;...\right) du
\)

However, u-transformed plot looks like a straight line !
IBOUND numbers were fooled, suggesting excellent estimate, which it isn't.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP71B IBOUND fooled - Albert Chan - 05-21-2021 07:17 PM
RE: HP71 IBOUND fooled - Albert Chan - 05-21-2021, 07:32 PM
RE: HP71B IBOUND fooled - Albert Chan - 05-21-2021, 09:38 PM
RE: HP71B IBOUND fooled - Albert Chan - 05-02-2022, 01:42 AM
RE: HP71B IBOUND fooled - Albert Chan - 05-02-2022, 02:57 PM
RE: HP71B IBOUND fooled - Albert Chan - 08-10-2022, 04:48 PM
RE: HP71B IBOUND fooled - Albert Chan - 08-10-2022, 06:01 PM
RE: HP71B IBOUND fooled - Albert Chan - 05-03-2022, 07:09 PM



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