FSS and FCS expansions of a function

FSS

f[x_]=x

fplot=Plot[f[x],{x,0,1},PlotStyle->{Thick,Blue}]

fdotsin=Integrate[f[x] Sin[k Pi x],{x,0,1}]

fdotsin=Simplify[fdotsin,Assumptions->Element[k,Integers]]

sindotsin=Integrate[ Sin[k Pi x]^2,{x,0,1}]

sindotsin=Simplify[sindotsin,Assumptions->Element[k,Integers]]

b[k_]=fdotsin/sindotsin

Table[b[k],{k,1,9}]

N[%]

Manipulate[
Plot[{f[x],Sum[b[k]Sin[k  Pi x],{k,1,n}]},{x,0,1},
PlotRange->{-0.1,1.2},
 ImageSize->Large],{n,1,201,1}]

FSSnPlot=Plot[Sum[b[k]Sin[k  Pi x],{k,1,100}],{x,-3,3},PlotRange->{-1.2,1.2},PlotStyle->Red]

Show[FSSnPlot,fplot]

FCS

f[x_]=x

fplot=Plot[f[x],{x,0,1},PlotStyle->{Thick,Blue}]

fdotone=Integrate[f[x],{x,0,1}]

onedotone=Integrate[ 1,{x,0,1}]

a[0]=fdotone/onedotone

fdotcos=Integrate[f[x] Cos[k Pi x],{x,0,1}]

fdotcos=Simplify[fdotcos,Assumptions->Element[k,Integers]]

cosdotcos=Integrate[ Cos[k Pi x]^2,{x,0,1}]

cosdotcos=Simplify[cosdotcos,Assumptions->Element[k,Integers]]

a[k_]=fdotcos/cosdotcos

Table[a[k],{k,1,9}]

N[%]

Manipulate[
Plot[{f[x],Sum[a[k]Cos[k  Pi x],{k,0,n}]},{x,0,1},
PlotRange->{-0.5,1.5},
 ImageSize->Large],{n,0,201,1}]

FCSnPlot=Plot[Sum[a[k]Cos[k  Pi x],{k,0,100}],{x,-3,3},PlotRange->{-1.2,1.2},PlotStyle->Red]

Show[FCSnPlot,fplot]