Fourier Series problem involving complex notation I've been trying to solve a problem regarding Fourier series. I will show you my approach and where I get stuck, as well as the teacher's approach (which I do not understand). So, basically, I'd like you to please explain to me how I can solve the problem using my method (if it is possible) and to explain to me what exactly my teacher is doing.

Problem: 
a) Using complex notation, compute the Fourier series of the $2\pi$-periodic and odd function given over $[0,\pi]$ by: $$f(x)=\begin{cases} 
      x & \text{if}\ \ 0\leq x\leq \frac{\pi}{2} \\
      \pi-x & \text{if} \ \ \frac{\pi}{2}< x\leq \pi\\
   \end{cases}
$$
b) Show that $$\sum_{k=-\infty}^{+\infty} \frac{1}{(2k-1)^2} = \frac{\pi^2}{4}$$

My approach:
I was able to find the Fourier series, which is the following: $$Ff(x) = \frac{2i}{\pi} \sum_{k=-\infty}^{+\infty} \frac{(-1)^k}{(2k-1)^2}\ e^{i(2k-1)x} $$
The way I thought about it is that I somehow need to find an $x$ for which I get a sum that resembles the one that I have to show (informally, I want to eliminate the $(-1)^k$ and get $1$). So I thought I need to find an $x$ such that $e^{i(2k-1)x} = (-1)^k$. So, I did that in the following way. $$e^{i(2k-1)x} = (-1)^k \\i(2k-1)x = k\cdot \text{ln}(-1)$$ Now, I'm not sure if I can do this (and I am assuming that's where my mistake comes from, even though I don't know why it might be a mistake), but I assumed that $\text{ln}(-1) = i\pi$  since $e^{i\pi} = -1$, so I have that: $$i(2k-1)x = k\cdot i\pi \\ x = \frac{k}{2k-1}\pi$$ So this tells us that at $x  = \frac{k}{2k-1}\pi$, we have: $$Ff(x) = \frac{2i}{\pi} \sum_{k=-\infty}^{+\infty} \frac{1}{(2k-1)^2}$$ If we take $k = 1$, we have that $x=\pi$. Using Dirichlet's theorem, we have that $$Ff(\pi) = \frac{1}{2}(f(\pi+)+f(\pi-)) = -\pi$$ But then, this would give me the following equation: $$-\pi = \frac{2i}{\pi} \sum_{k=-\infty}^{+\infty} \frac{1}{(2k-1)^2}$$ which is clearly incorrect. But I can't spot my mistake and I don't know if my approach leads to the right answer.

Teacher's method:
The teacher found the same Fourier series that I did and he said the following:
Since f is continuous, we have that for $x \in [-\pi/2,\pi/2]$: $$x=\frac{2i}{\pi} \sum_{k=-\infty}^{+\infty} \frac{(-1)^k}{(2k-1)^2}\ e^{i(2k-1)x}$$ If we take $x\in [-a,a]$ we have that $(\pi/2a)x \in [-\pi/2,\pi/2]$ and therefore $$x = \frac{4ia}{\pi^2} \sum_{k=-\infty}^{+\infty} \frac{(-1)^k}{(2k-1)^2}\ e^{\frac{i\pi(2k-1)x}{2a}} $$ This is the step that I don't understand at all. First of all, what is $a$ ? And how does he get to the previous expression?
And hence, if we take $x=a$, we obtain :$$\sum_{k=-\infty}^{+\infty} \frac{1}{(2k-1)^2} = \frac{\pi^2}{4}$$ That last step makes sense to me (as all he did was substitute $x$ by $a$ in his previous expression, which indeed allows us to show what we want).
 A: In your solution, you get a value of $x$ that depends on $k$. As $k$ varies over all integers, you get different values each time. So you are effectively doing a sum
$$\sum_{k=-\infty}^\infty a_k e^{i(2k-1)x_k},$$
which has no meaning whatsoever. 
Let's just think about this: As you pointed out, we have $e^{i\pi} = -1$ and so $e^{i\ell\pi} = -1$ whenever $\ell$ is an odd integer and $e^{i\ell\pi} = +1$ whenever $\ell$ is an even integer. The way to take advantage of this observation, as Semiclassic commented, is to look at the expression $2kx$ appearing in the formula $e^{i(2k-1)x} = e^{i(2k)x}e^{-ix}$. $2k$ is always even, but if we put $x=\pi/2$, then $e^{i(2k)(\pi/2)} = e^{ik\pi} = (-1)^k$, by our beginning observation. Then, remembering that $e^{-i\pi/2} = -i$, we have
\begin{align*}
F(f)(\pi/2) &= \frac{2i}{\pi}\sum \frac{(-1)^k}{(2k-1)^2} e^{i(2k-1)(\pi/2)}  \\
&= \frac{2i}{\pi}\sum \frac{(-1)^k}{(2k-1)^2}(-1)^k e^{-i\pi/2} \\
&= \frac2{\pi} \sum \frac 1{(2k-1)^2}.
\end{align*}
Since $f$ is continuous at $\pi/2$, we have $\mathcal Ff(\pi/2) = f(\pi/2) = \frac{\pi}2$, and the result follows.
Final comments: No, your approach cannot be salvaged. You need to find a single value of $x$ to use. And I have no idea why your teacher put in the unnecessary parameter $a$. He's changing the "periodic domain" from $[-\pi,\pi]$ to $[-2a,2a]$, but for what reason I have no idea.
