I'm asked to find the Fourier series of the following function as a sine series with period $2\pi$. $f(x)= cosx \ on \ [0,\pi]$
Since we wish to get a sine series we need to make $a_n = 0 \ for \ all \ n\geq 0$. Hence, we need an odd extension. Then I did the required calculations as follows: $$ \begin{aligned} f ( x ) = & \sum _ { n = 1 } ^ { \infty } b _ { n } \cdot \sin \left( \frac { n \pi } { L } x \right) = \sum _ { n = 1 } ^ { \infty } b _ { n } \sin ( n x ) \end{aligned} $$
$$ b _ { n } = \frac { 1 } { \pi } \int _ { 0 } ^ { \pi } \cos v \cdot \sin ( n x ) \cdot d x $$
$$ b_n = \frac { 1 } { \pi } \left[ - \frac { \cos ( \pi + n \pi ) } { 1 + n } - \frac { \cos ( n n - \pi ) } { n - 1 } + \frac { 1 } { 1 + n } + \frac { 1 } { n - 1 } \right] $$
However, what bothers me is that we have now undefined terms for $n=1$ on the right hand side. I'm missing the point somewhere but I couldn't figure out. Can you help me what can be done to resolve this?
EDIT: Read comment section.
$$ \begin{array} { l } b _ { 1 } = \frac { 1 } { L } \langle f ( x ) , \sin x \rangle \\ b _ { 1 } = \frac { 1 } { \pi } \int _ { - \pi } ^ { \pi } \cos x \cdot \sin x \cdot d x \\ b _ { 1 } = \frac { 2 } { \pi } \int _ { 0 } ^ { \pi } \cos x \cdot \sin x \cdot d x \\ b _ { 1 } = \frac { 1 } { \pi } \int _ { 0 } ^ { \pi } 2 \sin x \cdot \cos x = 0 \end{array} $$