2.4.70 Problem 67

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

Internal problem ID [8958]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 67
Date solved : Friday, April 25, 2025 at 05:25:55 PM
CAS classification : system_of_ODEs

x=x+2y+2t+1y=5x+y+3t1

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)+G(t)

Or

[xy]=[1251][xy]+[2t+13t1]

Since the system is nonhomogeneous, then the solution is given by

x(t)=xh(t)+xp(t)

Where xh(t) is the homogeneous solution to x(t)=Ax(t) and xp(t) is a particular solution to x(t)=Ax(t)+G(t). The particular solution will be found using variation of parameters method applied to the fundamental matrix. For the above matrix A, the matrix exponential can be found to be

eAt=[etcosh(t10)etsinh(t10)105etsinh(t10)102etcosh(t10)]

Therefore the homogeneous solution is

xh(t)=eAtc=[etcosh(t10)etsinh(t10)105etsinh(t10)102etcosh(t10)][c1c2]=[etcosh(t10)c1+etsinh(t10)10c25etsinh(t10)10c12+etcosh(t10)c2]

The particular solution given by

xp(t)=eAteAtG(t)dt

But

eAt=(eAt)1=[etcosh(t10)et10sinh(t10)5et10sinh(t10)2etcosh(t10)]

Hence

xp(t)=[etcosh(t10)etsinh(t10)105etsinh(t10)102etcosh(t10)][etcosh(t10)et10sinh(t10)5et10sinh(t10)2etcosh(t10)][2t+13t1]dt=[etcosh(t10)etsinh(t10)105etsinh(t10)102etcosh(t10)][(cosh(t)sinh(t))(63sinh(t10)10t+180cosh(t10)t67sinh(t10)1085cosh(t10))405(cosh(t)sinh(t))(36sinh(t10)10t+126cosh(t10)t+17sinh(t10)10+134cosh(t10))162]=[et(36t17)(cosh(t)sinh(t))81et(63t+67)(cosh(t)sinh(t))81]

Hence the complete solution is

x(t)=xh(t)+xp(t)=[4(9c1cosh(t10)49c210sinh(t10)20+(t1736)(cosh(t)sinh(t)))et97et(9c2cosh(t10)79c110sinh(t10)14+(t+6763)(cosh(t)sinh(t)))9]

Solution using explicit Eigenvalue and Eigenvector method

This is a system of linear ODE’s given as

x(t)=Ax(t)+G(t)

Or

[xy]=[1251][xy]+[2t+13t1]

Since the system is nonhomogeneous, then the solution is given by

x(t)=xh(t)+xp(t)

Where xh(t) is the homogeneous solution to x(t)=Ax(t) and xp(t) is a particular solution to x(t)=Ax(t)+G(t). The particular solution will be found using variation of parameters method applied to the fundamental matrix.

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([1251]λ[1001])=0

Therefore

det([1λ251λ])=0

Which gives the characteristic equation

λ22λ9=0

The roots of the above are the eigenvalues.

λ1=1+10λ2=110

This table summarises the above result

eigenvalue algebraic multiplicity type of eigenvalue
110 1 real eigenvalue
1+10 1 real eigenvalue

Now the eigenvector for each eigenvalue are found.

Considering the eigenvalue λ1=110

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

([1251](110)[1001])[v1v2]=[00][102510][v1v2]=[00]

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

[10205100]
R2=R210R12[1020000]

Therefore the system in Echelon form is

[10200][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=t105}

Hence the solution is

[v1t]=[t105t]

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

[v1t]=t[1051]

Let t=1 the eigenvector becomes

[v1t]=[1051]

Which is normalized to

[v1t]=[105]

Considering the eigenvalue λ2=1+10

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

([1251](1+10)[1001])[v1v2]=[00][102510][v1v2]=[00]

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

[10205100]
R2=R2+10R12[1020000]

Therefore the system in Echelon form is

[10200][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=t105}

Hence the solution is

[v1t]=[t105t]

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

[v1t]=t[1051]

Let t=1 the eigenvector becomes

[v1t]=[1051]

Which is normalized to

[v1t]=[105]

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+10 1 1 No [1051]
110 1 1 No [1051]

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+10 is real and distinct then the corresponding eigenvector solution is

x1(t)=v1e(1+10)t=[1051]e(1+10)t

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

x2(t)=v2e(110)t=[1051]e(110)t

Therefore the homogeneous solution is

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

Which is written as

[xy]=c1[e(1+10)t105e(1+10)t]+c2[e(110)t105e(110)t]

Now that we found homogeneous solution above, we need to find a particular solution xp(t). We will use Variation of parameters. The fundamental matrix is

Φ=[x1x2]

Where xi are the solution basis found above. Therefore the fundamental matrix is

Φ(t)=[e(1+10)t105e(110)t105e(1+10)te(110)t]

The particular solution is then given by

xp(t)=ΦΦ1G(t)dt

But

Φ1=[e(1+10)t104e(1+10)t210e(1+10)t4e(1+10)t2]

Hence

xp(t)=[e(1+10)t105e(110)t105e(1+10)te(110)t][e(1+10)t104e(1+10)t210e(1+10)t4e(1+10)t2][2t+13t1]dt=[e(1+10)t105e(110)t105e(1+10)te(110)t][e(1+10)t(2t10+10+6t2)4e(1+10)t(2t10+106t+2)4]dt=[e(1+10)t105e(110)t105e(1+10)te(110)t][(18t10+1851018t572)e(1+10)t(2t10+10+6t2)648t5184+162010(18t10+18510+18t+572)e(1+10)t(2t10+106t+2)324(2t+16+510)]=[72t31118t2+436t+51162t2+2592t+243126t32150t22333t201162t2+2592t+243]

