y1[x_]=Sum[E^(-n^2/1000)Cos[2 Pi n x], {n,1,2}]

Plot[y1[x],{x,-.5,.5},PlotRange->{-2,2}]

y2[x_]=Sum[E^(-n^2/1000)Cos[2 Pi n x], {n,1,5}]

Plot[y2[x],{x,-.5,.5},PlotRange->{-5,5}]

y3[x_]=Sum[E^(-n^2/1000)Cos[2 Pi n x], {n,1,20}]

Plot[y3[x],{x,-.5,.5},PlotRange->{-18,18}]

y4[x_]=Sum[E^(-n^2/1000)Cos[2 Pi n x], {n,1,100}];

Plot[y4[x],{x,-.1,.1},PlotRange->{-30,30}]

Plot[y4[x],{x,-2.5,2.5},PlotRange->{-30,30}]

y5[x_]=(1/10)Sum[E^(-(n/10)^2/1000)Cos[2 Pi (n/10) x], {n,1,1000}];

Plot[y5[x],{x,-2.5,2.5},PlotRange->{-30,30}]