Solve Linear System of ODEs: x',y' w/ Initial Conditions x(0),y(0)

In summary, a linear system of ODEs is a set of differential equations that can be written in the form of Ax' + By' = Cx + Dy, where x and y are functions of a single variable, and A, B, C, and D are constants. To solve a linear system of ODEs, various methods such as substitution, elimination, or matrix methods can be used depending on the complexity of the system. Initial conditions, which refer to the values of the dependent variables at a specific point, are important in finding a unique solution for the system. Linear systems of ODEs can have multiple solutions, but each solution must satisfy the given initial conditions. They have real-world applications in fields such as physics
  • #1
Euge
Gold Member
MHB
POTW Director
2,073
244
Solve the linear system of ODE ##x' = 2x + 3y##, ##y' = -3x + y## with initial conditions ##x(0) = 1, y(0) = 2##.
 
  • Like
Likes benorin
Physics news on Phys.org
  • #2
The differential equation

\begin{align*}
\frac{d}{dt} \binom{x}{y} =
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{x}{y}
\end{align*}

with initial conditions ##x(0)=1##, ##y(0) = 2## has the solution:

\begin{align*}
\binom{x}{y} = \exp \left\{
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix} t \right\}
\binom{1}{2}
\end{align*}

When the eigenvalues are complex and distinct such that ##\lambda_1 = \overline{\lambda_2} = a+ib## we have that

\begin{align*}
e^{At} = e^{at} \cos (bt) \mathbb{1} + \dfrac{e^{at} \sin (bt)}{b} (A - a \mathbb{1}) \qquad (*) .
\end{align*}

We will prove this formula is correct by showing that ##\frac{d}{dt} (RHS) = A (RHS)## and by noting that the ##RHS = \mathbb{1}## at ##t = 0##. By the Cayley-Hamilton theorem we have ##A^2 = 2a A - (a^2+b^2) \mathbb{1}##. We use this in the form ##A (A - a \mathbb{1}) = aA - (a^2 + b^2) \mathbb{1}## in the proof of ##\frac{d}{dt} (RHS) = A (RHS)##,

\begin{align*}
& \frac{d}{dt} \left[ e^{at} \cos (bt) \mathbb{1} + \dfrac{e^{at} \sin (bt)}{b} (A - a \mathbb{1}) \right]
\nonumber \\
& = a e^{at} \cos (bt) \mathbb{1} - b e^{at} \sin (bt) \mathbb{1} + \dfrac{a e^{at} \sin (bt)}{b} (A - a \mathbb{1}) + e^{at} \cos (bt) (A - a \mathbb{1})
\nonumber \\
& = A e^{at} \cos (bt) \mathbb{1} + \dfrac{e^{at} \sin (bt)}{b} (aA - (a^2 + b^2) \mathbb{1})
\nonumber \\
& = A \left[ e^{at} \cos (bt) \mathbb{1} + \dfrac{e^{at} \sin (bt)}{b} (A - a \mathbb{1}) \right] .
\end{align*}

The eigenvalues are determined by

\begin{align*}
\det
\begin{pmatrix}
2 - \lambda & 3 \\
-3 & 1 - \lambda
\end{pmatrix}
= 0
\end{align*}

or

\begin{align*}
\lambda^2 - 3 \lambda + 11 = 0
\end{align*}

so that

\begin{align*}
\lambda_1 = \frac{3}{2} + \frac{\sqrt{35}}{2} i , \quad \lambda_2 = \frac{3}{2} - \frac{\sqrt{35}}{2} i .
\end{align*}

So that by ##(*)## we have

\begin{align*}
e^{At} & = e^{3 t/2} \cos (\frac{ \sqrt{35} }{2} t)
\begin{pmatrix}
1 & 0 \\
0 & 1
\end{pmatrix}
+ e^{3 t/2} \dfrac{\sin (\frac{ \sqrt{35} }{2} t)}{\sqrt{35}}
\begin{pmatrix}
1 & 6 \\
-6 & -1
\end{pmatrix}
\end{align*}

So

\begin{align*}
\binom{x}{y} = e^{2 t/3} \cos (\frac{ \sqrt{35} }{2}t) \binom{1}{2}
+ e^{2 t/3} \dfrac{\sin (\frac{ \sqrt{35} }{2}t)}{\sqrt{35}} \binom{13}{-8}
\end{align*}
 
