Which is best package for integration(and differentiation)?

I’m new in Julia and have no idea of which are good packages for integration. I have checked juliapackages and observer, but everything is explained on a math level far above mine.
Thank you for your advice.

Quadrature.jl is a wrapper to all of the packages, so that should make it easy to play with them.

It also has some niceties like automatic differentiation overloads.

1 Like

Thank you.
One question if you don’t mind, Could you explain what is quadrature method?
From what I have seen it’s one of the methods of numerical integration.

Quadrature is just the name for numerical integration methods.

I’ve been happy with

It is, as the name of the package indicates, specialized. Gaussian quadratures is, IMHO, the best choice for general integration over intervals. If you want to integrate over sets in higher dimension or need Monte Carlo integration, best to look elsewhere.

2 Likes

Two problems: (1) in general you know your error tolerance, but not the corresponding order of the quadrature scheme, and (2) in general your integrand might have some localized bad behavior (e.g. a sharp peak or an endpoint singularity). These issues make adaptive quadrature (e.g. QuadGK.jl) a better default choice in my opinion than a fixed-order Gaussian quadrature rule.

Specialized Gaussian-quadrature schemes are fantastic when you know more about your integrand, however, especially if you are integrating many similar functions. Especially if your integrands have a known bad behavior that you can factor out with a custom weight function.

Historically, “quadrature” was just a synonym for “integration”. Nowadays, it is used almost exclusively in the context of numerical integration, where a “quadrature method” refers to an algorithm for numerical integration — a “quadrature rule” refers to a specific approximation of an integral by a sum (a set of “quadrature points” where you evaluate the integrand and “quadrature weights” by which you multiply each integrand value in the sum).

11 Likes

If integrating smooth, well behaved and friendly functions in one dimension, the goto is QuadGK.jl .

1 Like