TITLE: Integrals of products of fractional parts
QUESTION [13 upvotes]: Let $((x)):=x-\lfloor x \rfloor -1/2$, where $\lfloor x \rfloor $ denotes the greatest integer $\le x$. 
Let $a,b,c,...$ denote arbitrary natural numbers. It is clear that
$$ \int_0^a ((x/a)) dx =0.$$
A little exercise shows that 
$$ \int_0^{ab} ((x/a))((x/b)) dx =\frac{\gcd(a,b)^2}{12}.$$
It appears that 
$$ \int_0^{abc} ((x/a))((x/b))((x/c)) dx =0,$$
but I have not been able to determine a general formula for 
$$ \int_0^{abcd} ((x/a))((x/b))((x/c))((x/d))dx.$$
I would be interested in a general formula for the last integral, and for similar integrals with a larger number of factors. It seems that these integrals, or the corresponding sums, such as
$$ \sum_{k=0}^{ab-1} ((k/a))((k/b)) =  \frac{\gcd(a,b)^2-1}{12},$$
should be in the literature, but I have not been able to find a reference.

REPLY [6 votes]: These quantities are studied under the name Franel Integrals in the literature. If we change notation so that $\psi(x) = x−⌊x⌋−1/2 $ is the saw tooth function, we may define the "fourth order" Franel integral as 
$I(a,b,c,d)=\int_{0}^{1} \psi(ax) \psi(bx) \psi(cx) \psi(dx) dx.$
Expanding $\psi(x)$ in a Fourier series we see that:
$I(a,b,c,d) = \frac{1}{16 \pi^4} \sum_{\substack{s,t,u,v \in Z - \{0\}\\ sa+tb+uc+ue=0}} \frac{1}{stuv} =: \frac{1}{16 \pi^4} L(a,b,c,d)$
There is no explicit general closed form evaluation of this quantity but there are many special cases known, including
$L(1,1,1,1) = \frac{\pi^4}{5},$
$L(a,1,1,1) = \left(\frac{1}{3a} - \frac{2}{15a^3} \right) \pi^4,$
$L(a,a,b,b) = \frac{\pi^4}{9} + \frac{8 (a,b)^4 \zeta(4)}{a^2b^2}.$