# Finding system of equations from solutions

I am having an issues determining the system of equations for the following problem:

A phase portrait of a system of two, first order, linear, differential equations shows that the origin is a saddle-point. Solutions starting at $(3,−1)$ approach the origin along a straight line, and solutions starting at $(1,2)$ go away from the origin along a straight line. Sketch the phase portrait and give a system of equations that can correspond to it.

My attempt was to use $PAP^{-1}$. I set $(3, -1)$ as my vector 1 and $(1,2)$ as my vector 2. This resulted in a matrix $P$ of: $$\left( \begin{matrix} 3 & -1 \\ 1 & 2 \\ \end{matrix} \right)$$

I followed that by getting the inverse of this to get $P^{-1}$.

$$\frac{1}{7}\left( \begin{matrix} 1 & 1 \\ -1 & 3 \\ \end{matrix} \right)$$

I was unclear whether this is correct and if so, how to proceed? Any help is appreciated, thanks.

Let us write the ODE system as $\dot{\bf x} = {\bf A}{\bf x}$ where ${\bf x} = (x,y)^\top$ belongs to $\Bbb R^2$. The matrix ${\bf A}$ writes ${\bf A} = {\bf P}{\bf \Lambda}{\bf P}^{-1}$, where ${\bf \Lambda}$ is diagonal. Since the origin is a saddle-point, we set ${\bf \Lambda} = \text{diag}(-1,1)$, but other choices are possibles. The columns of matrix ${\bf P}$ are the eigenvectors of ${\bf A}$ corresponding to the eigenvalues $-1$ and $1$, i.e. $(3,-1)^\top$ and $(1,2)^\top$, respectively. Finally, \begin{aligned} {\bf A} &= {\bf P}{\bf \Lambda}{\bf P}^{-1} \\ &= \left(\begin{array}{cc} 3 & 1 \\ -1 & 2 \end{array}\right) \left(\begin{array}{cc} -1 & 0 \\ 0 & 1 \end{array}\right) \frac{1}{7}\left(\begin{array}{cc} 2 & -1 \\ 1 & 3 \end{array}\right) \\ &= \frac{1}{7}\left(\begin{array}{cc} -5 & 6 \\ 4 & 5 \end{array}\right) . \end{aligned} The corresponding phase portrait is