function [f, G] = objfungrad(x)
% objective function:

%   Copyright 1990-2000 The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 2000/06/16 22:25:14 $

f =exp(x(1)) * (4*x(1)^2 + 2*x(2)^2 + 4*x(1)*x(2) + 2*x(2) + 1);
% gradient (partial derivatives) of the objective function:
t = exp(x(1))*(4*x(1)^2+2*x(2)^2+4*x(1)*x(2)+2*x(2)+1);
G = [ t + exp(x(1)) * (8*x(1) + 4*x(2)), 
      exp(x(1))*(4*x(1)+4*x(2)+2)];
