function w=summ(x,n) w=3/2; for m=1:n w = w -cos(m*pi*x/3)*6*(1-(-1)^m)/(m*pi)^2 ; end