HP Forums

Full Version: Double integral fail, works on TI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
The sqrt portion should read x^2-y^2 (sorry).
I can't find the command, nInt. Did you mean, Int?
(04-01-2020 08:06 AM)johnet123 Wrote: [ -> ]I can't find the command, nInt. Did you mean, Int?

numerical Integration
– –
VPN
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?
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.
Yeah, I gave the emulator a bit of time, but incorrectly concluded that it would not solve it, and gave up...
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
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!
(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
Reference URL's