(* To plot partial sum 10.3.10 for n=5 *)

g5=Pi/2+Sum[2*((-1)^n-1)*Cos[n*x]/(Pi*n^2),{n,1,5}];
Plot[g5,{x,-Pi,Pi}]

(* To plot error over one period (-Pi≤x≤Pi) for 10.2.10, with n=5. *)

f=Piecewise[{{-x,-Pi<=x<0},{x,0≤x<Pi}},Indeterminate]
g5=Pi/2+Sum[2*((-1)^n-1)*Cos[n*x]/(Pi*n^2),{n,1,5}];
Plot[Abs[f-g5],{x,-Pi,Pi},PlotRange->{{-Pi,Pi},{0,1}}]

Sum[2*((-1)^n-1)*Cos[n*x]/(Pi*n^2),{n,1,10}]