Calculate mean value of the function

60 Views Asked by At

I need to calculate the average of $f(x)$ function. $f(x)$ is defined in a $[0,\pi]$

The regular integral average or $0$ harmonic of fourier series does not work as the $f$ function has many extremum points, so integral calculation is not efficient.

https://en.wikipedia.org/wiki/Mean_of_a_function

I tried the probabilistic method (as this function is defined in a $[0, \pi]$), that works not bad, but again not acceptable yet.

Is there any other way of function average calculation.


EDIT:

So finally, after suggestions in comments,I would like suggestions to effectively compute, or (if that’s not possible at all) approximate closely, the following expression: $$\frac{1}{\pi}\int_0^\pi \sin(x)\sin(3x)\sin(5x)…\sin((2n+1)x) dx.$$