next up previous contents
Next: The Evaluation Method: Up: Polynomial Integration: Previous: The Antiderivative of a

The Definite Integral of a Polynomial:

    // ***************************************** //
    //   Definite Integral Function              //
    // ***************************************** //
FLOAT FLOAT_POLY::definite_integral(FLOAT a,FLOAT b)
{
  FLOAT value;
  if(head==NULL){
    //the incoming polynomial is degenerate
    //cout << "The incoming polynomial is degenerate" << endl;
    value = 0;
    return(value);
    }
  else{
    //P is non NULL
    FLOAT_POLY P = integral();
    value = P(b) - P(a);
    return(value);
    }
}



Jim Peterson
1999-04-22