This maple worksheet produce Fourier sine expansions, plots, and approximations of functions on [0,1]. > with(plots): input the number N of terms in the partial sums (use some number <20 to avoid long computations) > N:=2; input the function f(x) > f:=x->x; generate and diaply the Fourier sine coefficients. of f up to N > b:=array(1..N); > for n to N do b[n]:=2*int(sin(n*Pi*x)*f(x),x=0..1) od: display the coefficients > for n to N do b[n] od; display the coefficients in decimal form > for n to N do evalf(b[n]) od; generate the partial sums of f(x) > sf:=x->sum('evalf(b[j])*sin(j*Pi*x)','j'=1..N); plot f and its partial Fourier sine sum up to N and the periodic extension > plot(f(x),x=0..1,title=`f(x)`,thickness=2); > plot(sf(x),x=0..1, title=`Fourier approximation`,thickness=2); > plot([f(x),sf(x)],x=0..1,title=`f and Fourier sine approxiamtion`,thickness=2); > plot(sf(x),x=-5..5,title=`Periodic extension`,thickness=2); compute f its partial sum and their diference at a given point x0 > x0:=.1; > evalf(f(x0)); > evalf(sf(x0)); > evalf(f(x0)-sf(x0));