Determine if the following function is odd or even using Fourier series.
If a function is even then $b_n=0$ and you have to evaluate $a_n=\frac 2 \pi \int_0^\pi f(x) \cos nx \, dx$
And if a function is odd then $a_n=0$ and you have to evaluate $b_n=\frac 2 \pi \int_0^\pi f(x)\sin nx \, dx$
However, this means that I have to do integration by parts five times. Is there a more efficient method to determine if the function is even or odd?