[Math] Fourier Series Coefficients for Square Wave

fourier analysis

Square Wave Graph

Determine the Fourier series coefficient of the square wave.

My attempt at the question

I think my limits for $a_0$ and $a_n$ may be incorrect.

Best Answer

As the function is even, all the sine coefficients will be zero and we can integrate from $0$ to $\pi$ and double. Then

$$2\int_0^{\pi/2}\cos(kx)\,dx-2\int_{\pi/2}^\pi\cos(kx)\,dx=\frac{\sin(k\frac\pi2)-0-0+\sin(k\frac\pi2)}k$$

Related Question