The py_Integrate spreadsheet, with associated Python code in pyScipy3.py, are included in the download file:
The spreadsheet and associated Python packages have had significant edits since the first post in this series, so please download the latest file.
Details of the required pyxll package (including download, free trial, and full documentation) can be found at: pyxll
For those installing a new copy of pyxll, a 10% discount on the first year’s fees is available using the coupon code “NEWTONEXCELBACH10”.
The py_Integrate spreadsheet links to the Scipy quadrature functions. In addition, a Python version of the VBA Quad_Tanh_Sinh function by Graham Dennes has been added. See Tanh-Sinh Quadrature v. 5.03 for details and download of the VBA version.
Three functions allow for integration of functions with one variable:

The Tanh-Sinh version works with either a string on the spreadsheet or a Python function:

The Scipy and Tanh-Sinh functions return near identical resuts:


For typical functions the Tanh-Sinh function is a little slower than the Scipy functions, since it is written entirely in uncompiled code, but for functions requiring a large number of iterations it can be faster:


The spreadsheet includes examples with trigonometric functions, with results accurate to machine precision:

There are also functions linking to the Scipy functions for double, triple, and multiple integration, with examples of each:

