<<FourierSeries`

g[t_] = E^(-4Abs[t])
f[t_] = FourierTrigSeries[g[t],t, 3]

p1 = Plot[f[t],{t,-.5,.5}];
p2 = Plot[g[t],{t,-.5,.5}];
Show[p1,p2,PlotRange->All]

error[t_] = (f[t] - g[t])^2;
interror = NIntegrate[error[t],{t,-.5,.5}]

totalerror = Table[0,{i,10}];
g[t_] = E^(-4Abs[t]);
Do[
f[t_] = FourierTrigSeries[g[t],t, i];
error[t_] = (f[t] - g[t])^2;
totalerror[[i]]  = NIntegrate[error[t],{t,-.5,.5}],
{i,10}]
ListPlot[totalerror,Joined->True]

ListLogPlot[totalerror, Joined->True]