'why matlab can't do this marginal integral involve two independent variable?

When try to solve probability problem using matlab. The problem is to calculate margin probability function for x and y.

f(x,y) = y*e^(-y*(1+x)) when x,y belong to (0,inf); otherwise f(x,y) = 0.

clear
syms x y f(x,y) g(x) h(y)
f = y*exp(-y*(1+x))
c = int(f,y,0,inf) %% <---- problem here, can't find x,y independent
%%
g=exp(1+x) %% <---- marginal integral should be this.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source