I'm working on a project where I'm working with modulo functions. However, to continue, I need to integrate integral powers of a weighted sum of them (e.g of the form $\left(c+\operatorname{weighted sum} \right)^p$, with $c$ a real, positive constant, and $p \in \mathbb{Z}$). So, I first tried Fourier series. However, since the weights are pretty high, the errors blew up, and the amount of terms necessary to correct them are prohibitively high. So, I need another way to create the modulo functions.

This leads me to my question: just like the title says, is there some approximation of $a \operatorname{mod} \left(\frac xb,1 \right)$, $f(x)$ (with $a,b, \geq 1, \in \mathbb{R}$), that has an elementary, closed form antiderivative, has a scaling constant $N$ so that as $N \to \infty$, $|a \operatorname{mod} \left(\frac xb,1 \right)-f(x)| \to 0$ (hopefully $\sim \mathcal{O} \left(10^{-\operatorname{|poly(N)|}}\right)$, but not neccessary) at least on $\{ bk+0.1 \leq x \leq bk+0.9, k=\{0,1,2,3..,\lceil \frac nb \rceil\}\}$, with $n \in \mathbb{R}$ (but hopefully over all $x \in [0,n]$), and has a constant number of terms $k$ that independent of $N,n,a,b$.

square(and other integral powers) of the function does not have such a closed form antiderivative (however, if they do, I would like to know). $\endgroup$10more comments