MTH229 integration problem question

Regarding your problem, it seems that you want to compute the coefficients of a Fourier series.

You can look at this thread Fourier series in Julia. That being said, I doubt that it is what you are looking for.