HP Forums
Integral CAS approximation - 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: Integral CAS approximation (/thread-16853.html)



Integral CAS approximation - lrdheat - 05-01-2021 08:25 PM

Curious concerning why the disagreement in approximation of an integral in CAS vs the same integral in HOME. When an exact integration is impossible for a function, should HOME be trusted to bring more accuracy? I was expecting an approximation in CAS would force a HOME type numerical approximation.

CAS approximation of integral from -1 to 1 of SQRT(1+x^3) produces 1.95275719206

In home, I get 1.95275723373 which I get on the WP 34S on a DM42 platform and 1.952757234 on a CASIO 9750GIII.


RE: Integral CAS approximation - lrdheat - 05-01-2021 08:26 PM

This on the beta April 28...


RE: Integral CAS approximation - robmio - 05-02-2021 05:51 AM

You get identical results in both "HOME" and "CAS" if you use the extremes -1.0 and 1.0, instead of -1 and 1 (note the absence of the dot after -1 and 1). The same curious behavior can be found in "xCas" version 1.7


RE: Integral CAS approximation - parisse - 05-02-2021 06:30 AM

HOME is using CAS for integral evaluation, but without trying an exact computation first (in other words it will call integrate(sqrt(1+x^3),x,-1.0,1.0)).
If you run integrate(sqrt(1+x^3),x,-1,1) in CAS, you get the initial integral expressed with other integrals because the CAS tried to get an exact answer, and this explains the small numeric differences, the general rule is that the precision is better without initial symbolic step (if the integral can not be expressed in closed form).


RE: Integral CAS approximation - Albert Chan - 05-02-2021 02:35 PM

On HP emulator, integration seems work harder if we use pattern ∫(f(x), x= a .. b)

We integrate ∫(√(1+x^3), x= -1 .. 1) backwards (*), letting t = -x

Cas> expand(∫(√(1-t^3), t, -1, 1))

√2*2*1/5 + integrate(3/5/√(-t^3+1),t,-1,1)

Cas> float(Ans)       → 1.95275719206

Cas> expand(∫(√(1-t^3), t = -1 .. 1))

√2*2*1/5 + 1/5*√π*Gamma(1/3)/Gamma(5/6) + integrate(3/5/√(-t^3+1),t,-1,0)

Cas> float(Ans)       → 1.95275723373


(*) Cas knows ∫(√(1-t^3), t,0,1), but not its equivalent, ∫(√(1+x^3), x,-1,0)