MATRICES AND MATRIX OPERATIONS: Unit 29
Dr. Wlodzislaw Kostecki
The Papua New Guinea University of Technology (PNGUT)
Department of Electrical and Communication Engineering
Lae, Morobe Province
Papua New Guinea
Copyright © 2000 by Wlodzislaw Kostecki
All rights reserved
-------------------------------------------------------------------
(29) Integration of matrices comprising functions
OBJECTIVES :
• To state the condition necessary for a matrix containing functions of one variable to have an integral with respect to this variable.
• To introduce the concept of an integrable matrix.
• To provide a definition of the indefinite integral of a matrix in the form of a symbolic expression.
• To provide an example of an indefinite integral of a rectangular matrix whose elements are functions.
• To specify and illustrate properties of matrix integration.
• To provide a definition of the definite integral of a matrix in the form of a symbolic expression.
• To state the condition necessary for a matrix containing functions of one variable to have a proper integral with respect to this variable.
• To provide an example of a proper integral of a square matrix whose elements are functions.
• To provide alternative methods of exact and floating-point evaluation of a proper integral of a matrix.
• To show how to evaluate a proper integral of a matrix whose elements are functions but the integration limits have a symbolic form and their numerical values become known in a later phase of computation.
• To point out that Maple can compute improper integrals of matrices comprising functions.
• To define the improper integral of a matrix and specify the two distinct cases of such an integral.
• To provide two examples of computation of improper matrix integrals due to infinite interval of integration.
• To provide two examples of computation of improper matrix integrals due to discontinuity of the integrand in the interval of integration.
> restart : with(linalg, equal, multiply) :
If some or all elements of a matrix [
A
] are
functions
of
one
variable
t
,
it is convenient to denote the matrix as [
A
(
)
] when considering integration of such a matrix.
A. Indefinite integrals
When those elements of a matrix [
A
(
)
] that are functions are
all
differentiable with respect to
in some common interval
<
<
,
then an
indefinite integral
of [
A
(
)
] with respect to
may be defined. Then, also the matrix [
A
(
)
] is said to be
integrable
in the interval
<
<
.
Consider a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 3, [a[11](t), a[12](t), a[13](t), a[21](t), a[22](t), a[23](t)]) : 'A(t)' = A(t) ;
The indefinite integral of [
A
(
)
] with respect to
is defined to be the matrix of the same order with elements
, viz.
> `indef_int(A)` := map(Int, A(t), t) : Int('A(t)', t) = matrix(`indef_int(A)`) ;
This operation can be displayed in "like-in-a-book" form, viz.
> Int(A(t), t) = matrix(`indef_int(A)`) ;
* * *
N.B.
The integration of the matrix elements returns the most general
antiderivative
or
primitive
of each element with the tacit understanding that
all
constants of integration are
.
* * *
For example, let the elements of a
(
×
)
matrix [
A
(
)
] be the functions as shown
> A(t) := matrix(2, 3, [2*exp(-3*t), sin(t/2), cosh(2*t), 3/sqrt(t), 2*t^2, 3*ln(2*t)]) : 'A(t)' = A(t) ;
The indefinite integral of [
A
(
)
] is the following
(
×
)
matrix:
> `indef_int(A)` := map(int, A(t), t) : Int('A(t)', t) = matrix(`indef_int(A)`) ;
or, in "like-in-a-book" form,
> Int(A(t), t) = matrix(`indef_int(A)`) ;
* * *
N.B.
If two matrices, [
A
(
)
] and [
B
(
)
], are conformable for addition and integrable in some common interval, the indefinite integral of their sum is equal to the sum of the antiderivatives of both matrices
For example, let
(
×
)
matrices [
A
(
)
] and [
B
(
)
] be given as
> A(t) := matrix(2, 3, [t, t^3, -1, t^2, 2*t, -3*t^2]) : B(t) := matrix(2, 3, [2, t^2, t^3, -2*t, 3*t^2, -1]) :
> 'A(t)' = A(t) ; 'B(t)' = B(t) ;
(a) The indefinite integral of the sum of the two matrices is the following
(
×
)
matrix:
> `indef_int(A+B)` := map(sort, map(int, evalm(A(t)+B(t)), t)) :
> Int(['A(t)' + 'B(t)'], t) = matrix(`indef_int(A+B)`) ;
(b) The sum of the antiderivatives of both matrices is the following
(
×
)
matrix:
> `indef_int(A) + indef_int(B)` := map(sort, evalm(map(int, A(t), t) + map(int, B(t), t))) :
> Int('A(t)', t) + Int('B(t)', t) = matrix(`indef_int(A) + indef_int(B)`) ;
The equal function applied to the resultant matrices of (a) and (b), i.e.
> equal(`indef_int(A+B)`, `indef_int(A) + indef_int(B)`) ;
returns the
Boolean
value
, which verifies that both matrices are equal.
* * *
N.B. The indefinite integral of the product of a scalar (number) and a matrix is equal to the product of the scalar and the matrix antiderivative
For example, consider a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 3, [t, t^3, -1, t^2, 2*t, -3*t^2]) : 'A(t)' = A(t) ;
and the scalar
.
> k := 3 :
(a) The indefinite integral of the product of the scalar and the matrix is the following
(
×
)
matrix:
> `indef_int(kA)` := map(int, evalm(k * A(t)), t) : Int('k*A(t)', t) = matrix(`indef_int(kA)`) ;
(b) The product of the scalar and the matrix antiderivative is the following
(
×
)
matrix:
> `k indef_int(A)` := evalm(k * map(int, A(t), t)) : 'k' * Int('A(t)', t) = matrix(`k indef_int(A)`) ;
Both matrices of (a) and (b) are equal by inspection.
* * *
N.B. The indefinite integral of a zero matrix [ 0 ] is the same zero matrix
=
[
0
]
For example, consider the
(
×
)
matrix [
0
]
> `0` := matrix(2, 3, [0, 0, 0, 0, 0, 0]) : `0` = matrix(`0`) ;
The indefinite integral of the matrix [ 0 ] is the same zero matrix
> `indef_int(0)` := map(int, `0`, t) : Int(`0`, t) = matrix(`indef_int(0)`) ;
* * *
B. Definite integrals
When those elements of a matrix [
A
(
)
] that are functions are
all
differentiable with respect to
in a common interval
,
then a
definite integral
of [
A
(
)
] over this interval may be defined.
Consider a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 3, [a[11](t), a[12](t), a[13](t), a[21](t), a[22](t), a[23](t)]) : 'A(t)' = A(t) ;
The definite integral of [
A
(
)
] over an interval
is defined to be the matrix of the same order with elements
,
viz.
> `def_int(A)` := map(Int, A(t), t=a..b) : Int('A(t)', t=a..b) = matrix(`def_int(A)`) ;
This operation can be displayed in "like-in-a-book" form, viz.
> Int(A(t), t=a..b) = matrix(`def_int(A)`) ;
(1) Proper integrals
If neither end point of the integration interval
is infinity and the integrand has no singularity in this interval, the integral is
proper
.
For example, consider a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 2, [9*exp(-2*t), 3/sqrt(t), sin(t/2), t*cos(t)]) : 'A(t)' = A(t) ;
and compute its integral over the interval
,
i.e.
> `prp_int(A)` := map(Int, A(t), t=1..3) : Int('A(t)', t=1..3) = matrix(`prp_int(A)`) ;
Exact evaluation of the resultant matrix may be performed using the function map together with the arrow-type procedure including the function value , viz.
> Int('A(t)', t=1..3) = map(x->value(x), `prp_int(A)`) ;
Floating-point evaluation of the exact resultant matrix may be done using any of the following alternative methods.
Method 1 . Using the function evalf and any of the functions evalm , matrix , or op :
> Int('A(t)', t=1..3) = evalf(evalm(`prp_int(A)`)) ; Int('A(t)', t=1..3) = evalf(matrix(`prp_int(A)`)) ; Int('A(t)', t=1..3) = evalf(op(`prp_int(A)`)) ;
Method 2 . Using the function convert together with the form (type) float and any of the functions evalm , matrix , or op :
> Int('A(t)', t=1..3) = convert(evalm(`prp_int(A)`), float) ; Int('A(t)', t=1..3) = convert(matrix(`prp_int(A)`), float) ; Int('A(t)', t=1..3) = convert(op(`prp_int(A)`), float) ;
Method 3 . Using the function map together with the arrow-type procedure including the function evalf :
> Int('A(t)', t=1..3) = map(x->evalf(x), `prp_int(A)`) ;
* * *
N.B.
Where the end points
and
of the integration interval
are not given in numerical form,
Maple
can evaluate the definite integral of a matrix symbolically.
For example, consider the same matrix [
A
(
)
] as before.
The integral of the matrix over the interval
is
> `prp_int(A)` := map(Int, A(t), t=a..b) : Int('A(t)', t=a..b) = matrix(`prp_int(A)`) ;
Symbolic evaluation of the matrix integral over the interval
yields the following matrix:
> `prp_int(A)` := map(x->value(x), `prp_int(A)`) : Int('A(t)', t=a..b) = matrix(`prp_int(A)`) ;
If numerical values of the integral limits are specified and input in a later phase of computations, e.g.
> a := Pi/4 : b := 3*Pi/2 : 'a' = a ; 'b' = b ;
then exact evaluation of the matrix may be performed as follows:
> `prp_int(A)` := eval(subs('a'=a, 'b'=b, matrix(`prp_int(A)`))) :
> Int('A(t)', t=a..b) = matrix(`prp_int(A)`) ;
Floating-point evaluation of the above matrix yields
> `prp_int(A)` := evalf(matrix(`prp_int(A)`)) : Int('A(t)', t=a..b) = matrix(`prp_int(A)`) ;
* * *
(2) Improper integrals
When the integrand tends to infinity at some point in the interval of integration or the interval itself is infinite in length, the integral is improper .
Maple is also able to compute integrals of matrices if improper integrals are involved. Consider the two cases of improper integrals.
CASE 1
. Improper integral due to infinite interval of integration
[
a
,
)
.
Example 1
. Compute the integral of a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 3) :
> A(t)[1,1] := exp(-5*t^2) : A(t)[1,2] := t^2*exp(-3*t^2) : A(t)[1,3] := exp(-2*t)*sin(t)/t : A(t)[2,1] := t/(exp(t)+1) : A(t)[2,2] := exp(-2*t^2)*cos(3*t) : A(t)[2,3] := t/(exp(t)-1) :
> A(t) := A(t) : 'A(t)' = A(t) ;
The integral of the matrix over the interval
[
,
)
is
> `imp_int(A)` := map(Int, A(t), t=0..infinity) : Int('A(t)', t=0..infinity) = matrix(`imp_int(A)`) ;
Symbolic evaluation of the matrix integral yields the following exact matrix:
> `imp_int(A)` := map(x->value(x), `imp_int(A)`) : Int('A(t)', t=0..infinity) = matrix(`imp_int(A)`) ;
Floating-point evaluation of the exact resultant matrix gives
> `imp_int(A)` := evalf(matrix(`imp_int(A)`)) : Int('A(t)', t=0..infinity) = matrix(`imp_int(A)`) ;
Example 2
. Compute the integral of a
(
×
)
matrix [
B
(
)
] given as
> B(t) := matrix(2, 3) :
> B(t)[1,1] := (sin(t)/t)^2 : B(t)[1,2] := sin(t)*cos(t/2)/t : B(t)[1,3] := 1/(1+t^2) : B(t)[2,1] := tan(t)/t : B(t)[2,2] := cos(t/4)*sin(t/2)/t : B(t)[2,3] := sin(2*t)/t :
> B(t) := B(t) : 'B(t)' = B(t) ;
The integral of the matrix over the interval
[
,
)
is
> `imp_int(B)` := map(Int, B(t), t=0..infinity) : Int('B(t)', t=0..infinity) = matrix(`imp_int(B)`) ;
Symbolic evaluation of the matrix integral yields the following exact matrix:
> `imp_int(B)` := map(x->value(x), `imp_int(B)`) : Int('B(t)', t=0..infinity) = matrix(`imp_int(B)`) ;
Floating-point evaluation of the exact resultant matrix gives
> `imp_int(B)` := evalf(matrix(`imp_int(B)`)) : Int('B(t)', t=0..infinity) = matrix(`imp_int(B)`) ;
CASE 2
. Improper integral due to discontinuity of the integrand in the interval of integration
.
Example 1
. Compute the integral over the interval
for a
(
×
)
matrix [
A
(
)
] given as
> A(t) := matrix(2, 2) :
> A(t)[1,1] := ln(t)/(t-1) : A(t)[1,2] := ln(1+t)/t : A(t)[2,1] := ln(t)/(t^2-1) : A(t)[2,2] := (1+t)*ln(t)/(t-1) :
> A(t) := A(t) : 'A(t)' = A(t) ;
The integral of the matrix over the interval
is
> `imp_int(A)` := map(Int, A(t), t=0..1) : Int('A(t)', t=0..1) = matrix(`imp_int(A)`) ;
Notice that each integrand has a singularity at either
or
in the sense that the integrand tends to infinity as
or
,
respectively.
Symbolic evaluation of the matrix integral yields the following exact matrix:
> `imp_int(A)` := map(x->value(x), `imp_int(A)`) : Int('A(t)', t=0..1) = matrix(`imp_int(A)`) ;
Floating-point evaluation of the exact resultant matrix gives
> `imp_int(A)` := evalf(matrix(`imp_int(A)`)) : Int('A(t)', t=0..1) = matrix(`imp_int(A)`) ;
Example 2
. Compute the integral over the interval
for a
(
×
)
matrix [
B
(
)
] given as
> B(t) := matrix(2, 2) :
> B(t)[1,1] := (sin(4*t)/sin(t))^2 : B(t)[1,2] := ln(cos(t)^4) : B(t)[2,1] := 1/sqrt(t) : B(t)[2,2] := ln(1/cos(t)) :
> B(t) := B(t) : 'B(t)' = B(t) ;
The integral of the matrix over the interval
is
> `imp_int(B)` := map(Int, B(t), t=0..Pi/2) : Int('B(t)', t=0..Pi/2) = matrix(`imp_int(B)`) ;
Notice that each integrand has a singularity in the interval
at either
or
in the sense that the integrand tends to infinity as
or
,
respectively.
Symbolic evaluation of the matrix integral yields the following exact matrix:
> `imp_int(B)` := map(x->value(x), `imp_int(B)`) : Int('B(t)', t=0..Pi/2) = matrix(`imp_int(B)`) ;
Floating-point evaluation of the exact resultant matrix gives
> `imp_int(B)` := evalf(matrix(`imp_int(B)`)) : Int('B(t)', t=0..Pi/2) = matrix(`imp_int(B)`) ;
Disregarding the meaningless imaginary parts simplifies the above to
> `imp_int(B)` := evalm(Re(`imp_int(B)`)) : Int('B(t)', t=0..Pi/2) = matrix(`imp_int(B)`) ;
* * *
Proceed to Unit (30) for " Application of the function exp( [ A ] t ) in solving matrix equations ".
-------------------------------------------------------------------