Example 3.5

The method described for example 3.4 can beused to solve boundary value problems. Consider the boundary value problem given by the Airy differential equation:

(3.16)

The procedure for solving this boundary value problem is the same as that of section 3.1.2 except that instead of the exponential matrix, the matrizant must be used.

> | 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:=2;

| (1)

> | nvars:=6;

| (2)

> | Eq:=diff(y(x),x$2)=x*y(x);

| (3)

> | A:=matrix(2,2,[0,1,x,0]);

| (4)

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

| (5)

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

| (6)

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

| (7)

| (7)

> | X1:=map(int,subs(x=x1,evalm(A)),x1=0..x);

| (8)

> | mat := evalm(id + X1) ;

| (9)

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

> | evalm(mat) ;

| (10)

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

| (11)

> | y:=sol[1,1];

| (12)

> | dydx:=sol[2,1];

| (13)

Now the unknown constant c1 is solved by using the boundary condition at x = 1.

> | bc2:=subs(x=1,dydx)=0;

| (14)

> | c[1]:=solve(bc2,c[1]);

| (15)

> | y:=eval(y);

| (16)

Readers can verify this series solution with the series solution obtained by using Maple's 'dsolve' command.