function [ u, dudq ] = double_well_potential ( q, p )

%*****************************************************************************80
%
%% double_well_potential() evaluates the potential for double_well_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 June 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real Q(:), P(:): the current solution.
%
%  Output:
%
%    real U(:): the potential.
%
%    real DUDQ(:): the derivative of the potential with respect to Q = Y(1).
%
  u = ( q.^2 - 1.0 ).^2;
  dudq = 4.0 * ( q.^2 - 1.0 ) .* q;

  return
end
 
