ENGI 9420 Example 7.02.2
Graphs of Partial Sums of Fourier Series
of f (x) = 0 on (-p, 0);
f (x) = (p - x) on
(0, +p).
> | restart: |
> | f(k,x) := (1 - (-1)^k)*cos(k*x)/(k*k*Pi) + sin(k*x)/k; |
> | s2(x) := Pi/4 + sum(f(k,x),k=1..2); |
> | plot(s2(x), x=-Pi..Pi, y=-0.5..3.5, colour=blue, thickness=2, title=`y = S2(x)`); |
> | s3(x) := Pi/4 + sum(f(k,x),k=1..3); |
> | plot(s3(x), x=-Pi..Pi, y=-0.5..3.5, colour=blue, thickness=2, title=`y = S3(x)`); |
> | s5(x) := Pi/4 + sum(f(k,x),k=1..5); |
> | plot(s5(x), x=-Pi..Pi, y=-0.5..3.5, colour=blue, thickness=2, title=`y = S5(x)`); |
> | s10(x) := Pi/4 + sum(f(k,x),k=1..10): |
> | plot(s10(x), x=-Pi..Pi, y=-0.5..3.5, colour=blue, thickness=2, title=`y = S10(x)`); |
> | s50(x) := Pi/4 + sum(f(k,x),k=1..50): |
> | plot(s50(x), x=-Pi..Pi, y=-0.5..3.5, colour=blue, thickness=2, title=`y = S50(x)`); |
The Maple worksheet file is available here.