Question: does Maple have build-in function to factor an expression to a product of functions?

 

Given an expression such as (x^2+1)*y^3*exp(-x-y), how to "factor" it to product of the two functions, one in x only and the other in y only. These products in this example are

                  exp(-x)*(1+x^2)

and

                 exp(-y)*y^3

For reference, this was also asked at Mathematica site here

addition:

Is it possible to obtain these separated products in a list or a set to make them easier to get hold of after the call? something like

   myFactor(  (x^2+1)*y^3*exp(-x-y) , {x , y} )

will return

    { exp(-x)*(1+x^2) , exp(-y)*y^3 }

This is current test cases

funcs:=[
   arcsin(x)/(sqrt(1-x^2)*y^2),
   x*y,
   x^2+x^2*y,
   2*x+1,
   cos(2*x),
   y,
   (x-1)/y,
   ln(1+y^2),
   1-x+y^2-x*y^2,
   x^2+x^3*y,
   1/(x+y),
   (1+sqrt(x))/(1+sqrt(y)),
   (1-x^2+y^2-x^2*y^2)/x^2,
   2*x*y^2+3*x^2*y^2,
   3*exp(2*x)+2*y,
   (5*sqrt(x)-y)/x,
   2*x*y+3*x^2*exp(x^2),
   sqrt(1+x+y^2),
   1,
   1+x*y,
   -y+4*x^3*y,
   exp(x^2)+2*x*y,
   -(y-exp(x))/(x-2),
   arcsin(x)/((1-x^2)*y^2),
   -(y-exp(x))/(x-2),
   -y+4*x^3*y,
   (x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y),
    sqrt(1-y^2)/x,
    sqrt(1-y^2)/(2*sqrt(x)),
    sqrt(1-y^2)
];

This functions checks if expression is product separable or not

is_separable:=proc(f,x,y)
  #checks if f(x,y) is separable to X(x)*Y(y) or not
  #but do not do the separation. The separation is done by
  #another function I have

  if diff(simplify(diff( simplify(ln(f)),x)),y) = 0 then
     return(true);
  else
     return(false);
  fi;
end proc:

it used as

for z in funcs do
   is_separable(z,x,y);
od;

 

Please Wait...