Last edited:
  • Like
Likes Office_Shredder
  • #3
In the previous post I wrote down slightly the wrong matrix. I've now written down the correct matrix and recalculated the eigenvalues.

By the way, there are other methods of solving the problem!
 
Last edited:
  • #4
julian said:
By the way, there are other methods of solving the problem!

The system is equivalent to two second order ODE's
$$ y'' - 3y'+11y , y(0)=2$$

$$ x''-3x'+11x=0, x(0)=1 $$

Algebraic error fixed ( hopefully)...
 
Last edited:
  • Like
Likes julian
  • #5
When working with these types of problems is it implied that x = x(t) and y = y(t).
 
  • #6
Mayhem said:
When working with these types of problems is it implied that x = x(t) and y = y(t).
Yes, they are functions of ##t##.
 
Last edited:
  • #7
erobz said:
The system is equivalent to two second order ODE's
$$ y'' - 3y'+11y , y(0)=2$$

$$ x''-3x'+11x=0, x(0)=1 $$

Algebraic error fixed ( hopefully)...
Because you have a second order differential equation the general solution will involve two unknown constants, so you need ##x(0)## and ##x'(0)##. Now, ##x'(0)## was not specified in the question but that does not present a problem because you are given a formula for ##x'(t)##. Yep?

Do you know how to go about solving your differential equation? It is a homogeneous linear differential equation of second order with constant coefficients.
 
Last edited:
  • #8
julian said:
Because you have a second order differential equation the general solution will involve two unknown constants, so you need ##x(0)## and ##x'(0)##. Now, ##x'(0)## was not specified in the question but that does not present a problem because you are given a formula for ##x'(t)##. Yep?
Using the original equations and given initial conditions we find ## x'(0) = 8, y'(0) = -1##

julian said:
Do you know how to go about solving your differential equation? It is a homogeneous linear differential equation of second order with constant coefficients.

With an old textbook in front of me... Find the auxiliary equation:

$$m^2 -3m+11 = 0 \implies m = \frac{3}{2} \pm \frac{\sqrt{35}i}{2} $$

