
function exact_integral_simplex

f=@(x,y) (0.3*x+0.9*y).^10; % integrand on the simplex

method=2;

switch method
    case 1
        F=@(x,y) f(x,y).*(y <= x);
        I=integral2(F,0,1,0,1,'AbsTol',10^(-15),'RelTol',10^(-15));
    case 2
        F=@(s,t) (1/8)*f( (s+1)/2,(s+1).*(t+1)/4) .*(1+s);
        I=integral2(F,-1,1,-1,1,'AbsTol',10^(-15),'RelTol',10^(-15));
end

fprintf('\n \t I : %1.15e \n ',I)