# Fourier series /fourier transform proof

I want to prove that for the function

$$f(x) = \begin{cases} \frac{π}{4} & 0 <x < π \\ \frac{-π}{4} & -π < x < 0 \end{cases}$$

the Fourier series is: $$f(x) = \sin x + \frac{\sin3x}{3} + \frac{\sin5x}{5} + \frac{\sin7x}{7}+\dots$$

[My Attempt] $$f(x) = a_0\sum_{i=0}^∞ a_n\cos(nx) + b_n\sin(nx)$$ $$a_0 = \frac{1}{π}\int_{-\pi}^{+\pi}f(x)\cos(nx) dx$$ $$b_n = \frac{1}{π}\int_{-\pi}^{+\pi}f(x)\sin(nx) dx$$ but I don't know how to prove from here.

What should be the next step?

• $f(x)$ is odd, hence all $a_n$'s are zero. – projectilemotion Jun 11 '18 at 8:15
• Compute the integrals. – mandella Jun 11 '18 at 8:17
• break up the integrals according to the piecewise function $f(x)$ – cat Jun 11 '18 at 8:25

## 1 Answer

Note that $f(x)$ is odd, hence all $a_n$ terms vanish. Thus, the Fourier series admits the form: $$f(x)=\sum_{n=1}^{\infty} b_n\sin(nx) \tag{1}$$ Since $f(x)$ is odd, it follows that $f(x)\sin(nx)$ is even, since the product of two odd functions is even. Hence, it follows that: \begin{align}b_n&=\frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)~dx\\&=\frac{2}{\pi}\int_0^{\pi} f(x)\sin(nx)~dx\\&=\frac{2}{\pi}\int_0^{\pi} \frac{\pi}{4}\cdot \sin(nx)~dx\\&=\frac{1}{2}\int_0^{\pi}\sin(nx)~dx \end{align} I will leave the rest as an exercise. Once you have computed $b_n$ for all $n\in \mathbb{N}$, substitute your result into $(1)$, then you are done (Assuming you have computed the integral correctly).

• The result is $$\frac{1}{n}$$. right? – RecklessSerenade Jun 11 '18 at 8:42
• This is only true if $n$ is an odd number. You should have: $$b_n=\frac{\sin^2(n\pi/2)}{n}$$ And note that if $n$ is an even number, then $b_n=0$. Otherwise, if $n$ is odd, then $b_n=\frac{1}{n}$, as you have deduced. – projectilemotion Jun 11 '18 at 8:44
• Then, in this case we are thinking of even function, so is -1/n correct? – RecklessSerenade Jun 11 '18 at 8:49
• I'm unsure how you deduced that $-\frac{1}{n}$ should be correct. Have you tried computing the integral? The antiderivatives of $\sin(nx)$ are: $$\int \sin(nx)~dx=-\frac{\cos(nx)}{n}+C$$ Now plug in the integration limits (use FTC), and use the identity $1-\cos(\alpha)=2\sin^2(\alpha/2)$. You should then obtain the $b_n$ I provided on my previous comment. – projectilemotion Jun 11 '18 at 8:57
• thank you so much! I got it – RecklessSerenade Jun 11 '18 at 9:04