# Solving system of two linear odes

I am trying to solve \begin{align} y_1'+B_{12}y_1=\beta_{12}y_2\\ Ay_2'+B_{21}y_2=\beta_{21}y_1, \end{align}with $y_1(0)=y_2(0)=y_0$. I find the eigenvalues to be $$\lambda_{1,2}=-\frac{B_{12}}{2}-\frac{B_{21}}{2A}-\frac{\sqrt{(AB_{12}-B_{21})^2+4A\beta_{12}\beta_{21}}}{2A}$$ For $\lambda_1$, I get eigenvector $(\beta_{12},B_{12}+\lambda_1)^T$ and for $\lambda_2$, I get $(\beta_{12},B_{12}+\lambda_2)^T$. After simplification, i obtain $$y_1(t)=y_0\frac{(\beta_{12}-\lambda_2-B_{12})e^{\lambda_1t}-(\beta_{12}-\lambda_1-B_{12})e^{\lambda_2t}}{\lambda_1-\lambda_2}.$$ I cannot get $y_2(t)$ which must be $$y_2(t)=y_0\frac{(\beta_{21}-A\lambda_2-B_{21})e^{\lambda_1t}-(\beta_{21}-A\lambda_1-B_{21})e^{\lambda_2t}}{A(\lambda_1-\lambda_2)}.$$

We can consider the equations to be written as

$$\left[ \begin{eqnarray} y'_1 + B_{12} y_1 &=& \beta_{12} y_2\\ y'_2 + B_{21} y_2 &=& \beta_{21} y_1\\ \end{eqnarray} \right.$$

Now we consider

$$y_\pm = y_1 + \alpha_\pm y_2,$$

whence

$$\begin{eqnarray} y_\pm' = y_1' + \alpha_\pm y_2' &=& - B_{12} y_1 + \beta_{12} y_2 - \alpha_\pm B_{21} y_2 + \alpha_\pm \beta_{21} y_1\\ &=& \Big( \alpha_\pm \beta_{21} - B_{12} \Big) y_1 + \Big( \beta_{12} - \alpha_\pm B_{21} \Big) y_2\\ &=& \Big( \alpha_\pm \beta_{21} - B_{12} \Big) \left[ y_1 + \underbrace{ \frac{ \beta_{12} - \alpha_\pm B_{21} } { \alpha_\pm \beta_{21} - B_{12} } }_{\displaystyle \alpha_\pm} y_2 \right]\\ &=& \Big( \alpha \beta_{21} - B_{12} \Big) y. \end{eqnarray}$$

So the general solution is given by

$$y_\pm = y_0 \exp\Big[ (\alpha_\pm \beta_{21} - B_{12}) t \Big],$$

and

$$\left[ \begin{eqnarray} y_1 &=& \frac{\alpha_+ y_-}{\alpha_+ - \alpha_-} - \frac{\alpha_- y_+}{\alpha_+ - \alpha_-}\\ y_2 &=& \frac{y_+}{\alpha_+ - \alpha_-} - \frac{y_-}{\alpha_+ - \alpha_-} \end{eqnarray} \right.$$

We need to find $\alpha_\pm$, which is given by

$$\alpha_\pm = \frac{ \beta_{12} - \alpha_\pm B_{21} }{ \alpha_\pm \beta_{21} - B_{12} },$$

so

$$\alpha_\pm = \frac{B_{12} - B_{21}}{2 \beta_{21}} \pm \frac{1}{2 \beta_{21}} \sqrt{ \Big( B_{12} - B_{21} \Big)^2 + 4 \beta_{12} \beta_{21} }.$$

The general solution can now be written as

$$\begin{eqnarray} y_-(t) &=& y_0 \exp \Bigg[ \tfrac{1}{2} \Big( - B_{12} - B_{21} - \sqrt{ \Big( B_{12} - B_{21} \Big)^2 + 4 \beta_{12} \beta_{21} } \Big) t \Bigg]\\ y_+(t) &=& y_0 \exp \Bigg[ \tfrac{1}{2} \Big( - B_{12} - B_{21} + \sqrt{ \Big( B_{12} - B_{21} \Big)^2 + 4 \beta_{12} \beta_{21} } \Big) t \Bigg]\\ \end{eqnarray}$$

and

$$\left[ \begin{eqnarray} y_1 &=& \frac{\alpha_+ y_-}{\alpha_+ - \alpha_-} - \frac{\alpha_- y_+}{\alpha_+ - \alpha_-}\\ y_2 &=& \frac{y_+}{\alpha_+ - \alpha_-} - \frac{y_-}{\alpha_+ - \alpha_-} \end{eqnarray} \right.$$

• why is $y_\pm(0)=y_0$? Remember $y_1(0)=y_2(0)=y_0$ – Vaolter Jul 13 '14 at 2:55
• @Vaolter: That is a good remark, it should be $y_\pm(0) = (1 + \alpha_\pm) y_0$ - but it does however not change the method... – johannesvalks Jul 13 '14 at 12:44
• I don't seem to be able to get this solution to be in terms of $\lambda_{1,2}$ which is slightly different from $\alpha_{\pm}$. Can you help with that? – Vaolter Jul 13 '14 at 16:14