Example 3.4 

To illustrate the process of using the matrizant, consider the initial value problem 

Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( 

                                                                                         (3.15) 

cTypesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn( 

This equation is solved in Maple by finding the matrizant below. 

> restart:
 

> with(linalg):with(plots):
 

Warning, the protected names norm and trace have been redefined and unprotected
 

Warning, the name changecoords has been redefined
 

> N:=1;
 

`:=`(N, 1) (1)
 

Enter the number of terms used in calculating the matrizant.  (Usually 6 terms are sufficient). 

> nvars:=6;
 

`:=`(nvars, 6) (2)
 

> Eq:=diff(c(t),t)=-t*c(t);
 

`:=`(Eq, diff(c(t), t) = `+`(`-`(`*`(t, `*`(c(t)))))) (3)
 

> A:=matrix(1,1,[-t]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (4)
 

> Y0:=matrix(1,1,[1]);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (5)
 

> id:=Matrix(N,N,shape=identity);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (6)
 

Define the two dummy variables X1 and X2 

> X1:=matrix(N,N);X2:=matrix(N,N);
 

`:=`(X1, array(1 .. 1, 1 .. 1, [])) (7)
 

`:=`(X2, array(1 .. 1, 1 .. 1, [])) (7)
 

A dummy variable t1 is used in the integration.  For matrix integration, Maple's 'map' command should be used. 

> X1:=map(int,subs(t=t1,evalm(A)),t1=0..t);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (8)
 

> mat := evalm(id + X1) ;
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (9)
 

We now have the first two terms of thematrizant.  The next step is to find the next five terms.  A 'do loop' can be written to find the matrizant: 

> for i from 2 to nvars do
S:=evalm( subs(t=t1,evalm(A))&*subs(t=t1,evalm(X1)) ):X2:=
map(int,S,t1=0..t):mat := evalm(mat +X2) :
X1:=evalm(X2):od : evalm(mat) ;
 

Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mo( (10)
 

> sol:=evalm(mat&*Y0);
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (11)
 

> C:=sol[1,1];
 

`:=`(C, `+`(`-`(`*`(`/`(1, 2), `*`(`^`(t, 2)))), 1, `*`(`/`(1, 8), `*`(`^`(t, 4))), `-`(`*`(`/`(1, 48), `*`(`*`(`^`(t, 6))))), `*`(`/`(1, 384), `*`(`^`(t, 8))), `-`(`*`(`/`(1, 3840), `*`(`*`(`^`(t, 10... (12)
 

Thus, the process yields a series solution in t for C.  This solution can be compared to the series solution given by Maple's 'dsolve' command: 

> dsolve({Eq,c(0)=1},c(t),type=series);
 

c(t) = series(`+`(1, `-`(`*`(`/`(1, 2), `*`(`^`(t, 2)))), `*`(`/`(1, 8), `*`(`^`(t, 4))))+O(`^`(t, 6)),t,6) (13)
 

By default, Maple gives a series solution accurate to the order of t6.  The order of the series solution can be increased by using Maple's order specification as: 

> Order:=14;
 

`:=`(Order, 14) (14)
 

> dsolve({Eq,c(0)=1},c(t),type=series);
 

c(t) = series(`+`(1, `-`(`*`(`/`(1, 2), `*`(`^`(t, 2)))), `*`(`/`(1, 8), `*`(`^`(t, 4))), `-`(`*`(`/`(1, 48), `*`(`^`(t, 6)))), `*`(`/`(1, 384), `*`(`^`(t, 8))), `-`(`*`(`/`(1, 3840), `*`(`^`(t, 10)))... (15)
 

We observe that the series solution obtained using the 'matrizant' method matches exactly with the series solution given by Maple's 'dsolve' command.