%P1
syms x1 x2 t1 t2 positive;
syms F J dg real;
x=[x1;x2];t=[t1;t2];
U=[1 -1];
F=x.*t;
F=F/sum(F);
F=sqrt(F);
F=subs(F,x2,1-x1);
J=jacobian(F,[x1]);
dg=simplify(det(U*J));
%dg=dg^2;
%dg=subs(dg,1-x1-x2,x3);
pretty(simplify(dg));





%P2
syms x1 x2 x3 t1 t2 t3 positive;
syms F J dg real;
x=[x1;x2;x3];t=[t1;t2;t3];
U=[1 0 -1;0 1 -1];
F=x.*t;
F=F/sum(F);
F=sqrt(F);
F=subs(F,x3,1-x1-x2);
J=jacobian(F,[x1 x2]);
dg=simplify(det(U*J));
dg=dg^2;
%dg=subs(dg,1-x1-x2,x3);
pretty(simplify(dg));
