# Fourier series, scalar product

I am reading the book by Eduard Zehnder, Lectures on dynamical Systems. I have a little question about one equation he gives.

He consider a $$2n \times 2n$$ matrix $$J$$ such that $$J^2=-Id$$. He then consider the space $$C^{\infty}(S^1,\mathbb{R}^{2n})$$, so the space od smooth loops I guess. On this space he defines $$a(x,y)= \int_{0}^{1} \frac{1}{2}<-J \dot{x},y>dt$$. In the book he gives the following Fourier representation $$x(t)= \sum_{n \in \mathbb{Z}}e^{n 2 \pi t J }x_n$$, where $$x_n \in \mathbb{R}^{2n}$$. If I understood correctly, the matrix $$J$$ mimic the imaginary unit $$i$$.

He then gives $$\int_{0}^{1} dt = \delta_{n,m}$$ which comes from the "orthogonal basis" property of the complex exponentials I think.

Now, He says that $$2a(x,y) = 2 \pi \sum_{n >0} n - 2 \pi \sum_{n <0} \mid n \mid $$.

I am quite unsure how he got this result. Here's what I have done. At one point I interchanged the integral sign and the sum and I am not able to justify this. Could you please tell me if I am wrong ? Or if it is indeed correct, how can I justify it.

Many thanks

\begin{align*} 2a(x,y) & = \int_{0}^{1} <-J \dot{x},y> dt \\ & = \int_{0}^{1} <-J \cdot J \cdot 2 \pi \sum_{n \in \mathbb{Z}} e^{2 \pi n t J} x_n n , \sum_{m \in \mathbb{Z}} e^{2 \pi t J} y_m > dt \\ & = 2 \pi \int_{0}^{1} < Id \sum_{n \in \mathbb{Z}}n x_n,\sum_{m \in \mathbb{Z}} y_m >dt\\ & = 2 \pi \sum_{n,m \in \mathbb{Z}} \int_{0}^{1} < e^{2 \pi n t J} x_n n,e^{2 \pi t J} y_m > dt \\ & = 2 \pi \sum_{n \in \mathbb{Z}} n \\ & = 2 \pi \sum_{n >0} n - 2 \pi \sum_{n <0} \mid n \mid \end{align*}