function fjac = p10_jac ( n, x )

%*****************************************************************************80
%
%% P10_JAC sets the jacobian for problem 10.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 October 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of variables and equations.
%
%    real X(N), the evaluation point.
%
%  Output:
%
%    real FJAC(N,N), the jacobian matrix.
%
  fjac = zeros ( n, n );

  for i = 1 : n

    ti = i / ( n + 1 );

    for j = 1 : n
      tj = ( j ) / ( n + 1 );
      temp1 = ( x(j) + tj + 1.0 )^2;
      temp2 = min ( ti, tj ) - ti * tj;
      fjac(i,j) = 1.5 * temp2 * temp1 / ( n + 1 );
    end

    fjac(i,i) = fjac(i,i) + 1.0;

  end

  return
end
