a = 0.8;

F = @(x,y) [x.^2+y.^2-1-a*sin(x.*y);...
    2*x - a*y*cos(x.*y)];
DF = @(x,y) [2*x-a*y.*cos(x.*y), 2*y-a*x.*cos(x.*y);...
    2 + a*y.*y.*sin(x.*y), a*x.*y.*sin(x.*y)];

X0 = [0;1.2];
%%
TOL = 0.5 * 10^(-5);
difference = 1;

while difference > TOL
    
    X = X0 - DF(X0(1),X0(2))\F(X0(1),X0(2));
    difference = norm(X0 - X);
    X0 = X;
end
