Question: A function as an argument of another function

Hi there!

I need a function that receives a function of several complex variables f(z), z=z_1,...z_n as an argument and returns its decomposition into its real and imaginary parts as functions of real variables: f(z)=u(x,y)+i*v(x,y).

Here is my Maple code for the case of two complex variables z_1, z_2:

UV:=proc(f, n) #second argument n is a number of variables
  local i, X, Y, XY, w, u, v:
  X:=[seq(x[i], i=1..n)]: # Create lists of real variables x_j, y_j
  Y:=[seq(y[i], i=1..n)]:
  XY:=zip((a,b)->a+I*b, X, Y): # Create a list of x_j + I * y_j
  map(a -> assume(a, real), X): # assume all x_j, y_j are real
  map(a -> assume(a, real), Y):
  w:=f(op(XY)): # substitute x+iy into f(z)
  return([u, v]):
end proc:

To call the function, I need to type something like this:
UV((z1,z2) -> exp(z1+z2), 2) 

The trouble I have is when I try calling this function inside another function that receives as arguments n functions of n complex arguments, in other words, it receives two lists, say: Z:=[z_1,...z_n], F:=[f_1,...f_n]. At some point, I need to decompose each f_j into its real and imaginary parts but unfortunately calling UV inside this function neither accepts lists
UV(Z -> f_j, n)
nor it understands something like
UV(op(Z) -> f_j, n) or UV((op(Z)) -> f_j, n).

Maybe my approach to this problem is incorrect from the very beginning, but I don't see any other acceptable ways to do it. Can anybody help me?

Please Wait...