Evaluating the infinite sum of the below trigonometric series yields a result of zero. However, when I calculate the finite sum up to $n$ and subsequently take the limit as $n$ approaches infinity on the result, it seems to be undefined.
We can explicitly perform the infinite sum for $x \in [0 , \frac{\pi}{2})$:
\begin{align*} - \sum_{m=1}^\infty (-1)^{m-1} \sin ((2m-1) x) & = - \sum_{m=1}^\infty \cos ((2m-1) (x-\frac{\pi}{2})) \nonumber \\ & = - \sum_{m=1}^\infty \dfrac{e^{i (2m-1)y} + e^{-i (2m-1)y}}{2} , \qquad y=x-\frac{\pi}{2} \nonumber \\ & = - \dfrac{e^{i y} \sum_{m=0}^\infty e^{i 2m y} + e^{-i y} \sum_{m=0}^\infty e^{-i 2m y}}{2} \nonumber \\ & = - \frac{1}{2} \left[ \dfrac{e^{i y}}{1 - e^{i2y}} + \dfrac{e^{-i y}}{1 - e^{-i2y}} \right] \nonumber \\ & = - \frac{1}{2} \left[ \dfrac{e^{i y} (1 - e^{-i2y}) + e^{-i y} (1 - e^{i2y})}{|1 - e^{i2y}|^2} \right] \nonumber \\ & = 0 \end{align*}
So the series sums to a definite answer of zero.
However: We can explicitly perform the sum for finite $n$:
\begin{align*} \sum_{m=1}^n (-1)^{m-1} \sin ((2m-1) x) & = - \sum_{m=1}^n \cos ((2m-1) (x-\frac{\pi}{2})) \nonumber \\ & = - \sum_{m=1}^n \dfrac{e^{i (2m-1)y} + e^{-i (2m-1)y}}{2} , \qquad y=x-\frac{\pi}{2} \nonumber \\ & = - \dfrac{e^{i y} \sum_{m=0}^{n-1} e^{i 2m y} + e^{-i y} \sum_{m=0}^{n-1} e^{-i 2m y}}{2} \nonumber \\ & = - \frac{1}{2} \left[ e^{i y} \dfrac{1 - e^{i 2n y}}{1 - e^{i2y}} + e^{-i y} \dfrac{1 - e^{-i 2n y}}{1 - e^{-i2y}} \right] \nonumber \\ & = - \frac{1}{2} \left[ \dfrac{(e^{i y} - e^{-i y}) (1 - e^{i 2n y}) + (e^{-i y} - e^{i y}) (1 - e^{-i 2n y})}{4 \sin^2 y} \right] \nonumber \\ & = - \dfrac{\sin (2ny)}{2 \sin y} \nonumber \\ & = (-1)^n \dfrac{\sin (2nx)}{2 \cos x} \end{align*}
and then take the limit $n \rightarrow \infty$. The function $(-1)^n \frac{\sin (2nx)}{2 \cos x}$ exhibits rapid oscillations as $n$ increases, with peak and trough amplitudes having the lower bound:
\begin{align*} \dfrac{1}{2 \cos (\dfrac{\pi}{4n})} \end{align*}
This lower limit corresponds to the height of the first peak on the interval $[0 , \frac{\pi}{2})$ at $x=\frac{\pi}{4n}$, with subsequent peaks and troughs exhibiting an increasing amplitude as $x$ increases.
So the distance between consecutive peaks tends to zero as $n \rightarrow \infty$ while the amplitude remains non-zero and finite. This limit seems undefined, similar to how the limit $ \lim{x \rightarrow 0^+} \sin (\frac{1}{x})$ is undefined. However, when we first performed the infinite sum we got zero. What is the reason for this seeming contradiction?