in finding the coefficient of Fourier Series, $a_0, a_n, b_n$. We integrate the periodic function $f(t)$ over the period $T$. That is
$$\frac1T\int^T_0 f(t)\ dt$$ $$\frac2T\int^T_0 f(t)\cos(n\omega t)\ dt$$ $$\frac2T\int^T_0 f(t)\sin(n\omega t)\ dt$$
However, for some function, $a_n$ and $b_n$ can be calculate by just integrate over half of period and multiply the result by 2 that means
$$\frac4T\int^{\frac T2}_0 f(t)\cos(n\omega t)\ dt$$ $$\frac4T\int^{\frac T2}_0 f(t)\sin(n\omega t)\ dt$$
However, I don't know if this approach can be used in all situation or just some special cases. If it can be used only in some special cases, then what is the requirement to use it.
Moreover, for some periodic function having the same positive and negative part for example the sinusoid. Does $a_0$ of this function always return the result of zero?