I think that implies the general solution ( for ##y## or ##x## - same ODE - different i.c. ):

$$ x(t) = y(t) = e^{ \left( \frac{3}{2}t \right) } \left( c_1 \cos \left( \frac{ \sqrt{35} }{2} t \right) + c_2 \sin \left( \frac{ \sqrt{35} }{2} t \right) \right) $$
 
  • Like
Likes julian
  • #9
There are a couple of other methods of solving the problem.

Start with the "exponential ansatz":

\begin{align*}
\binom{x(t)}{y(t)} = \binom{C}{D} e^{\lambda t} .
\end{align*}

Substituting this into

\begin{align*}
\binom{x'}{y'} =
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{x}{y}
\end{align*}

we arrive at the eigenvector problem

\begin{align*}
\lambda \binom{C}{D} =
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{C}{D}
\end{align*}

Let's find the eigenvalues:

\begin{align*}
\det
\begin{pmatrix}
2 - \lambda & 3 \\
-3 & 1 - \lambda
\end{pmatrix}
= 0
\end{align*}

or

\begin{align*}
\lambda^2 - 3 \lambda + 11 = 0
\end{align*}

so that

\begin{align*}
\lambda_1 = \frac{3}{2} + i \frac{\sqrt{35}}{2} , \qquad \lambda_2 = \frac{3}{2} - i \frac{\sqrt{35}}{2}
\end{align*}

As the eigenvalues are the complex conjugate of each other one of the eigenvectors will be proportional to the complex conjugate of the other. The eigenvector equation is

\begin{align*}
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{C}{D} =
(\frac{3}{2} + i \frac{\sqrt{35}}{2}) \binom{C}{D}
\end{align*}

or

\begin{align*}
\begin{pmatrix}
4 & 6 \\
-6 & 2
\end{pmatrix}
\binom{C}{D} =
(3 + i \sqrt{35}) \binom{C}{D}
\end{align*}

or

\begin{align*}
\begin{pmatrix}
1 - i \sqrt{35} & 6 \\
-6 & -1 - i \sqrt{35}
\end{pmatrix}
\binom{C}{D} = 0
\end{align*}

or

\begin{align*}
(1 - i \sqrt{35}) C + 6 D = 0
\nonumber \\
-6 C - (1 + i \sqrt{35}) D = 0
\end{align*}

Using the first condition, the two eigenvectors are

\begin{align*}
\vec{v}_1 = \binom{1}{\dfrac{-1 + i \sqrt{35}}{6}} , \qquad (\lambda_1 = \frac{3}{2} + i \frac{\sqrt{35}}{2})
\nonumber \\
\vec{v}_2 = \binom{1}{\dfrac{-1 - i \sqrt{35}}{6}} , \qquad (\lambda_2 = \frac{3}{2} - i \frac{\sqrt{35}}{2})
\end{align*}

The (real) general solution of the homogeneous differential equation is

\begin{align*}
\binom{x}{y} = C \binom{1}{\dfrac{- 1 + i \sqrt{35}}{6}} e^{(\frac{3}{2} + i \frac{\sqrt{35}}{2}) t} + C^* \binom{1}{\dfrac{-1 - i \sqrt{35}}{6}} e^{(\frac{3}{2} - i \frac{\sqrt{35}}{2}) t}
\end{align*}

Writing ##C = C_1 + i C_2##, we have

\begin{align*}
\binom{x}{y} = (C_1 + i C_2) \binom{1}{\dfrac{-1 + i \sqrt{35}}{6}} e^{(\frac{3}{2} + i \frac{\sqrt{35}}{2}) t} + c.c.
\end{align*}

so that

\begin{align*}
\binom{x}{y} = (C_1 + i C_2) \binom{1}{\dfrac{-1 + i \sqrt{35}}{6}} (\cos (\frac{\sqrt{35}}{2} t) + i \sin (\frac{\sqrt{35}}{2} t)) e^{3t/2} + c.c.
\end{align*}

or

\begin{align*}
\binom{x}{y} = \binom{C_1 + i C_2}{\dfrac{(-C_1 - C_2 \sqrt{35}) + i (-C_2 + C_1 \sqrt{35})}{6} } (\cos (\frac{\sqrt{35}}{2} t) + i \sin (\frac{\sqrt{35}}{2} t)) e^{3t/2} + c.c.
\end{align*}

or

\begin{align*}
\binom{x}{y} = 2 \binom{C_1 \cos (\frac{\sqrt{35}}{2} t) - C_2 \sin (\frac{\sqrt{35}}{2} t)}
{\dfrac{-C_1 - C_2 \sqrt{35}}{6} \cos (\frac{\sqrt{35}}{2} t) - \dfrac{-C_2 + C_1 \sqrt{35}}{6} \sin (\frac{\sqrt{35}}{2} t)} e^{3t/2}
\end{align*}

Using ##x(0)=1## and ##y(0)=2##,

\begin{align*}
\binom{1}{2} = 2 \binom{ C_1 }{ - \dfrac{ C_1 + C_2 \sqrt{35} }{6} }
\end{align*}

So ##C_1 = \frac{1}{2}##, ##1 = - \dfrac{ C_1 + C_2 \sqrt{35} }{6}##, ##C_2 = - \dfrac{13}{2 \sqrt{35}}##, and ##\dfrac{4}{\sqrt{35}} = \dfrac{ -C_2 + C_1 \sqrt{35} }{6}##.

So finally we have,

\begin{align*}
\binom{x}{y} = e^{2 t/3} \cos (\frac{ \sqrt{35} }{2}t) \binom{1}{2}
+ e^{2 t/3} \dfrac{\sin (\frac{ \sqrt{35} }{2}t)}{\sqrt{35}} \binom{13}{-8} .
\end{align*}

The differential equation

\begin{align*}
\frac{d}{dt} \binom{x}{y} =
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{x}{y}
\end{align*}

with initial conditions ##x(0)=1##, ##y(0) = 2## has the solution:

\begin{align*}
\binom{x}{y} = \exp \left\{
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix} t \right\}
\binom{1}{2}
\end{align*}

Write

\begin{align*}
A =
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\end{align*}

We will compute ##\exp (At)##.

To that end, consider the eigenvector problem

\begin{align*}
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{C}{D}
= \lambda \binom{C}{D}
\end{align*}

Let's find the eigenvalues:

\begin{align*}
\det
\begin{pmatrix}
2 - \lambda & 3 \\
-3 & 1 - \lambda
\end{pmatrix}
= 0
\end{align*}

or

\begin{align*}
\lambda^2 - 3 \lambda + 11 = 0
\end{align*}

so that

