function [n,xv,fvec,fjac,ldfjac,iflag]=c05fj(n,xv,fvec,fjac,ldfjac,iflag)
x1 = xv(1)   ;
x2 = xv(2)   ;
if iflag ~=2
  fvec(1) = x1*x2-x2^3-1   ;
  fvec(2) = x1^2*x2+x2-5   ;
else
  fjac(1,1) = x2   ;
  fjac(1,2) = x1-3*x2^2   ;
  fjac(2,1) = 2*x1*x2   ;
  fjac(2,2) = x1^2+1   ;
end
