[tex]-4 Re \int^x ds \int^s dt \sum_{k=1}^\infty e^{2\pi kti}[/tex]
[tex]=-4 Re \int^x ds \int^s dt \frac{e^{2\pi ti}}{1-e^{2\pi ti}}[/tex]
[tex]=2Re \int^x ds \int^s dt (1-i \cot \pi t )[/tex]
[tex]=x^2+Bx+C[/tex]
[tex]=x(x-1)+\frac{1}{6}[/tex]
[tex]=x^2-x+\frac{1}{6}[/tex]
because for x=0,1 it is ##\zeta(2)/\pi^2=1/6##. Minimum for x=1/2 is ##-\frac{1}{12}## which coincides with -##\eta(2)/\pi^2## using eta function or alternate zeta function. Ref. https://mathworld.wolfram.com/DirichletEtaFunction.html
\begin{align*}
\frac{1}{\pi^2} \sum_{k=1}^\infty (-1)^k \frac{\cos 2 \pi k x}{k^2}
\end{align*}
for ##-\frac{1}{2} \leq x \leq \frac{1}{2}## first and then make the shift ##x \mapsto x - \frac{1}{2}##.
I will express the sum via a complex contour integration. It employs the fact that the function
\begin{align*}
\dfrac{\cos 2 \pi z x}{\sin \pi z}
\end{align*}
has simple poles at all integer values except when ##\cos 2 \pi z x = 0##, as we now verify. First consider the case where ##\cos 2 \pi z x \not= 0## for ##z=n##,
where the contour ##C'## is defined in fig (a). We complete the path of integration along semicircles at infinity (see fig (b)) since the integrand vanishes there. Since the resulting enclosed area contains no singularities except at ##z=0##, we can shrink this contour down to an infinitesimal circle ##C_0## around the origin (see fig (c)). So that
The Fourier cosine series for an even periodic function ##f(x)## with period ##2L## is
\begin{array}{cl}f(x)&=\frac{c_0}2 + \sum_{k=1}^\infty c_k \cos\frac{k\pi x}{L}\\
c_k &= \frac 2L\int_0^L f(x) \cos\frac{k\pi x}{L}\,dx\end{array}
Pick ##L=\frac 12## and let ##f(x)## be the desired function. It follows that for ##k>0##: $$\pi^2 c_k=4\pi^2\int_0^{1/2} f(x) \cos(2k\pi x)\,dx=\frac 1{k^2}$$
We have for ##k>0##:
$$\begin{cases}4\pi^2\int_0^{1/2} x \cos(2k\pi x)\,dx = \frac{(-1)^k-1}{k^2}\\
4\pi^2\int_0^{1/2} x^2 \cos(2k\pi x)\,dx = \frac{(-1)^k}{k^2}\end{cases}\implies
4\pi^2\int_0^{1/2} (x^2-x) \cos(2k\pi x)\,dx = \frac{1}{k^2}
$$
Furthermore, ##f(0)=\frac 1{\pi^2}\sum_{k=1}^\infty \frac 1{k^2}=\frac 16##.
So the function is ##f(x)=x^2-x+\frac 16## on the interval [0,1], which is indeed an even periodic function if we extend it periodically.