\begin{align*}
\lambda_1 = \frac{3}{2} + i \frac{\sqrt{35}}{2} , \qquad \lambda_2 = \frac{3}{2} - i \frac{\sqrt{35}}{2}
\end{align*}

As the eigenvalues are the complex conjugate of each other one of the eigenvectors will be proportional to the complex conjugate of the other. The eigenvector equation is

\begin{align*}
\begin{pmatrix}
2 & 3 \\
-3 & 1
\end{pmatrix}
\binom{C}{D} =
(\frac{3}{2} + i \frac{\sqrt{35}}{2}) \binom{C}{D}
\end{align*}

or

\begin{align*}
\begin{pmatrix}
4 & 6 \\
-6 & 2
\end{pmatrix}
\binom{C}{D} =
(3 + i \sqrt{35}) \binom{C}{D}
\end{align*}

or

\begin{align*}
\begin{pmatrix}
1 - i \sqrt{35} & 6 \\
-6 & -1 - i \sqrt{35}
\end{pmatrix}
\binom{C}{D} = 0
\end{align*}

or

\begin{align*}
(1 - i \sqrt{35}) C + 6 D = 0
\nonumber \\
-6 C - (1 + i \sqrt{35}) D = 0
\end{align*}

Using the first condition, the two normalised eigenvectors are

\begin{align*}
\vec{v}_1 = \frac{1}{\sqrt{7}} \binom{1}{\dfrac{-1 + i \sqrt{35}}{6}} , \qquad (\lambda_1 = \frac{3}{2} + i \frac{\sqrt{35}}{2})
\nonumber \\
\vec{v}_2 = \frac{1}{\sqrt{7}} \binom{1}{\dfrac{-1 - i \sqrt{35}}{6}} , \qquad (\lambda_2 = \frac{3}{2} - i \frac{\sqrt{35}}{2})
\end{align*}

Form the matrix ##U## whose columns are ##\vec{v}_1## and ##\vec{v}_2##. Then

\begin{align*}
\exp ( A t ) & = U U^{-1} \exp ( A t ) U U^{-1}
\nonumber \\
& = U \left( \mathbb{1} + U^{-1} A U t + \frac{1}{2!} U^{-1} A U U^{-1} A U t^2 + \cdots \right) U^{-1}
\nonumber \\
& = U \exp ( \mathcal{D} t ) U^{-1}
\end{align*}

where

\begin{align*}
\mathcal{D} =
\begin{pmatrix}
\lambda_1 & 0 \\
0 & \lambda_2
\end{pmatrix}
=
\begin{pmatrix}
\frac{3}{2} + i \frac{\sqrt{35}}{2} & 0 \\
0 & \frac{3}{2} - i \frac{\sqrt{35}}{2}
\end{pmatrix} .
\end{align*}

We have

\begin{align*}
U = \frac{1}{6 \sqrt{7}}
\begin{pmatrix}
6 & 6 \\
-1+i\sqrt{35} & -1-i\sqrt{35}
\end{pmatrix}
\end{align*}

and

\begin{align*}
U^{-1} = \frac{\sqrt{35}}{10 \sqrt{7}}
\begin{pmatrix}
\sqrt{35}-i & -i6 \\
\sqrt{35}+i & i6
\end{pmatrix}
\end{align*}

and

\begin{align*}
\exp (\mathcal{D} t) = e^{3t/2}
\begin{pmatrix}
e^{i \sqrt{35}t/2} & 0 \\
0 & e^{-i \sqrt{35}t/2}
\end{pmatrix}
\end{align*}

We can now compute ##\exp ( At )##,

