function fx = p23_fun ( n, x )

%*****************************************************************************80
%
%% p23_fun() evaluates the integrand for problem 23.
%
%  Discussion:
%
%    The integrand has a singularity at X = 0.
%    The integrand is discontinuous at X = 0.
%    The integrand is arbitrarily oscillatory as X decreases to 0.
%    The integrand becomes unbounded as X decreases to 0.
%
%    Integral ( 0 < X < 1 ) ( 1 / X ) sin ( 1 / X ) dX
%    = Integral ( 1 < X < Infinity ) ( 1 / X ) * sin ( X ) dX.
%
%  Interval:
%
%    0 <= x <= 1
%
%  Integrand:
%
%    ( 1 / x ) sin ( 1 / x )
%
%  Approximate Integral (20 digits):
%
%    0.62471325642771360429...
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 November 2009
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Philip Davis, Philip Rabinowitz,
%    Methods of Numerical Integration,
%    Second Edition,
%    Dover, 2007,
%    ISBN: 0486453391,
%    LC: QA299.3.D28.
%
%  Input:
%
%    integer N, the number of evaluation points.
%
%    real X(N), the evaluation points.
%
%  Output:
%
%    real FX(N), the integrand values.
%
  i = find ( x == 0.0 );
  fx(i) = 0.0;
  j = find ( x ~= 0.0 );
  fx(j) = ( 1.0 ./ x(j) ) .* sin ( 1.0 ./ x(j) );

  return
end
