function [ ntab2, xtab2, diftab2 ] = dif_antideriv ( ntab, xtab, diftab )

%*****************************************************************************80
%
%% dif_antideriv() computes the antiderivative of a divided difference polynomial.
%
%  Discussion:
%
%    The routine uses the divided difference representation
%    of a polynomial to compute the divided difference representation
%    of the antiderivative of the polynomial.
%
%    The antiderivative of a polynomial P(X) is any polynomial Q(X)
%    with the property that d/dX Q(X) = P(X).
%
%    This routine chooses the antiderivative whose constant term is zero.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer NTAB, the size of the difference table.
%
%    real XTAB(NTAB), the abscissas of the difference table.
%
%    real DIFTAB(NTAB), the difference table.
%
%  Output:
%
%    integer NTAB2, the size of the difference table for the
%    antiderivative, which will be NTAB+1.
%
%    real XTAB2(NTAB2), the abscissas of the
%    difference table for the antiderivative.
%
%    real DIFTAB2(NTAB2), the difference table
%    for the antiderivative.
%

%
%  Copy the input data, and shift the abscissas to zero.
%
  xtab1(1:ntab) = xtab(1:ntab);
  diftab1(1:ntab) = diftab(1:ntab);

  [ xtab1, diftab1 ] = dif_shift_zero ( ntab, xtab1, diftab1 );
%
%  Append a final zero to XTAB.
%
  ntab2 = ntab + 1;
  xtab2(1:ntab2) = 0.0;
%
%  Get the antiderivative of the standard form polynomial.
%
  d = ntab - 1;
  diftab2 = r8poly_ant_coef ( d, diftab1 );

  return
end
