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.
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
andn.choose(k)
were added to the Numeric mixin.