function J = p11_j ( m, n, x )

%*****************************************************************************80
%
%% p11_j() evaluates the jacobian for problem 11.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%  Modified:
%
%    03 March 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of equations.
%
%    integer N, the number of variables.
%
%    real X(N), the evaluation point.
%
%  Output:
%
%    real J(M,N), the jacobian matrix.
%
  J = zeros ( m, n );

  for i = 1 : 29
    div = i / 29.0;
    s2 = 0.0;
    dx = 1.0;
    for j = 1 : n
      s2 = s2 + dx * x(j);
      dx = div * dx;
    end
    temp = 2.0 * div * s2;
    dx = 1.0 / div;
    for j = 1 : n
      J(i,j) = dx * ( j - 1 - temp );
      dx = div * dx;
    end
  end

  J(30:31,1:n) = 0.0;
  J(30,1) = 1.0;
  J(31,1) = -2.0 * x(1);
  J(31,2) = 1.0;

  return
end
