function [ l, u ] = dif2_lu ( n )

%*****************************************************************************80
%
%% dif2_lu() returns the LU factors of the DIF2 matrix.
%
%  Discussion:
%
%    A = L * U
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 October 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of A.
%
%  Output:
%
%    real L(N,N), U(N,N), the LU factors of A.
%
  l = zeros ( n, n );
  for i = 1 : n
    l(i,i) = 1.0;
  end
  for i = 1 : n - 1
    l(i+1,i) = - i / ( i + 1 );
  end

  u = zeros ( n, n );
  for i = 1 : n
    u(i,i) = ( i + 1 ) / i;
  end
  for i = 1 : n - 1
    u(i,i+1) = -1.0;
  end

  return
end
