f[x_]:=x*(1-x);
k=1;
Plot[{f[x],Sin[k*x*Pi]/4},{x,0,1}]

nn=30;ll=1;Do[a[nnn]=2*Integrate[f[x]*Sin[nnn*x*Pi],{x,0,1}],{nnn,1,nn}];Table[a[nnn],{nnn,1,nn}];

Do[a[nnn]=2*NIntegrate[f[x]*Sin[nnn*x*Pi],{x,0,ll}],{nnn,1,nn,2}];Table[a[nnn],{nnn,1,nn,2}]

ListPlot[Table[{nnn,1/a[nnn]},{nnn,1,nn,2}]]

lp=ListPlot[tab=Table[{Log[nnn],Log[a[nnn]]},{nnn,1,nn,2}]];zal=Fit[tab,{1,x},x];Print[zal];
Show[lp,Plot[zal,{x,0,Log[nn]}]]

Exp[-1.3547481158691166]

8/Pi^3.

Plot[{Sum[a[nnn]*Sin[nnn*Pi*x],{nnn,1,3,2}],
f[x]},{x,0,1}]

Plot[Sum[a[nnn]*Sin[nnn*Pi*x],{nnn,1,11,2}]-f[x],{x,0,1}]

Do[plo[mm]=Plot[Sum[a[nnn]*Sin[nnn*Pi*x],{nnn,1,mm,2}]-f[x],{x,0,1},PlotStyle->{RGBColor[mm/30,0,1-mm/30]}],{mm,21,nn,2}]

Show[Table[plo[mm],{mm,21,nn,2}]]

Do[err[mm]=(NIntegrate[(((Sum[a[nnn]*Sin[nnn*Pi*x],{nnn,1,mm,2}]-f[x]))^2),{x,0,1}])^0.5,{mm,1,nn,2}]

Table[err[mm]*mm^3,{mm,1,nn,2}]

Plot3D[Sum[a[nnn]*Sin[nnn*Pi*x]*Exp[-nnn*Pi*y],{nnn,1,3,2}],{x,0,1},{y,0,2},PlotRange->All]