Post Reply 
Infinite Integrals by Gaussian Quadrature
12-19-2022, 08:11 PM
Post: #4
RE: Infinite Integrals by Gaussian Quadrature
I figured out how the numbers are derived. The trick is *no* transformation!
Again, we assume a=0, then later put back a (if needed)

Assume f is a quintic polynomial, we solved for integral exact solution.

XCas> P(x) := horner([A,B,C,D,E,F],x) // quintic polynomial
XCas> R := int(e^-x * P(x), x=0 .. inf)

120*A + 24*B + 6*C + 2*D + E+F

XCas> M := w1*P(z1) + w2*P(z2) + w3*P(z3) - R

If weights/points correctly picked, M=0, for any P coefficients.
For simplicity, we use identity matrix for P coefficients.

XCas> M := normal([
M(A=1,B=0,C=0,D=0,E=0,F=0),
M(A=0,B=1,C=0,D=0,E=0,F=0),
M(A=0,B=0,C=1,D=0,E=0,F=0),
M(A=0,B=0,C=0,D=1,E=0,F=0),
M(A=0,B=0,C=0,D=0,E=1,F=0),
M(A=0,B=0,C=0,D=0,E=0,F=1)
])

XCas> transpose(M)

\(\left(\begin{array}{c}-120+w_{1} z_{1}^{5}+w_{2} z_{2}^{5}+w_{3} z_{3}^{5}\\-24+w_{1} z_{1}^{4}+w_{2} z_{2}^{4}+w_{3} z_{3}^{4}\\-6+w_{1} z_{1}^{3}+w_{2} z_{2}^{3}+w_{3} z_{3}^{3}\\-2+w_{1} z_{1}^{2}+w_{2} z_{2}^{2}+w_{3} z_{3}^{2}\\-1+w_{1} z_{1}+w_{2} z_{2}+w_{3} z_{3}\\-1+w_{1}+w_{2}+w_{3}\end{array}\right)\)

Last equation, we have sum of weights = 1, matching OP
6 equations, 6 unknown, using previous post numbers as guess.

XCas> fsolve(M=0,[w1,z1, w2,z2, w3,z3] = [0.311,0.127, 0.654,1.00, 0.00833,7.87], [w1,z1, w2,z2, w3,z3])

[0.278517733569, 2.29428036028,
 0.711093009929, 0.415774556783,
 0.0103892565016, 6.28994508294]

Weights/Points now match OP (in different orders, but that's OK) Smile
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 08:11 PM



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