I have the function as shown in the first line of the code and its partial sum in the second line of the code below.
f[x_] := Abs[x];
s[k_, x_] := (Pi/2) + Sum[((-1)^(n) - 1) 2/(Pi n^(2)) Cos[n x], {n, 1, k}]
Then I have the Cesàro means of the function:
$$F_{n}(f)=\frac{1}{n} \sum^{n-1}_{m=0} S_{m}(f)$$
Originally I plot just the function and its partial sum with the code
Plot[Evaluate[{f[x], partialsums}], {x, -0.5, 0.5}
Now if I want to add in the 4th term of the Cesàro means, may I know how can I do so? I made a few changes and there is always a +
symbol appearing inline which I believe is due to some mistake in my program
The original plot without the Cesàro means is
f[x_] := Abs[x];
s[k_, x_] := Pi/2 + Sum[((-1)^(n) - 1) 2/(Pi n^(2)) Cos[n x], {n, 1, k}]
partialsums = Table[s[n, x], {n, 4}];
Plot[Evaluate[{f[x], partialsums}], {x, -0.5, 0.5}]
When I introduce the Piecewise
function to add the Cesàro means to my graph, no drawings were generated. Please help.