# Determining the solutions of a differential equation which lie on a line

Given the differential equation:

$$\dot{x} = y-x^2, \;\; \dot{y} = -x+y^2$$

I have to find the solutions of this differential equation which move/lie on a line. I am not quite sure how to handle this problem, I started by writing $y = mx + q$, so:

$$\dot{y} = m \dot{x} = m (y-x^2) = -x+y^2$$

Solving this equation, I eventually arrived at $y = -x-1$. Now, a friend of mine told me this already is the solution, but I think it is only the line on which the solutions of the differential equation move. If so, how can I proceed in order to determine the solutions?

-
This is the proper relation between $x$ and $y$, but a full solution will give $x(t)$ and $y(t)$. MarkV describes how. – Ross Millikan Mar 6 '11 at 18:18

Plug in $y = -x - 1$ to the second equation and get

$$\dot{y} = 1 + y + y^2$$

To solve this for $y(t)$, separate variables and get

$\int \frac{dy}{1 + y + y^2} = \int dt = t + c$

the integral on the left is $\displaystyle \frac{2 \tan ^{-1}\left(\frac{2 y+1}{\sqrt{3}}\right)}{\sqrt{3}}$. Now solve for $y$ and use this to get $x$.

-
I arrive at $y = \frac{1}{2} (\sqrt{3} \tan(\frac{\sqrt{3}}{2} t + C)-1)$, and when I plug it into the first equation in order to solve $x$ for $t$, I get something even more horrible. No offense, but is this the right/easiest way to get to the solution? I find it somewhat unlikely that we are supposed to solve such horrible differential equations... – Huy Mar 6 '11 at 18:30
Or wait. Can I simply plug $y = -x-1$ into $\dot{x} = y-x^2$ to arrive at practically the same solution, that is to say $x(t) = \frac{1}{2} (\sqrt{3} \tan(-\frac{\sqrt{3}}{2} t + C)-1)$? That would definitely be easier, and the graphs plotted by wolframalpha also do make sense; at least for some values of $C$... – Huy Mar 6 '11 at 18:40
@Huy: This is almost right, except the signs of the constants $C$ are inconsistent -- $x(t)=\frac{1}{2}(\sqrt{3}\tan(-\frac{\sqrt{3}}{2}t-C)-1)$ would be right. But you don't have to go to so much trouble to get $x$, since you already have $y=-x-1$, so you can get $x$ from $y$ simply by solving that for $x$. – joriki Mar 7 '11 at 8:37