z(a,b):=a+b*%i;

f(a,b):=cos(z(a,b));

f(x,y);

factor(realpart(f(x,y)));

factor(imagpart(f(x,y)));

realpart(f(0,1));

imagpart(f(0,1));