374 Non-Homogeneous System Example on Mathematica

Solve X' = A X + B with A =

8
-3
16
-8

and B(t) =
t

Sin[t]
.
A={{8,-3},{16,-8}}
{{8,-3},{16,-8}}
MatrixForm[%]

8
-3
16
-8

Eigenvalues[A]
{-4,4}
Eigenvectors[A]
{{1,4},{3,4}}
Here is the general solution to the homogeneous problem.
X
c
[t_]:=
c
1
*{{3},{4}}*
4t

+
c
2
*{{1},{4}}*
-4t

X
c
[t]
{{3
4t

c
1
+
-4t

c
2
},{4
4t

c
1
+4
-4t

c
2
}}
MatrixForm[
X
c
[t]]
3
4t

c
1
+
-4t

c
2
4
4t

c
1
+4
-4t

c
2
B[t_]:={{
t

},{Sin[t]}}
MatrixForm[B[t]]
t

Sin[t]
Put two linearly independent solutions
X
1
and
X
2
to the homogeneous problem as column vectors in a matrix,
Y={
X
1
X
2
}
. Looking for solutions to the non-homogeneous problem X' = A X + B(t) of the form
X
p
=
b
1
(t)
X
1
+
b
2
(t)
X
2
leads to a way to find
b
1
and
b
2
.
MatrixForm[{{3
4t

,
-4t

},{4
4t

,4
-4t

}}]
3
4t

-4t

4
4t

4
-4t

MatrixForm[Inverse[%]]
-4t

2
-
1
8
-4t

-
4t

2
3
4t

8
MatrixForm[%.B[t]]
-3t

2
-
1
8
-4t

Sin[t]
-
5t

2
+
3
8
4t

Sin[t]
MatrixForm[Integrate[%,t]]
1
408
-4t

(-68
t

+3Cos[t]+12Sin[t])
-
1
680
4t

(68
t

+15Cos[t]-60Sin[t])
Simplify[%]

1
408
-4t

(-68
t

+3Cos[t]+12Sin[t]),-
1
680
4t

(68
t

+15Cos[t]-60Sin[t])
Here is the solution for
b
1
and
b
2
, in the form
b
1
b
2
.
MatrixForm[%]
1
408
-4t

(-68
t

+3Cos[t]+12Sin[t])
-
1
680
4t

(68
t

+15Cos[t]-60Sin[t])
Here is a particular solution:
X
p
[t_]:=
1
408
-4t

(-68
t

+3Cos[t]+12Sin[t])*
3
4
*
4t

+-
1
680
4t

(68
t

+15Cos[t]-60Sin[t])*
1
4
*
-4t

Check that it works!
X
p
'[t]-A.
X
p
[t]

1
136
(-68
t

+12Cos[t]-3Sin[t])+
1
680
(-68
t

+60Cos[t]+15Sin[t])-8
1
136
(-68
t

+3Cos[t]+12Sin[t])+
1
680
(-68
t

-15Cos[t]+60Sin[t])+3
1
102
(-68
t

+3Cos[t]+12Sin[t])+
1
170
(-68
t

-15Cos[t]+60Sin[t]),
1
102
(-68
t

+12Cos[t]-3Sin[t])+
1
170
(-68
t

+60Cos[t]+15Sin[t])-16
1
136
(-68
t

+3Cos[t]+12Sin[t])+
1
680
(-68
t

-15Cos[t]+60Sin[t])+8
1
102
(-68
t

+3Cos[t]+12Sin[t])+
1
170
(-68
t

-15Cos[t]+60Sin[t])
Simplify[%]
{{
t

},{Sin[t]}}
Check that the general solution works!
X[t_]:=
X
c
[t]+
X
p
[t]
X'[t]-A.X[t]-B[t]
-
t

+
1
136
(-68
t

+12Cos[t]-3Sin[t])+
1
680
(-68
t

+60Cos[t]+15Sin[t])+12
4t

c
1
-4
-4t

c
2
-8
1
136
(-68
t

+3Cos[t]+12Sin[t])+
1
680
(-68
t

-15Cos[t]+60Sin[t])+3
4t

c
1
+
-4t

c
2
+3
1
102
(-68
t

+3Cos[t]+12Sin[t])+
1
170
(-68
t

-15Cos[t]+60Sin[t])+4
4t

c
1
+4
-4t

c
2
,
1
102
(-68
t

+12Cos[t]-3Sin[t])-Sin[t]+
1
170
(-68
t

+60Cos[t]+15Sin[t])+16
4t

c
1
-16
-4t

c
2
-16
1
136
(-68
t

+3Cos[t]+12Sin[t])+
1
680
(-68
t

-15Cos[t]+60Sin[t])+3
4t

c
1
+
-4t

c
2
+8
1
102
(-68
t

+3Cos[t]+12Sin[t])+
1
170
(-68
t

-15Cos[t]+60Sin[t])+4
4t

c
1
+4
-4t

c
2

Simplify[%]
{{0},{0}}