2.2.2 Problem 2

Solution using Matrix exponential method
Solution using explicit Eigenvalue and Eigenvector method
Maple
Mathematica
Sympy

Internal problem ID [18444]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 4. Autonomous systems. Exercises at page 69
Problem number : 2
Date solved : Monday, March 31, 2025 at 05:29:29 PM
CAS classification : system_of_ODEs

x=xy=x+2y

Solution using Matrix exponential method

In this method, we will assume we have found the matrix exponential eAt allready. There are different methods to determine this but will not be shown here. This is a system of linear ODE’s given as

x(t)=Ax(t)

Or

[xy]=[1012][xy]

For the above matrix A, the matrix exponential can be found to be

eAt=[et0e2tete2t]

Therefore the homogeneous solution is

xh(t)=eAtc=[et0e2tete2t][c1c2]=[etc1(e2tet)c1+e2tc2]

Since no forcing function is given, then the final solution is xh(t) above.

Solution using explicit Eigenvalue and Eigenvector method

This is a system of linear ODE’s given as

x(t)=Ax(t)

Or

[xy]=[1012][xy]

The first step is find the homogeneous solution. We start by finding the eigenvalues of A. This is done by solving the following equation for the eigenvalues λ

det(AλI)=0

Expanding gives

det([1012]λ[1001])=0

Therefore

det([1λ012λ])=0

Since the matrix A is triangular matrix, then the determinant is the product of the elements along the diagonal. Therefore the above becomes

(1λ)(2λ)=0

The roots of the above are the eigenvalues.

λ1=1λ2=2

This table summarises the above result

eigenvalue algebraic multiplicity type of eigenvalue
1 1 real eigenvalue
2 1 real eigenvalue

Now the eigenvector for each eigenvalue are found.

Considering the eigenvalue λ1=1

We need to solve Av=λv or (AλI)v=0 which becomes

([1012](1)[1001])[v1v2]=[00][0011][v1v2]=[00]

Now forward elimination is applied to solve for the eigenvector v. The augmented matrix is

[000110]

Since the current pivot A(1,1) is zero, then the current pivot row is replaced with a row with a non-zero pivot. Swapping row 1 and row 2 gives

[110000]

Therefore the system in Echelon form is

[1100][v1v2]=[00]

The free variables are {v2} and the leading variables are {v1}. Let v2=t. Now we start back substitution. Solving the above equation for the leading variables in terms of free variables gives equation {v1=t}

Hence the solution is

[v1t]=[tt]

Since there is one free Variable, we have found one eigenvector associated with this eigenvalue. The above can be written as

[v1t]=t[11]

Let t=1 the eigenvector becomes

[v1t]=[11]

Considering the eigenvalue λ2=2

We need to solve Av=λv or (AλI)v=0 which becomes

([1012](2)[1001])[v1v2]=[00][1010][v1v2]=[00]

Now forward elimination is applied to solve for the eigenvector v. The augmented matrix is

[100100]
R2=R2+R1[100000]

Therefore the system in Echelon form is

[1000][v1v2]=[00]

The free variables are {v2} and the leading variables are {v1}. Let v2=t. Now we start back substitution. Solving the above equation for the leading variables in terms of free variables gives equation {v1=0}

Hence the solution is

[v1t]=[0t]

Since there is one free Variable, we have found one eigenvector associated with this eigenvalue. The above can be written as

[v1t]=t[01]

Let t=1 the eigenvector becomes

[v1t]=[01]

The following table gives a summary of this result. It shows for each eigenvalue the algebraic multiplicity m, and its geometric multiplicity k and the eigenvectors associated with the eigenvalue. If m>k then the eigenvalue is defective which means the number of normal linearly independent eigenvectors associated with this eigenvalue (called the geometric multiplicity k) does not equal the algebraic multiplicity m, and we need to determine an additional mk generalized eigenvectors for this eigenvalue.

multiplicity
eigenvalue algebraic m geometric k defective? eigenvectors
1 1 1 No [11]
2 1 1 No [01]

Now that we found the eigenvalues and associated eigenvectors, we will go over each eigenvalue and generate the solution basis. The only problem we need to take care of is if the eigenvalue is defective. Since eigenvalue 1 is real and distinct then the corresponding eigenvector solution is

x1(t)=v1et=[11]et

Since eigenvalue 2 is real and distinct then the corresponding eigenvector solution is

x2(t)=v2e2t=[01]e2t

Therefore the final solution is

xh(t)=c1x1(t)+c2x2(t)

Which is written as

[xy]=c1[etet]+c2[0e2t]

Which becomes

[xy]=[c1etet(c1+c2et)]
Figure 2.49: Phase plot
Maple. Time used: 0.133 (sec). Leaf size: 23
ode:=[diff(x(t),t) = x(t), diff(y(t),t) = x(t)+2*y(t)]; 
dsolve(ode);
 
x(t)=c2ety(t)=c2et+c1e2t

Maple step by step

Let’s solve[ddtx(t)=x(t),ddty(t)=x(t)+2y(t)]Define vectorx(t)=[x(t)y(t)]Convert system into a vector equationddtx(t)=[1012]x(t)+[00]System to solveddtx(t)=[1012]x(t)Define the coefficient matrixA=[1012]Rewrite the system asddtx(t)=Ax(t)To solve the system, find the eigenvalues and eigenvectors ofAEigenpairs ofA[[1,[11]],[2,[01]]]Consider eigenpair[1,[11]]Solution to homogeneous system from eigenpairx1=et[11]Consider eigenpair[2,[01]]Solution to homogeneous system from eigenpairx2=e2t[01]General solution to the system of ODEsx=C1x1+C2x2Substitute solutions into the general solutionx=C1et[11]+C2e2t[01]Substitute in vector of dependent variables[x(t)y(t)]=[C1etet(C1+C2et)]Solution to the system of ODEs{x(t)=C1et,y(t)=et(C1+C2et)}
Mathematica. Time used: 0.003 (sec). Leaf size: 33
ode={D[x[t],t]==x[t],D[y[t],t]==x[t]+2*y[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
x(t)c1ety(t)et(c1(et1)+c2et)
Sympy. Time used: 0.066 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-x(t) + Derivative(x(t), t),0),Eq(-x(t) - 2*y(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
[x(t)=C1et, y(t)=C1et+C2e2t]