function r = standing_wave_residual ( t, x )

%*****************************************************************************80
%
%% standing_wave_residual() computes the residual of the standing 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
%
%  Input:
%
%    real T, X: the time and position where the solution is evaluated.
%
%  Output:
%
%    real R: the residual at that time and position.
%
  [ c, xmin, xmax, t0, tstop ] = standing_wave_parameters ( );

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

  r = utt - c^2 * uxx;

  return
end
