finally I found the solution, thanks all.
clc
clear
close all
%%plot f
[x,y] = meshgrid(linspace(-pi,pi,40));
f=x.*y ;
subplot(1,2,1)
mesh(f)
title('f(x,y)=xy')
%%plot g
syms m n X Y
assume(m>=1);
assume(n>=1);
assume(X>-pi & X<pi);
assume(Y>-pi & Y<pi);
A = 4*(-1)^(m+n)*(sin(m*X)*sin(n*Y))/(m*n);
g = real(double(subs(symsum(symsum(A,n,1,Inf),m,1,Inf),{X,Y},{x,y})));
subplot(1,2,2)
mesh(g)
title('g: Double Fourier series of f for -\pi to \pi ')