Now that we found particular solution, the final solution is

x(t)=xh(t)+xp(t)[xy]=[c1e(1+10)t105c1e(1+10)t]+[c2e(110)t105c2e(110)t]+[72t31118t2+436t+51162t2+2592t+243126t32150t22333t201162t2+2592t+243]

Which becomes

[xy]=[c1e(1+10)t105c2e(1+10)t1054t9+1781c1e(1+10)t+c2e(1+10)t7t96781]

Maple. Time used: 0.127 (sec). Leaf size: 67
ode:=[diff(x(t),t) = x(t)+2*y(t)+2*t+1, diff(y(t),t) = 5*x(t)+y(t)+3*t-1]; 
dsolve(ode);
 
x(t)=e(1+10)tc2+e(1+10)tc14t9+1781y(t)=e(1+10)tc2102e(1+10)tc11027t96781

Maple step by step

Let’s solve[ddtx(t)=x(t)+2y(t)+2t+1,ddty(t)=5x(t)+y(t)+3t1]Define vectorx(t)=[x(t)y(t)]Convert system into a vector equationddtx(t)=[1251]x(t)+[2t+13t1]System to solveddtx(t)=[1251]x(t)+[2t+13t1]Define the forcing functionf(t)=[2t+13t1]Define the coefficient matrixA=[1251]Rewrite the system asddtx(t)=Ax(t)+fTo solve the system, find the eigenvalues and eigenvectors ofAEigenpairs ofA[[110,[1051]],[1+10,[1051]]]Consider eigenpair[110,[1051]]Solution to homogeneous system from eigenpairx1=e(110)t[1051]Consider eigenpair[1+10,[1051]]Solution to homogeneous system from eigenpairx2=e(1+10)t[1051]General solution of the system of ODEs can be written in terms of the particular solutionxp(t)x(t)=C1x1+C2x2+xp(t)Fundamental matrixLetϕ(t)be the matrix whose columns are the independent solutions of the homogeneous system.ϕ(t)=[e(110)t105e(1+10)t105e(110)te(1+10)t]The fundamental matrix,Φ(t)is a normalized version ofϕ(t)satisfyingΦ(0)=IwhereIis the identity matrixΦ(t)=ϕ(t)1ϕ(0)Substitute the value ofϕ(t)andϕ(0)Φ(t)=[e(110)t105e(1+10)t105e(110)te(1+10)t]1[10510511]Evaluate and simplify to get the fundamental matrixΦ(t)=[et(et10+et10)2et10(et10et10)10et10(et10et10)4et(et10+et10)2]Find a particular solution of the system of ODEs using variation of parametersLet the particular solution be the fundamental matrix multiplied byv(t)and solve forv(t)xp(t)=Φ(t)v(t)Take the derivative of the particular solutionddtxp(t)=(ddtΦ(t))v(t)+Φ(t)(ddtv(t))Substitute particular solution and its derivative into the system of ODEs(ddtΦ(t))v(t)+Φ(t)(ddtv(t))=AΦ(t)v(t)+f(t)The fundamental matrix has columns that are solutions to the homogeneous system so its derivative follows that of the homogeneous systemAΦ(t)v(t)+Φ(t)(ddtv(t))=AΦ(t)v(t)+f(t)Cancel like termsΦ(t)(ddtv(t))=f(t)Multiply by the inverse of the fundamental matrixddtv(t)=1Φ(t)f(t)Integrate to solve forv(t)v(t)=0t1Φ(s)f(s)dsPlugv(t)into the equation for the particular solutionxp(t)=Φ(t)0t1Φ(s)f(s)dsPlug in the fundamental matrix and the forcing function and computexp(t)=[67sinh(t10)et1040517cosh(t10)et814t9+178117sinh(t10)et10162+67cosh(t10)et817t96781]Plug particular solution back into general solutionx(t)=C1x1+C2x2+[67sinh(t10)et1040517cosh(t10)et814t9+178117sinh(t10)et10162+67cosh(t10)et817t96781]Substitute in vector of dependent variables[x(t)y(t)]=[(85+(162C167)10)e(1+10)t810+(85+(162C2+67)10)e(1+10)t8104t9+1781e(1+10)t(1710+324C1+134)324+(1710+324C2+134)e(1+10)t3247t96781]Solution to the system of ODEs{x(t)=(85+(162C167)10)e(1+10)t810+(85+(162C2+67)10)e(1+10)t8104t9+1781,y(t)=e(1+10)t(1710+324C1+134)324+(1710+324C2+134)e(1+10)t3247t96781}
Mathematica. Time used: 11.167 (sec). Leaf size: 158
ode={D[x[t],t]==x[t]+2*y[t]+2*t+1,D[y[t],t]==5*x[t]+y[t]+3*t-1}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
x(t)1810et10t(e(101)t(170360t)+81(5c1+10c2)e210t+81(5c110c2))y(t)1324et10t(4e(101)t(63t+67)+81(10c1+2c2)e210t81(10c12c2))
Sympy. Time used: 0.466 (sec). Leaf size: 82
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*t - x(t) - 2*y(t) + Derivative(x(t), t) - 1,0),Eq(-3*t - 5*x(t) - y(t) + Derivative(y(t), t) + 1,0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
[x(t)=10C1et(1+10)510C2et(110)54t9+1781, y(t)=C1et(1+10)+C2et(110)7t96781]