Octave comes with functions for computing the derivative and the integral
of a polynomial. The functions
both return new polynomials describing the result. As an example we'll
compute the definite integral of p(x) = x^2 + 1 from 0 to 3.
c = [1, 0, 1]; integral = polyint(c); area = polyval(integral, 3) - polyval(integral, 0) ⇒ 12
Return the coefficients of the derivative of the polynomial whose coefficients are given by the vector p. If a pair of polynomials is given, return the derivative of the product a*b. If two inputs and two outputs are given, return the derivative of the polynomial quotient b/a. The quotient numerator is in q and the denominator in d.
Return the coefficients of the integral of the polynomial whose coefficients are represented by the vector p. The variable k is the constant of integration, which by default is set to zero.