HP Forums
Double integral fail, works on TI - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Double integral fail, works on TI (/thread-14753.html)



Double integral fail, works on TI - lrdheat - 04-01-2020 02:23 AM

I tried nInt(nInt((e^(-x*y))/sqrt(x^2_y^2),y,-x,x),x,0,1) on the physical G2 and the emulator on my iPad in home and CAS, and it tried a number of methods, all of which failed. This example came from the TI Nspire CX reference book for the non CAS (answer is ~3.30423). I tried it on my Nspire CAS emulator, and it came up with the result given in the book. The Prime solves a number of problems that are beyond the TI. Any idea on why the Prime stumbles with this type of double integral?


RE: Double integral fail, works on TI - lrdheat - 04-01-2020 02:25 AM

The sqrt portion should read x^2-y^2 (sorry).


RE: Double integral fail, works on TI - johnet123 - 04-01-2020 08:06 AM

I can't find the command, nInt. Did you mean, Int?


RE: Double integral fail, works on TI - CyberAngel - 04-01-2020 09:20 AM

(04-01-2020 08:06 AM)johnet123 Wrote:  I can't find the command, nInt. Did you mean, Int?

numerical Integration
– –
VPN


RE: Double integral fail, works on TI - roadrunner - 04-01-2020 09:58 AM

Could it be because

∫(e^((-x)*y)/(x^2-y^2),y)

returns

(Ei(-x^2-x*y)*(e^x^2)^2-Ei(x^2-x*y))/(2*x*e^x^2)

replacing y with x or -x results in Ei(0) which equals -infinity?


RE: Double integral fail, works on TI - froehlic - 04-01-2020 01:44 PM

Interesting. My virtual prime gives the correct result. Needed a long time, so I pressed enter too much…

Not yet tried on the physical device. Firmware ist actual.


RE: Double integral fail, works on TI - lrdheat - 04-01-2020 05:29 PM

Yeah, I gave the emulator a bit of time, but incorrectly concluded that it would not solve it, and gave up...


RE: Double integral fail, works on TI - Albert Chan - 04-01-2020 09:20 PM

Let y = x sin(t), dy/dt = x cos(t) = √(x² - y²)

\(\large I = \int_0^1 \int _{-x}^x {e^{-x y} \over \sqrt{x^2-y^2}}\;dy\;dx
= \int_0^1 \int _{-\pi/2}^{\pi/2} e^{-x^2 \sin t}\;dt\;dx \)

If w is odd function, taylor series of e^w with odd powers are also odd. Thus, only even powers remained.

\(\large I = \int_0^1 \int _{-\pi/2}^{\pi/2} \cosh(x^2 \sin t)\;dt\;dx
= 2 \int_0^1 \int _0^{\pi/2} \cosh(x^2 \sin t)\;dt\;dx \)

For even power terms, we can use this
Quote:\(\large \int _{-\pi \over 2} ^{\pi \over 2} (\sin x)^{2n} \;dx = \binom{2n}{n}\pi / 2^{2n} \)

\(\large I
= \int_0^1 \sum_{k=0}^{∞} \left({\binom{2k}{k}\pi \over 2^{2k} (2k)!} \right) x^{4k}\;dx
= \sum_{k=0}^{∞} {\pi \over 2^{2k} (k!)^2 (4k+1)}
\) ≈ 3.30423259121


RE: Double integral fail, works on TI - parisse - 04-02-2020 12:33 PM

The default accuracy of the Prime prevents computation, because the inner integrand is singular at y=x and y=-x. If you set epsilon:=1e-6, you will get an answer
epsilon:=1e-6;
f:=exp(-x*y)/sqrt(x^2-y^2);
int(int(f,y,-x,x),x=0.0..1.0)
-> 3.30422650539
Of course precision is less than 1e-6!


RE: Double integral fail, works on TI - CyberAngel - 04-02-2020 12:46 PM

(04-02-2020 12:33 PM)parisse Wrote:  The default accuracy of the Prime prevents computation, because the inner integrand is singular at y=x and y=-x. If you set epsilon:=1e-6, you will get an answer
epsilon:=1e-6;
f:=exp(-x*y)/sqrt(x^2-y^2);
int(int(f,y,-x,x),x=0.0..1.0)
-> 3.30422650539
Of course precision is less than 1e-6!

I quickly tested this (1E-6, 1E-7) and 1E-8 gives interesting warnings on my Android Emu.
– –
VPN