numTerms = 15;
L = 1;
f[x_] = Exp[x];
(*Sine Series*)
A0 = N[(1/L)(∫_0.^L)f[x]\[DifferentialD]x];
A = Table[N[(2/L)(∫_0.^L)f[x]Cos[n Pi x/L]\[DifferentialD]x], {n, numTerms}];
Plot[{f[x],A0+ (∑_(n=1)^numTerms)A[[n]] Cos[n Pi x/L]}, {x, -1.5L, 1.5L}]