[Math] Fourier series of $\sin x$ using series of $e^{ix}$

fourier series

I have to find the Fourier series of $\sin x$ . Assume that $\ell$ is not an integer multiple of $\pi$.(Hint: First find the Fourier series for $e^{ix}$)

This is how I did it:
Complex Fourier series of $e^{ix}$=$\sum {(-1)^n \over (\ell-n\pi)}\sin(\ell)e^{{in\pi x}\over\ell} $

Letting $x=-x$
$$e^{-ix}=\sum {(-1)^n \over (\ell-n\pi)}\sin(\ell)e^{{-in\pi x}\over\ell}\\
\sin x={e^{ix}-e^{ix} \over 2i}$$

I get $$\sin x=\sin (\ell)\sum {(-1)^n \over (\ell-n\pi)}\sin{{n\pi x}\over\ell}$$

Is this correct?Can I have a sine term on the right hand side when I am finding the series of a sine function?
Formula of complex fourier series is
$f(x)=\sum C_n e^{in\pi x \over l}$ wher n goes from $-\infty$ to $+\infty $.

$C_n$=${1\over 2l}\int_{-l}^l f(x)e^{-in\pi x \over l} dx$

Best Answer

Yes it is correct, although conventionally when you give the expression in trig form the index usually runs only over the positive integers while in the exponential form it is usually writtena s running from $-\infty$ to $+\infty$, hence, the following notations are equivalent: $$ \begin{aligned} \sin \left( x \right) &=\sin \left( l \right) \sum _{n=-\infty}^{\infty } \frac{\left( -1 \right) ^{n}}{ -\pi \,n+l}\sin \left( {\frac {\pi \,nx}{l}} \right) \quad :-l<x<l\\ &=\sin \left( l \right) \sum _{n=-\infty}^{-1} \frac{\left( -1 \right) ^{n}}{ -\pi \,n+l}\sin \left( {\frac {\pi \,nx}{l}} \right)+\sin \left( l \right) \sum _{n=1}^{\infty } \frac{\left( -1 \right) ^{n}}{ -\pi \,n+l}\sin \left( {\frac {\pi \,nx}{l}} \right)\\ &=\sin \left( l \right) \sum _{n=1}^{\infty} \frac{\left( -1 \right) ^{n}}{ \pi \,n+l}\sin \left( -{\frac {\pi \,nx}{l}} \right)+\sin \left( l \right) \sum _{n=1}^{\infty } \frac{\left( -1 \right) ^{n}}{ -\pi \,n+l}\sin \left( {\frac {\pi \,nx}{l}} \right)\\ &=\sin \left( l \right) \sum _{n=1}^{\infty } \left(\frac{1}{ -\pi \,n+l}+ \frac{1}{ -\pi \,n-l} \right) \left( -1 \right) ^{n}\sin \left( {\frac {\pi \,nx}{l}} \right) \end{aligned} $$ where the properties $\sin(0)=0$ and $\sin(-x)=-x$ were exploited.

Example plot for $l=1$, first $250$ terms of the sum shown in blue, plotted against $\sin(x)$ in red:

enter image description here