# Decoupling system of differential equations

Here I have one task and it is preparation for small exam. I solved it by hand for first case 1), but I need to check it in $Mathematica$ and to try to implement it for both cases 1) and 2) automatically. After decoupling I am looking for solutions of the decoupled system and how to get them and come back to the source variables because I need solutions of them?

System of two differential equations of 4th order and I need to transform them in 1) equivalent system of 4 equations of second order with appropriate substitutions and 2) 8 equations of first order. How to do that in Mathematica automatically, in one case 4 equations second order maximum and in another case 8 equations of first order maximum? Example is with known constants a and b. I know that I must use some substitutions to reduce the system.

Firstly can be helpful homogenous solution when g1[x] and g2[x] are equal to zero.

first eq

  g1[x]==a1*X1[x] + a2*X2[x] + a3*Derivative[X1][x] -
a4*Derivative[X2][x] + a5*Derivative[X1][x]


second eq

  g2[x]==b2*X1[x] + b1*X2[x] - b4*Derivative[X1][x] +
b3*Derivative[X2][x] + b5*Derivative[X2][x]


1) 4 equations with adopted substitutions of second order differential equations.

2) 8 equations of first order

I did a) by hand in the form

$(\text{x1}=\text{X1}(x)) (\text{x3}=\text{X2}(x)) \left(\text{x2}=\text{X1}''(x)\right) \left(\text{x4}=\text{X2}''(x)\right)$

$X(x)=\left( \begin{array}{c} \text{x1}(x) \\ \text{x2}(x) \\ \text{x3}(x) \\ \text{x4}(x) \\ \end{array} \right)$ $, A=\left( \begin{array}{cccc} 0 & 1 & 0 & 0 \\ -\frac{\text{a3}}{\text{a1}} & -\frac{\text{a2}}{\text{a1}} & -\frac{\text{a5}}{\text{a1}} & -\frac{\text{a4}}{\text{a1}} \\ 0 & 0 & 0 & 1 \\ -\frac{\text{b5}}{\text{b1}} & -\frac{\text{b4}}{\text{b1}} & -\frac{\text{b3}}{\text{b1}} & -\frac{\text{b2}}{\text{b1}} \\ \end{array} \right)$ $, B=\left( \begin{array}{c} 0 \\ \frac{\text{g1}(x)}{\text{a1}} \\ 0 \\ \frac{\text{g2}(x)}{\text{b1}} \\ \end{array} \right)$ $$X''(x)=A X(x)+B$$

• @Nasser thank you, it is corrected now. It is not partial, just of one variable – Pipe Jan 26 '13 at 6:33
• @Naser it can e helpful also homogenous solution firstly when the functions g1 and g2 are equal to zero – Pipe Jan 26 '13 at 6:44
• @I didn't speak about standard state space formulation. I need solutions of system of differential equations and how to transform it in 4 second order – Pipe Jan 26 '13 at 14:42

I am a little confused by your terms and what you have shown. But in case it helps, one way to obtain the state space matrix is to use StateSpaceModel as follows

eq1 = g1[x] ==
a1*X1[x] + a2*X2[x] + a3*Derivative[X1][x] -
a4*Derivative[X2][x] + a5*Derivative[X1][x];

eq2 = g2[x] ==
b2*X1[x] + b1*X2[x] - b4*Derivative[X1][x] +
b3*Derivative[X2][x] + b5*Derivative[X2][x];

StateSpaceModel[{eq1,
eq2}, {{X1'[x], 0}, {X1[x], 0}, {X2'[x], 0}, {X2[x], 0}}, {{g1[x],
0}, {g2[x], 0}}, {X1[x], X2[x]}, x]


Which gives We see there are 8 state variables as expected.