function [fx,gx,Hx] = myfunc(x)
% function [fx,gx,Hx] = myfunc(x)
% My test function for Newton's method
% f(x) = (x_1-2)^4 + (x_1-2x_2)^2
% fx, gx, Hx return the function, gradient, and Hessian values at x

fx = 3*x(1)^2 + 2*x(1)*x(2) + 2*x(2)^2 - 4*x(1) + 5*x(2);
gx = [6*x(1)+2*x(2)-4; 2*x(1)+4*x(2)+5];
Hx = [6 2; 2 4];