Post Reply 
Infinite Integrals by Gaussian Quadrature
12-19-2022, 02:22 PM
Post: #3
RE: Infinite Integrals by Gaussian Quadrature
2nd attempt, points and weights are closer.
We assume a=0, then later put back a.

Let x=(1-y)/(1+y), y=[-1 ..1] map to x = [inf .. 0]
Trivia: inverse has same shape, y=(1-x)/(1+x)

XCas> Int(e^-x * f(x), x, 0, inf) (x=(1-y)/(1+y))

\(\displaystyle \int _{-1}^{1}
\frac{2 \exp \left(- \frac{1-y}{1+y}\right)\;f\left(\frac{1-y}{1+y}\right)}
{\left(1+y\right)^{2}}\,dy\)

Add back a, we have:

\(\displaystyle \int _{a}^{\infty} e^{-x}\,f(x)\,dx = e^{-a}\;\int _{-1}^{1}
\frac{2 \exp \left(- \frac{1-y}{1+y}\right)\;f\left(\frac{1-y}{1+y} + a\right)}
{\left(1+y\right)^{2}}\,dy\)

With 3 points Gaussian quadrature, we have:

e^-a * Σ(( w_i * f(z_i + a)) for i=1 to 3)

where

w_1 = 0.310738836
z_1 = 0.1270166538

w_2 = 0.6540078954
z_2 = 1.0

w_3 = 0.008329973286
z_3 = 7.872983346

Numbers strongly depends on how infinite intervals is mapped to [-1, 1]
For OP examples, above numbers are still not as good. (but, perhaps good for others?)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Infinite Integrals by Gaussian Quadrature - Albert Chan - 12-19-2022 02:22 PM



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