function y = derivace()

%[F] =   3*(1-x(1))^2*exp(-(x(1)^2) - (x(2)+1)^2) ...
%    - 10*(x(1)/5 - x(1)^3 - x(2)^5)*exp(-x(1)^2-x(2)^2) ...
%   - 1/3*exp(-(x(1)+1)^2 - x(2)^2);

% derivace
syms x1 x2;

dx1 =   diff(3*(1-x1)^2*exp(-(x1^2) - (x2+1)^2) ...
    - 10*(x1/5 - x1^3 - x2^5)*exp(-x1^2-x2^2) ...
   - 1/3*exp(-(x1+1)^2 - x2^2),x1)

dx2 =   diff(3*(1-x1)^2*exp(-(x1^2) - (x2+1)^2) ...
    - 10*(x1/5 - x1^3 - x2^5)*exp(-x1^2-x2^2) ...
   - 1/3*exp(-(x1+1)^2 - x2^2),x2)

dx1x1 = diff(3*(1-x1)^2*exp(-(x1^2) - (x2+1)^2) ...
    - 10*(x1/5 - x1^3 - x2^5)*exp(-x1^2-x2^2) ...
   - 1/3*exp(-(x1+1)^2 - x2^2),x1,2)

dx2x2 =   diff(3*(1-x1)^2*exp(-(x1^2) - (x2+1)^2) ...
    - 10*(x1/5 - x1^3 - x2^5)*exp(-x1^2-x2^2) ...
   - 1/3*exp(-(x1+1)^2 - x2^2),x2,2)


dx1x2 = diff(dx1,x2)
dx2x1 = diff(dx2,x1)


