04-09-2021, 05:17 AM (This post was last modified: 04-09-2021 05:18 AM by Gamo.)
Post: #1 Gamo Senior Member Posts: 712 Joined: Dec 2016
Recently I try this program called 16-Point Gaussian Quadrature found
in the HP-11C Solutions Handbook on page 30

So this program do the Integration problem. I have try diffrent problem
and the answer come out very well except one.

This one doesn't give enough accuracy when compare to the
Integration Function on the HP-15C

Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

On the HP-11C and HP-15 Equation is

[X²]  [X<>] [-] [√]

So is program provided on the HP-11C Solutions Book only give three
decimal place accuracy or it only happen to certain problem.

Gamo
04-09-2021, 11:53 AM (This post was last modified: 04-09-2021 01:13 PM by robve.)
Post: #2
 robve Senior Member Posts: 304 Joined: Sep 2020
(04-09-2021 05:17 AM)Gamo Wrote:  Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

On the HP-11C and HP-15 Equation is

[X²]  [X<>] [-] [√]

This looks right and not bad for 16 points. 16 points will only give you a (rough) approximation of $$\int_0^2 \sqrt{4-x^2}\,dx$$.

Gausss 10 point: 3.14209916979661
Gauss Kronrod 21 point: 3.14161975053083

By comparison (edited to add more examples):

Romberg 524289 points (1e-9 error threshold) gives 3.14159265256818
Romberg 16385 points (1e-7 error threshold) gives 3.14159265256818
Tanh-Sinh 56 points (1e-9 error threshold) gives 3.14159265358672
Tanh-Sinh 30 points (1e-7 error threshold) gives 3.14159265358975
Adaptive Simpson 417 points (1e-9 error threshold) gives 3.14159111522653
Adaptive Simpson 153 points (1e-7 error threshold) gives 3.14159111489381

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
04-09-2021, 04:41 PM
Post: #3
 Albert Chan Senior Member Posts: 1,890 Joined: Jul 2018
(04-09-2021 05:17 AM)Gamo Wrote:  Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

Both Gaussian and Romberg quadrature are based on fitting the curve to polynomial.
When X ≈ 2, the curve fall off a cliff, which is hard to curve fit by polynomial.

HP-15C does a u-substitution, which in this case, removed the cliff entirely.

int(√(4-x^2), x=0..2.)
= int(4*√(1-x^2), x=0..1.)
= int(24*u*(1-u) * √(1 - (u*u*(3-2*u))^2), u = 0..1.)

Try this u-transformed function, 16-points should converge to pi pretty good.

---

Another way is to avoid the cliff.

y = √(4-x²), x≥0 ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → x = √(4-y²)

Note the x/y symmetry, instead of integrating from 0 to 2, we can do 0 to √2
With limit = [0,√2], doubled the result over-counted by a square, area = (√2)² = 2

int(√(4-x^2), x=0..2.) = int(√(4-x^2), x=0..√(2.)) * 2 - 2
04-10-2021, 02:54 AM
Post: #4 Gamo Senior Member Posts: 712 Joined: Dec 2016
The HP-15C Integration Function is excellent.

great integration function in the Advance Functions Handbook.

Gamo
04-10-2021, 03:50 PM
Post: #5
 Wes Loewer Senior Member Posts: 383 Joined: Jan 2014