Definite integral of a polynomial
Syntax
I = polydefint(p,a,b)
Description
I = polydefint(p,a,b), returns the value I of the definite integral of polynomial p (in MATLAB® polynomial form) over the real interval [a,b].
Examples
Example 1 − A simple example:
The definite integral
can be evaluated by first creating a row vector to represent the polynomial
, i.e.,
p = [3 0 -4 10 -25];
and then using polydefint to integrate over the interval 
I = polydefint(p,-1,3)
I = 49.0667
Example 2 − The orthogonality of Legendre polynomials:
where
is the Kronecker delta, equal to 1 if m = n and to 0 otherwise. This property can be demonstrated by first creating two Legendre polynomials, for example,
by using the polyLegendre function:
P2 = polyLegendre(2)
P3 = polyLegendre(3)
and then integrating the products
,
and
(computed using the conv function for polynomial mulitplication) over the interval
by using the polydefint function:
I22 = polydefint(conv(P2,P2),-1,1)
I22 = 0.4000
I23 = polydefint(conv(P2,P3),-1,1)
I23 = 0
I33 = polydefint(conv(P3,P3),-1,1)
I33 = 0.2857
Note that I23 = 0 while
[sym(I22), sym(I33)]
which are equal to
for
and
, respectively.
This function is part of……..