Let f(t) be defined by $\displaystyle -\pi -t$ if $\displaystyle -\pi <t \leq 0$ and $\displaystyle \pi -t$ if $\displaystyle 0<t< \pi$.

1)Calculate $\displaystyle \hat f (n)$, $\displaystyle \forall n \in \mathbb{Z}$.

Attempt: After a lot of algebra, I reached $\displaystyle \hat f (n)=\frac{i [(-1)^n-1]}{n}+\frac{(-1)^n}{2n}+\frac{[(-1)^n-1]}{2n^2}+\frac{(-1)^{n+1}+1}{2\pi n}\left [ \pi + \frac{i}{n}} \right ]$ for all $\displaystyle n\neq 0$. I don't know how to check it out in Mathematica so I'd like to know if you could verify my answer. For $\displaystyle \hat f(0)$, I get $\displaystyle -\frac{\pi}{2}$.

2)Calculate $\displaystyle \sum _{n \in \mathbb{Z}} |\hat f (n)|^2$. Attempt: Not done yet, but if I remember well I should use Parseval identity. Is that right?

3)Study the pointwise convergence of the Fourier series of f. Attempt: Not done yet, but I think I should look at $\displaystyle \lim _{n \to \infty} \hat f (n)$ and see if it's equal to the function f?