We know that $\displaystyle e^{ikt}=cos(kt)+i sin(kt)$, so we will only use the imaginary part of $\displaystyle e^{ikt}$

$\displaystyle b_k=\frac{2}{\pi}\Im\int_{0}^{\pi}e^{t} e^{ikt} dt = \frac{2}{\pi}\Im\int_{0}^{\pi}e^{(1+ik)t} dt $

$\displaystyle b_k=\frac{2}{\pi}\Im[\frac{e^{(1+ik)t}}{1+ik} ]_{0}^{\pi}$

$\displaystyle b_k=\Im (\frac{2}{\pi(1+ik)}\{e^{(1+ik)\pi}-1\})$

And what I don't understand is how it goes from the result above to the final result below:

$\displaystyle =\frac{2k}{\pi(1+k^2)}\{1-(-1)^ke^{\pi}\}$

I would really appreciate it if someone could tell me how this is done! I have no clue where the $\displaystyle k$ in "$\displaystyle 2k$" and "$\displaystyle k^2$" come from... Thanks a lot!