POV-Ray : Newsgroups : povray.advanced-users : Gauss-Laguerre quadrature Server Time12 Aug 2024 21:46:56 EDT (-0400)
 Gauss-Laguerre quadrature (Message 1 to 1 of 1)
 From: Bald Eagle Subject: Gauss-Laguerre quadrature Date: 25 Jul 2024 20:30:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.66a2ecec4ab7f2f1f9dae3025979125%40news.povray.org",
"dateCreated": "2024-07-26T00:30:00+00:00",
"datePublished": "2024-07-26T00:30:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
I somehow got off on a tangent graphing some orthogonal polynomials, and then
went the rest of the way and implemented the Gauss-Laguerre integration method.

Amazingly, it "works", and I get a ballpark answer for all of the equations that
I've found exact answers for the integrations - however I feel like I ought to
be getting far more accurate answers.  Like, to 6 decimal places or more.

https://thoughts-on-coding.com/2019/04/25/numerical-methods-in-cpp-part-2-gauss-legendre-integration/

Using Laguerre polynomial level 5

Integral of (5/(pow(e, pi)-2)) * exp(2*_X) * cos(_X) dx      from: [0.000] to:
[1.571]      = 0.9914612      Actual answer = 1.0000000

Integral of pow(x,2) + 1 dx      from: [0.000] to: [2.000]      = 4.6207326

Integral of pow(x,2) + pow(x,-2) dx      from: [1.000] to: [2.000]      =

Integral of 6*pow(x,2) - 5*x + 2 dx      from: [-3.000] to: [1.000]      =

Integral of sqrt (x) * (x-2) dx      from: [4.000] to: [0.000]      = -2.0968530

Integral of (2*pow(x,5) - x + 3) / pow(x,2) dx      from: [1.000] to: [2.000]
= 8.2261864      Actual answer = 8.3068528

Integral of 4*x - 6*pow(pow(x,2), 1/3) dx      from: [0.000] to: [1.000]      =

Integral of 2*sin(x) - 5*cos(x) dx      from: [0.000] to: [1.047]      =

Integral of 3/exp(-x) - 1/3*x dx      from: [-20.000] to: [-1.000]      =

Integral of abs(3x-5) dx      from: [0.000] to: [3.000]      = 6.7223530

Integral of 4*pow(x,4) - pow(x,2) + 1 dx      from: [-2.000] to: [2.000]      =
```

Attachments:

Preview of image 'laguerrepolynomials.png'