# Infinite sum of zeros approach -1

The function $f(x)=L-x$ on $x\in[0,L]$ can be written as a cosine series after an even ekstension into $x\in[-L,0]$,

$$f(x)=L-x=\frac{L}{2}+\sum_{n=1}^{\infty} \frac{2L}{n^2\pi^2}(1+(-1)^{n+1})\cos\Big(\frac{n\pi x}{L}\Big), \quad x\in[0,L]$$

At $x=0$ all terms in the sum has vanishing derivative, $\frac{\mathrm{d}}{\mathrm{d}x}\cos\Big(\frac{n\pi x}{L}\Big)\Big|_{x=0}=0$, whereas $\frac{\mathrm{d}}{\mathrm{d}x}(L-x)=-1$. So how can an infinite sum of zeros approach $-1$?

Note that the even extension here is $f^*(x) = |L-x|$ on $x \in [-L,L]$. It's not even differentiable at $x=0$.
That said, $0\times\infty$ is not defined, and has an indeterminate limit: it's possible for the continuation to such a point to be anything.
Your periodic function is discontinuous at multiples of $L$, since $L-0\ne L-L$.