a0= 4/Pi;

an = Function[n , (4/(Pi*(1-n^2)))];
nth=50;

MyFourier = Function[{x,n}, a0/2+ Sum[an[i] * Cos[3*i*x],{i,2, n, 2}]];
WFourier = FourierCosSeries[Sin[3*x], x,n];

MPlot = Plot[ MyFourier[x, nth], {x,0,Pi/3} , PlotStyle->Red];
RPlot = Plot[Sin[3*x],{x,0,Pi/3}, PlotStyle->Green];

Show[ MPlot]