\begin{align*}
& \exp (At)
\nonumber \\
& =
\frac{e^{3t/2} \sqrt{35}}{420}
\begin{pmatrix}
6 & 6 \\
-1+i\sqrt{35} & -1-i\sqrt{35}
\end{pmatrix}
\begin{pmatrix}
e^{i \sqrt{35}t/2} & 0 \\
0 & e^{-i \sqrt{35}t/2}
\end{pmatrix}
\begin{pmatrix}
\sqrt{35}-i & -i6 \\
\sqrt{35}+i & i6
\end{pmatrix}
\nonumber \\
& = \frac{e^{3t/2} \sqrt{35}}{420}
\begin{pmatrix}
6 & 6 \\
-1+i\sqrt{35} & -1-i\sqrt{35}
\end{pmatrix}
\begin{pmatrix}
(\sqrt{35}-i) e^{i \sqrt{35}t/2} & -i6 e^{i \sqrt{35}t/2} \\
(\sqrt{35}+i) e^{-i \sqrt{35}t/2} & i6 e^{-i \sqrt{35}t/2}
\end{pmatrix}
\nonumber \\
& = \frac{e^{\frac{3}{2}t} \sqrt{35}}{420}
\begin{pmatrix}
6 (\sqrt{35}-i) e^{i \frac{\sqrt{35}}{2}t} + 6 (\sqrt{35}+i) e^{-i \frac{\sqrt{35}}{2}t} & -36 i e^{i \frac{\sqrt{35}}{2}t} + i 36 e^{-i \frac{\sqrt{35}}{2}t} \\
36 i e^{i \frac{\sqrt{35}}{2}t} - i 36 e^{-i \frac{\sqrt{35}}{2}t} & i6 (1-i\sqrt{35}) e^{i \sqrt{35}t/2} - i6 (1+i\sqrt{35}) e^{-i \frac{\sqrt{35}}{2}t}
\end{pmatrix}
\nonumber \\
& = \frac{e^{\frac{3}{2}t} \sqrt{35}}{70}
\begin{pmatrix}
(\sqrt{35}-i) e^{i \frac{\sqrt{35}}{2}t} + (\sqrt{35}+i) e^{-i \frac{\sqrt{35}}{2}t} & -6 i e^{i \frac{\sqrt{35}}{2}t} + i 6 e^{-i \frac{\sqrt{35}}{2}t} \\
6 i e^{i \frac{\sqrt{35}}{2}t} - i 6 e^{-i \frac{\sqrt{35}}{2}t} & (i+\sqrt{35}) e^{i \frac{\sqrt{35}}{2}t} +(-i+\sqrt{35}) e^{-i \frac{\sqrt{35}}{2}t}
\end{pmatrix}
\nonumber \\
& = e^{3t/2}
\begin{pmatrix}
\cos (\sqrt{35}t/2) + \dfrac{\sin (\sqrt{35}t/2)}{\sqrt{35}} & 6 \dfrac{\sin (\sqrt{35}t/2)}{\sqrt{35}} \\
- 6 \dfrac{\sin (\sqrt{35}t/2)}{\sqrt{35}} & \cos (\sqrt{35}t/2) - \dfrac{\sin (\sqrt{35}t/2)}{\sqrt{35}}
\end{pmatrix}
\end{align*}

That is,

\begin{align*}
e^{At} & = e^{3 t/2} \cos (\frac{ \sqrt{35} }{2} t)
\begin{pmatrix}
1 & 0 \\
0 & 1
\end{pmatrix}
+ e^{3 t/2} \dfrac{\sin (\frac{ \sqrt{35} }{2} t)}{\sqrt{35}}
\begin{pmatrix}
1 & 6 \\
-6 & -1
\end{pmatrix}
\end{align*}

So

\begin{align*}
\binom{x}{y} = e^{2 t/3} \cos (\frac{ \sqrt{35} }{2}t) \binom{1}{2}
+ e^{2 t/3} \dfrac{\sin (\frac{ \sqrt{35} }{2}t)}{\sqrt{35}} \binom{13}{-8}
\end{align*}
 
Last edited:
  • #10
erobz said:
Using the original equations and given initial conditions we find ## x'(0) = 8, y'(0) = -1##
With an old textbook in front of me... Find the auxiliary equation:

$$m^2 -3m+11 = 0 \implies m = \frac{3}{2} \pm \frac{\sqrt{35}i}{2} $$

I think that implies the general solution ( for ##y## or ##x## - same ODE - different i.c. ):

$$ x(t) = y(t) = e^{ \left( \frac{3}{2}t \right) } \left( c_1 \cos \left( \frac{ \sqrt{35} }{2} t \right) + c_2 \sin \left( \frac{ \sqrt{35} }{2} t \right) \right) $$
But different constants in each case, not the same.
 
  • Like
Likes erobz
  • #11
bob012345 said:
But different constants in each case, not the same.
Yeah, I was just being lazy. Thats why I said the general solution is... the constants would be determined for the initial conditions of each. I would think those constants aren't necessarily distinct in the general solution...so I thought I could get away with it?
 
  • Like
Likes bob012345

Similar threads

Back
Top