function y = r8poly_ant_value ( d, c, x )

%*****************************************************************************80
%
%% r8poly_ant_value() evaluates the antiderivative of a polynomial.
%
%  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 constant term of the antiderivative is taken to be zero.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 October 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer D: the degree of the polynomial.
%
%    real C(1:D+1), the polynomial coefficients.
%
%    real X: the evaluation point.
%
%  Output:
%
%    real Y: the value of the antiderivative at X.
%
  y = 0.0;
  for i = d : -1 : 0
    y = ( y + c(i+1) / ( i + 1 ) ) * x;
  end

  return
end
