UCI.
By Nasser Abbasi
HW1 questions are here.
For first problem in HW1, I solved it by writing a program in MAPLE and also in Mathematica.
I show here the solution and the output. I picked N (number of terms as some arbitrary number, since the problem did not specify the number of terms for the fourier series coefficients.
The output shows as N increases we get better approximation to f(x), which is the function are are trying to represent in terms of sums of fourier series expansion.
The Mathematica notebook is here. The HTML output of running the Mathematica program is here.
The MAPLE worksheet is here. The HTML output of running the Maple program is here.
I worte a small prodcedures in Mathematica and in Maple to solve this.
The maple worksheet is here.
The HTML output showing the values is here.
Notebook is here.
HTML output in here.
Here is a solution using matlab as well. This is the m file.
Put the m file in your matlab path, and run as below. This below shows the output.
>> nma_HW1
x f(x)
1.500000, 0.785643
5.900000, -0.784740
6.300000, 0.793942
-0.600000, -0.784957
>>