(* Half-range sine expansion of t on [0,Pi] *)
(*-----------------------------------------*)

ClearAll["@"];

(*Define, but don't evaluate the Fourier coeffs*)
b[n_]:=2/Pi*Integrate[t*Sin[n*t],{t,0,Pi}]

(*Evaluate S5 and display*)
S5=Sum[b[n]*Sin[n*t],{n,1,5}]
(*Evaluate S50 but don't display*)
S50=Sum[b[n]*Sin[n*t],{n,1,50}];

(*Plot the approximation curves*)
flist={S5,S50};
Plot[Evaluate[flist],{t,-2Pi,2Pi}]
