## UnkleRhaukus 2 years ago $$f(x)$$ as a sine series

1. UnkleRhaukus

$\qquad\text{$$f(x)$$ as a sine series} \begin{equation*} % f(x) f(x)=1,\qquad0<x<\pi \end{equation*}$

2. UnkleRhaukus

$\begin{equation*} % g(x) g(x)= \begin{cases} 1,&0<x<\pi\\ -1,&-\pi<x<0 \end{cases}\qquad\text{odd extension of $$f(x)$$} \end{equation*}$ \begin{equation*} % a_0, a_n a_0=a_n=0\qquad\text{odd function} \end{equation*} \begin{align*} % b_n b_n&=\frac1\pi\int\limits_{-\pi}^{\pi} g(x)\sin(n x)\,\text dx\\ &=\frac2\pi\int\limits_0^\pi \sin(n x)\,\text dx\qquad\text{even integrand}\\ &=\frac2\pi\left(\frac{-\cos(n x)}{n}\right)\Big|_0^\pi\\ &=-\frac2\pi\left(\frac{\cos(0)-\cos(n\pi )}{n}\right)\\ &=-\frac2{\pi}\left(\frac{1-(-1)^n}{n}\right)\\ \end{align*} \begin{align*} S(x)&=-\frac2\pi\sum\limits_{n=1}^\infty\left(\frac{1-(-1)^n}{n}\right)\sin(nx)\\ &=-\frac2\pi\sum\limits_{n=1,3,5,\dots}^\infty\left(\frac{2}{n}\right)\sin(nx)\\ &=-\frac4\pi\sum\limits_{r=1}^\infty\frac{\sin\big((2r-1)x\big)}{2r-1} \end{align*}

3. UnkleRhaukus

4. experimentX

just change L to pi http://mathworld.wolfram.com/FourierSeriesSquareWave.html

5. UnkleRhaukus

6. experimentX

you got the opposite one .. shift the period by +pi

7. UnkleRhaukus

where did i go wrong?

8. experimentX

don't know .. don't have much time right now!! but i often use that link as reference!!

9. experimentX

sin(nx) is not even .. get rid of that minus

10. experimentX

i'll see later!!

11. UnkleRhaukus

why does (4) on that link have a sin^2 term?

12. UnkleRhaukus

ah i found my mistake

13. UnkleRhaukus

\begin{align*} % b_n b_n&=\frac1\pi\int\limits_{-\pi}^{\pi} g(x)\sin(n x)\,\text dx\\ &=\frac2\pi\int\limits_0^\pi \sin(n x)\,\text dx\qquad\text{even integrand}\\ &=\frac2\pi\left(\frac{-\cos(n x)}{n}\right)\Big|_0^\pi\\ &=\frac2\pi\left(\frac{\cos(0)-\cos(n\pi )}{n}\right)\\ &=\frac2{\pi}\left(\frac{1-(-1)^n}{n}\right)\\ \end{align*}

14. UnkleRhaukus

\begin{align*} S(x)&=\frac2\pi\sum\limits_{n=1}^\infty\left(\frac{1-(-1)^n}{n}\right)\sin(nx)\\ &=\frac4\pi\sum\limits_{n=1,3,5,\dots}^\infty\frac{\sin(nx)}{n}\\ &=\frac4\pi\sum\limits_{r=1}^\infty\frac{\sin\big((2r-1)x\big)}{2r-1} \end{align*}

15. UnkleRhaukus

just a minus sign

16. UnkleRhaukus

17. Echdip

18. Echdip