In this notebook I check the two FCS for sin(x) and the two FSS for cos(x).  I use L = 1 in the formulas.

nMax = 6;
p1 = Plot[Sin[x], {x, 0, Pi}, PlotStyle -> Red];
p2 = Plot[(2/π)+(2/π)(∑_(n=2)^nMax)(((((-1))^n)+1)/(1-(n^2)))Cos[n x],{x, -π/2, 3π/2}];
fig1 = Show[p2, p1, p2, AspectRatio -> Automatic]

nMax = 3;
p1 = Plot[Sin[x], {x, 0, Pi}, PlotStyle -> Red];
p2 = Plot[(2/π)+(4/π)(∑_(k=1)^nMax)(1/(1-(((2k))^2)))Cos[2k  x],{x, -π/2, 3π/2}];
fig1 = Show[p2, p1, p2, AspectRatio -> Automatic]

(*Export["H:\\Math Classes Personal\\MAT 461 2007.7\\FCS of sine\\fig1.eps", fig1]*)

nMax =30;
p1 = Plot[Cos[x], {x, 0, Pi}, PlotStyle -> Red];
p2 = Plot[(2/π)(∑_(n=2)^nMax)((-n((((-1))^n)+1))/(1-(n^2)))Sin[n x],{x, -π/2, 3π/2}];
fig2 = Show[p2, p1, p2, AspectRatio -> Automatic]

(*Export["H:\\Math Classes Personal\\MAT 461 2007.7\\FCS of sine\\fig2.eps", fig2]*)

nMax =15;
p1 = Plot[Cos[x], {x, 0, Pi}, PlotStyle -> Red];
p2 = Plot[(8/π)(∑_(k=1)^nMax)(k/(((((2k))^2)-1)))Sin[2k x],{x, -π/2, 3π/2}];
fig2 = Show[p2, p1, p2, AspectRatio -> Automatic]

Now, let's check find the Fourier coefficients by integration as a check.

(1/L)(∫_0^L)Sin[π x/L]\[DifferentialD]x  (* A_0 *)

(2/L)(∫_0^L)Sin[π x/L] Cos[n π x/L]\[DifferentialD]x (* A_n *)

This is and indeterminate form, 0/0, when n = 1, so do this integral separately.

(2/L)(∫_0^L)Sin[π x/L] Cos[π x/L]\[DifferentialD]x  (* A_1 *)

Now for the coefficients of the FSS of cos(pi x/L)

(2/L)(∫_0^L)Cos[π x/L] Sin[n π x/L]\[DifferentialD]x (* B_n *)