function fx = p11_fx ( n, x )

%*****************************************************************************80
%
%% P11_FX evaluates the function 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 FX(N), the function value.
%
  fx = zeros ( n, 1 );

  c_sum = sum ( cos ( x(1:n) ) );

  for k = 1 : n
    fx(k) =  n - c_sum + k * ( 1.0 - cos ( x(k) ) ) - sin ( x(k) );
  end

  return
end

