Indefinite Integral of Modulo Function By defining the modulo function with the floor function:
$$ x \bmod y = x - y \left\lfloor \frac xy \right\rfloor $$
Is it possible to find the antiderivative of the Modulo function?
I attempted at integrating with the and approximate indefinite integral of the floor function, but completely got lost due to my limited knowledge in calculus.
Can someone explain to me how this will or will not work?
 A: Between $0$ and $y$ it is easy enough to integrate; you get $\frac12x^2+C$.
Since the integrand is periodic, the integral in the other periods is just a translated version of the integral in the base period, with the constants of integration chosen such that neighboring periods fit together. The translation is excatly what the modulo operation itself does, so we'll get something like
$$ \frac12(x\bmod y)^2 + \frac{y^2}2\left\lfloor \frac xy\right\rfloor + C $$
Here $\frac{y^2}2$ is the integral of one period (and therefore the amount we need to raise the side-translated next period to fit), and $\lfloor x/y\rfloor$ counts how many periods to the right of the base period we are.
A: In order to integrate a function containing an expression of floor, you must understand that the floor function is defined within calculus to be an extension of the floor function. That is to say:
$$\int f(x)dx = F(x) + floor(b) + c$$
Where b is any expression of x. Now, from this definition I can determine your integral to be the following:
$$\int x - y(x)\lfloor \frac x{y(x)} \rfloor dx = \frac 12x^2 - Y(x)\lfloor \frac x{y(x)} \rfloor + \lfloor b \rfloor + c$$
I made the y variable a function of x. I did that to avoid a possible 3 dimensional integral and to avoid the potential for it being interpreted as a constant. Now, the integrals that will be useful (since these are a range), will be the one's that have $c=0$ and b having a value that produces a continuous graph. It is likely to be some manipulation of the $\lfloor 
\frac x{y(x)}\rfloor$ function, and I will also say that the floor could be to a power or added upon itself. The point is that any functions of x have to be wrapped inside floor(), otherwise it is not an extension of the C-constant of integration.
I hope this helps you in solving your integral.
