Example 3.10 in the Textbook: expand the function f(t)=exp(-t) for t\in[-1,1] into
a complex exponential series;
> | restart: A:=-1;B:=1;N:=5; |
Function to be expanded on [-1,1]:
> | f(t):=piecewise(t<A,0, t>A and t<B,exp(-t),t>B ,0); plot(f(t),t=-5..5); |
Fourier Coefficients:
> | c[n]:=1/2*int(f(t)*exp(-n*Pi*t*I),t=-1..1); |
nth Partial Sum of the Complex Exponential Series Expansion;
> |
E[N](t):=sum(c[n]*exp(n*Pi*t*I),n=-N..N);
> | plot({f(t),E[N](t)},t=-5..5,y=-2..3, color=[red,blue]); |
> |