Linear Systems of ODEs

Here is a system of two ODEs whose coefficient matrix has real and distinct eigenvalues.
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
This solves the system. Note that the general solution depends on two arbitrary constants C[1] and C[2].
In[5]:=
Click for copyable input
Out[5]=
Here is a plot of some particular solutions obtained by giving specific values to C[1] and C[2]. In this case, the origin is called a node.
In[6]:=
Click for copyable input
In[7]:=
Click for copyable input
Out[7]=
In this system, the eigenvalues of the coefficient matrix are complex conjugates of each other.
In[8]:=
Click for copyable input
In[9]:=
Click for copyable input
Out[9]=
In[10]:=
Click for copyable input
In[11]:=
Click for copyable input
This solves the system.
In[12]:=
Click for copyable input
Out[12]=
This plots the solution for various values of the arbitrary parameters. The spiraling behavior is typical for systems with complex eigenvalues.
In[13]:=
Click for copyable input
In[14]:=
Click for copyable input
Out[14]=

Solving homogeneous systems of ODEs with constant coefficients and of arbitrary order is a straightforward matter. They are solved by converting them to a system of first-order ODEs.

This solves a homogeneous system of ODEs of order 3, with constant coefficients.
In[15]:=
Click for copyable input
In[16]:=
Click for copyable input
Out[16]=
This verifies the solution.
In[17]:=
Click for copyable input
Out[17]=

In general, systems of linear ODEs with non-constant coefficients can only be solved in cases where the coefficient matrix has a simple structure, as illustrated in the following examples.

This first-order system has a diagonal coefficient matrix. The system is uncoupled because the first equation involves only and the second equation depends only on . Thus, each equation in the system can be integrated independently of the other.
In[18]:=
Click for copyable input
Out[18]=
The rows of the coefficient matrix for this system form an orthogonal set of vectors.
In[19]:=
Click for copyable input
In[20]:=
Click for copyable input
Out[20]=
In[21]:=
Click for copyable input
In[22]:=
Click for copyable input
In[23]:=
Click for copyable input
Out[23]=
In[24]:=
Click for copyable input
Out[24]=
Here is a system of three first-order ODEs. The coefficient matrix is upper triangular.
In[25]:=
Click for copyable input
In[26]:=
Click for copyable input
Out[26]//MatrixForm=
In[27]:=
Click for copyable input
In[28]:=
Click for copyable input
In[29]:=
Click for copyable input
Out[29]=

As for single ODEs, there are sophisticated modern algorithms for solving systems of ODEs with rational coefficients.

This solves a system of two first-order ODEs with rational coefficients. Note that the solution is composed entirely of rational functions.
In[30]:=
Click for copyable input
Out[30]=
In the following example, the algorithm finds one rational solution for and . (The equation for is uncoupled from the rest of the system.) Using the rational solution, DSolve is able to find the remaining exponential solution for and .
In[31]:=
Click for copyable input
In[32]:=
Click for copyable input
Out[32]=
In[33]:=
Click for copyable input
Out[33]=

The systems considered so far have all been homogeneous. If the system is inhomogeneous (that is, if there are terms free from any dependent variables and their derivatives), DSolve applies either the method of variation of parameters or the method of undetermined coefficients to find the general solution.

This solves an inhomogeneous system.
In[34]:=
Click for copyable input
In[35]:=
Click for copyable input
In[36]:=
Click for copyable input
In[37]:=
Click for copyable input
In[38]:=
Click for copyable input
Out[38]=

Particular solutions to the system can be obtained by assigning values to the constants C[1] and C[2].

Here is a plot of the solution for one choice of parameters.
In[39]:=
Click for copyable input
In[40]:=
Click for copyable input
Out[40]=