I am studying Fourier series and there is a lot of integration going on, specifically with trigonometric functions involved. When solving for the Fourier coefficients, often times, the definite integral of a trig. function (such as $f(x)= |sin(x)| cos(x), f(x)=sin^2(x), f(x)=cos(x), etc.$) cancels out to be zero.
I know the criteria for defining whether a function is even or odd, can I somehow use that, in addition to looking at the bounds of an integral to determine whether solving it would make everything cancel and the result equal to zero? Are there any specific rules or criteria that predict cancelation?
Deciding if a function is odd or even is very useful for Fourier series.
If $\mathrm{h}$ is an even function then $\displaystyle{\int_{-L}^L\mathrm{h}(x)~\mathrm{d}x = 2\int_0^L\mathrm{h}(x)~\mathrm{d}x}$
If $\mathrm{h}$ is an odd function then $\displaystyle{\int_{-L}^L\mathrm{h}(x)~\mathrm{d}x = 0.}$
We also need to remember that
EVEN FUNCTIONS
The Fourier series of an even function will have only cosine terms. There are no sine terms because sine is odd and even $\times$ odd = odd, which means a zero contribution from the integral - see above. $$\mathrm{f}(x) = \frac{a_0}{2}+\sum_{n=1}^{\infty}a_n\cos\!\left(\frac{n\pi x}{L}\right)$$ where \begin{eqnarray*} a_0 &=& \frac{2}{L}\int_0^L \mathrm{f}(x)~\mathrm{d}x \\ \\ a_n &=& \frac{2}{L}\int_0^L\mathrm{f}(x)\cos\!\left(\frac{n\pi x}{L}\right)\mathrm{d}x \end{eqnarray*}
ODD FUNCTIONS
Similarly, the Fourier series of an odd function will have only sine terms. There will be no cosine terms because cosine is an even function and odd $\times$ even = odd, which means a zero contribution from the integral - see above. $$\mathrm{f}(x) = \sum_{n=1}^{\infty} b_n\sin\!\left(\frac{n\pi x}{L}\right)$$ where $$b_n = \frac{2}{L}\int_0^L \mathrm{f}(x)\sin\!\left(\frac{n\pi x}{L}\right)\mathrm{d}x$$