function c2 = poly_antideriv ( c1 )

%*****************************************************************************80
%
%% poly_antideriv integrates a polynomial in standard form.
%
%  Discussion:
%
%    The power sum form of a polynomial is:
%
%      p(x) = c(0) + c(1) * x + ... + c(n-1) * x^(n-1) + c(n) * x^(n)
%
%    Because MATLAB doesn't allow 0 indexing, we use an adjusted formula:
%
%      p(x) = c(1) + c(2) * x + ... + c(n) * x^(n-1) + c(n+1) * x^(n)
%
%    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 GNU LGPL license.
%
%  Modified:
%
%    15 October 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real C1(1:D1+1): the polynomial coefficients.
%    C1(1) is the constant term, and C1(D1+1) is the
%    coefficient of X^(D1).
%
%  Output:
%
%    real C2(1:D2+1): the coefficients of
%    the antiderivative polynomial, in standard form.  The constant
%    term is set to zero.
%
  d1 = length ( c1 ) - 1;
  d2 = d1 + 1;
  c2(1:d2+1) = 0.0;
%
%  Set the constant term.
%
  c2(1) = 0.0;
%
%  Integrate the polynomial.
%
  for i = 1 : d2
    c2(i+1) = c1(i) / i;
  end

  return
end
