# Computing Fourier Series

$$f(x)=\sin|x|$$

Is it possible to compute the Fourier Series of $f(x)$? It seems that it would admit a Fourier cosine representation because it is even (by looking at the graph), but the periodicity is a little strange. Is this even possible?

-

– Amzoti Dec 15 '12 at 1:36
On what interval do you want it? Perhaps $[0,2\pi]\,$ ? This is an even function, so its Fourier series shouldn't be that hard to evaluate... – DonAntonio Dec 15 '12 at 1:37
I think $[0, 2\pi]$. – Alex Dec 15 '12 at 1:40
It seems that it'll just be the Fourier series of $sin(x)$ on $[0,2\pi]$ and the Fourier series of $-sin(x)$ on $[-2\pi,0]$. Can anyone confirm this? – Alex Dec 15 '12 at 3:12
Why would you do that? The function is even so it's the same in both intervals you mention: no need to work twice – DonAntonio Dec 15 '12 at 20:28

## 1 Answer

$$c_0:=\frac{1}{\pi}\int_0^{2\pi}\sin x\,dx=\left.-\frac{1}{\pi}\,(\cos x)\right|_0^{2\pi}=0$$

$$\forall\,\,n\neq \pm \,1\,\,,\,c_n:=\frac{1}{2\pi}\int_0^{2\pi}\sin x\,e^{-inx}\,dx=\frac{1}{4\pi i}\int_0^{2\pi}\left(e^{ix}-e^{-ix}\right)e^{-inx}\,dx=$$

$$=\frac{1}{4\pi i}\int_0^{2\pi}\left(e^{ix(1-n)}-e^{-ix(1+n)}\right)dx=\frac{1}{4\pi i}\left[\frac{1}{i(1-n)}e^{ix(1-n)}+\frac{1}{i(1+n)}e^{ix(1+n)}\right]_0^{2\pi}=$$

$$\frac{1}{4\pi i}\left[\frac{1}{i(1-n)}\left(e^{2\pi i(1-n)}-1\right)+\frac{1}{i(1+n)}\left(e^{2\pi i(1+n)}-1\right)\right]=0$$

$$c_{-1}=\frac{1}{2\pi}\int_0^{2\pi}\sin x\,e^{ix}\,dx=\frac{1}{4\pi i}\int_0^{2\pi}\left(e^{2ix}-1\right)dx=\frac{1}{4\pi i}\left(-2\pi\right)=\frac{i}{2}$$

$$c_1=\frac{1}{2\pi}\int_0^{2\pi}\sin x\,e^{-ix}\,dx=\frac{1}{4\pi i}\int_0^{2\pi}\left(1-e^{-2ix}\right)dx=\frac{1}{4\pi i}2\pi=-\frac{i}{2}$$

Thus, in a pretty expected and even boring way, we get:

$$\sin x=c_{-1}e^{-ix}+c_1e^{ix}=\frac{i}{2}\left(e^{-ix}-e^{ix}\right)=\frac{e^{ix}-e^{-ix}}{2i}$$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 7, "mathjax_display_tex": 8, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9605263471603394, "perplexity_flag": "middle"}