function [ u, ut, utt, ux, uxx ] = standing_wave_exact ( x, t )

%*****************************************************************************80
%
%% standing_wave_exact() evaluates an exact solution of the 1D wave equation.
%
%  Discussion:
%
%    d^2u/dt^2 = c^2 d^2u/dx^2
%    u[x,t] = sin(x) * cos(c*t)
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    04 April 2025
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Grigory Barenblatt,
%    On some unsteady fluid and gas motions in a porous medium,
%    Prikladnaya Matematika i Mekhanika (Applied Mathematics and Mechanics, 
%    Volume 16, Number 1, pages 67-78, 1952.
%
%    Rouben Rostamian,
%    Programming Projects in C 
%    for Students of Engineering, Science, and Mathematics,
%    SIAM, 2014,
%    ISBN: 978-1-611973-49-5
%
%  Input:
%
%    real x, t: the position and time.
%
%  Output:
%
%    real u, ut, ux, uxx: the values of the exact solution, its time
%    derivative, and its first and second spatial derivatives at (x,t).
%
  [ c, xmin, xmax, t0, tstop ] = standing_wave_parameters ( );

  u = sin ( x ) * cos ( c * t );

  ut = - c * sin ( x ) * sin ( c * t );

  utt = - c^2 * sin ( x ) * cos ( c * t );

  ux = cos ( x ) * cos ( c * t );

  uxx = - sin ( x ) * cos ( c * t );

  return
end
