Skip to content

polyint

Polynomial Integration

q = polyint(p, c)

  • p should be a vector, real or complex, containing the coefficients of the polynomial $$ p(x)=p_1x^n+p_2x^{n-1}+\cdots+p_nx +p_{n+1}, $$ with p(1) being the highest order term.
  • q is contains the coefficients of the integration $$ q(x)=\int p(x)dx=\frac{1}{n+1}p_1x^{n+1}+\frac1{n}p_2x^{n}+\cdots+\frac{1}{2}p_nx^2+p_{n+1}x+c, $$ where c is given by the input argument c.
  • c should be a scalar, real or complex.

q = polyint(p)

  • It is the same as q = polyint(p, 0).

Example 1: Integrating a real polynomial with a complex constant term.

q = polyint(1:4,0.5i)
q =
Columns 1 through 2:
 0.250 + 0.000i   0.667 + 0.000i
Columns 3 through 4:
 1.500 + 0.000i   4.000 + 0.000i
Column 5:
 0.000 + 0.500i