I need to find the analytic equation for the following expression:
$$a_n = \frac {1}{L}\int^L _{-L} 2x \ mod1 \ cos({\frac{n\pi}{L}}x) dx$$ in terms of n wherein n =1,2,3.
I attempted to tackle this question by integrating the equation and then finding some way to separate n, but then the mod gets in the way as I don't know how to handle that. Also, once I manage that, I'm not too sure how to separate n from there.
Does anyone have any ideas please? Especially with that pesky mod?