# Solution verification for this Fourier series problem

We have a signal with period $$T = 2$$

We want to find the continuous time fourier series for this signal.

Since $$T = 2$$, $$\omega = \pi$$. All we have to do know is find the frequency domain.

$$x(t) = \sum_{k = -\infty}^{\infty}X[k]e^{-i \omega tk}$$

$$X[k] = \frac{1}{T}\int _{T}x(t)e^{i \pi tk}$$

$$X[k] = \frac{1}{2}\int _{2}x(t)e^{-i \pi tk} = \frac{1}{2} \left( \int _{0}^{1}\frac{3}{2}e^{-i \pi tk}dt + \int _{1}^{2}\frac{-3}{2}e^{-i \pi tk} dt \right)$$

$$X[k] = \frac{3}{4} \left( \int _{0}^{1}e^{-i \pi tk}dt - \int _{1}^{2}e^{-i \pi tk} dt \right) = \frac{3}{4} \left( \frac{-1}{i \pi k} \right)\left( e^{-i \pi k} - 1 - e^{-2i \pi k} + e^{-i \pi k} \right)$$

$$X[k] = \frac{3}{4} \left( \frac{-1}{i \pi k} \right)\left( (-1)^k - 2\right) \text{(Because k can only be an integer)}$$

This to me is correct... however the answer is actually

$$X[k] = \frac{e^{-j\frac{k\pi}{2}}3\sin(\frac{k\pi}{2})}{k\pi}$$

You made a small mistake in the final step. The second term in parentheses should be $$2((-1)^k-1)$$ because you have two terms $$e^{-j\pi k}$$. So your final result should be
$$X[k]=\frac{3}{2\pi jk}\big(1-(-1)^k\big)\tag{1}$$
With $$(-1)^k=e^{-j\pi k}$$, Eq. $$(1)$$ can be rewritten as
\begin{align}X[k]&=\frac{3}{k\pi}\frac{1-e^{-jk\pi}}{2j}\\&=\frac{3e^{-jk\pi /2}}{k\pi}\frac{e^{jk\pi /2}-e^{-jk\pi /2}}{2j}\\&=\frac{3e^{-jk\pi /2}\sin(k\pi/2)}{k\pi}\tag{2}\end{align}