kill(all);

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

z_(a,b) := a - b*%i;

(z(a,b)+z_(a,b))/2;

realpart(z(a,b));

is(equal(realpart(z(a,b)),(z(a,b)+z_(a,b))/2));

(z(a,b)-z_(a,b))/(2*%i);

imagpart(z(a,b));

is(equal(imagpart(z(a,b)),(z(a,b)-z_(a,b))/(2*%i)));