mike-bourgeous / mb-math

Mathematical functions shared by mb-sound, mb-geometry, and other personal projects
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Add a complex triangle (csc_int_int), polylogarithm, zeta, etc. #5

Closed mike-bourgeous closed 3 years ago

mike-bourgeous commented 3 years ago

This PR centers around implementing something analogous to the second antiderivative of the cosecant function, which gives the analytic form of a triangle wave. This was discovered through trial and error, looking at derivatives of the FFT-derived analytic form of a square and triangle wave.

Initially a closed form of the integral was obtained from both Sage/Maxima. I tried using Taylor series but they diverge too quickly, and settled on a lookup table. Check experiments/ for scripts I wrote to generate these. The closed form was also implemented, which required implementing the Riemann zeta function, the polylogarithm function, and some others.

Also, n.factorial and n.choose(k) were added to the Numeric mixin.