The general explain of Fourier series is in the follwoing link:
https://zh.wikipedia.org/wiki/%E5%82%85%E9%87%8C%E5%8F%B6%E7%BA%A7%E6%95%B0
I am not sure your question is, since f(x) = [empty]^2 !?
So I assumed that your question is related to x^2 in the domain of [-pi, pi], the re-written question is shown below.
The code is:
clear allThe output of this code is