function f2 = p14_f2 ( x )

%*****************************************************************************80
%
%% p14_f2() evaluates the second derivative for problem 14.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 August 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real x, the values of the variables.
%
%  Output:
%
%    real f2, the second derivative.
%
  u1 = - 2.0 * ( x - 0.3 );
  v1 = ( ( x - 0.3 ).^2 + 0.01 ).^2;
  u2 = - 2.0 * ( x - 0.9 );
  v2 = ( ( x - 0.9 ).^2 + 0.04 ).^2;

  u1p = - 2.0;
  v1p = 2.0 * ( ( x - 0.3 ).^2 + 0.01 ) .* 2.0 .* ( x - 0.3 );
  u2p = - 2.0;
  v2p = 2.0 * ( ( x - 0.9 ).^2 + 0.04 ) .* 2.0 .* ( x - 0.9 );

  f2 = ( u1p .* v1 - u1 .* v1p ) ./ v1 ./ v1 ...
     + ( u2p .* v2 - u2 .* v2p ) ./ v2 ./ v2;

  return
end
