I’m having a great deal of trouble finding the Fourier Coefficients of the following function:
$$f(x)=\begin{cases}0, & x\leq 0 \\ \sin x, & x>0\end{cases}$$
where $x$ is defined over the range $-\pi \leq x \leq \pi$.
I just need to find the expression Fourier coefficients, in either sine cosine or exponential form, but when I calculate them in the standard way, I always end up with a function divided by $n^2-1$. In other words,
$$c_n = \frac{i\sin(\pi n)-\cos(\pi n) - 1}{2 \pi (n^2 -1)}.$$
Since this leads to a division by zero when $n=1$, I’m not sure how to proceed from here, and I’ve been churning my wheels for quite some time trying to figure out my mistake, without any luck. I’m hoping someone could offer some guidance as to where I’ve gone wrong here.
Hint: To evaluate $c_1$ note that $\int_{0}^{2\pi} \sin x e^{ix}dx=i\int_{0}^{2\pi} \sin^{2} x dx=i\frac 1 2\int_{0}^{2\pi} (1-\cos (2x))dx=i\pi$.