function fjac = p11_jac ( n, x )

%*****************************************************************************80
%
%% P11_JAC sets the jacobian for problem 11.
%
%  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

    for j = 1 : n

      if ( i ~= j )
        fjac(i,j) = sin ( x(j) );
      else
        fjac(i,j) = ( j + 1 ) * sin ( x(j) ) - cos ( x(j) );
      end

    end

  end

  return
end
