# System of two coupled nonlinear ODEs

I would like to solve the following system of two coupled nonlinear ODEs

\begin{aligned} \dot x &= \frac yx\\ \dot y &= \left( \frac{1-x}{x} \right) y \end{aligned}

What I did was the following. From the 1st ODE, assuming $$x \neq 0$$, I got $$y = x \dot x$$ and, hence,

$$y = \frac 12 \frac{\mathrm d}{\mathrm d t} \left(x^2 \right)$$

and, plugging into the 2nd ODE,

$$\frac{\mathrm d^2}{\mathrm d t^2} \left(x^2 \right) = \left( \frac{1-x}{x} \right) \frac{\mathrm d}{\mathrm d t} \left(x^2 \right)$$

which eventually yields the following nonlinear 2nd order ODE

$$x \ddot x + \dot x \left( \dot x + x - 1 \right) = 0$$

which Wolfram Alpha can solve. However, this looks messy. I am looking for cleaner solutions.

From the quotient of both equations you get $$\frac{dy}{dx}=1-x$$ so that $$y=C+x-\frac12x^2$$ and then $$\dot x=\frac{C}x+1-\frac12x$$ which can be solved as separable DE.
you can simplify more straight forwardly $$\dot{y} = (1-x)\frac{y}{x} = (1-x)\dot{x}$$ so we have $$\frac{d}{dt}\left(y - x + \frac{x^2}{2}\right) = 0$$ or $$y - x + \frac{x^2}{2} = A$$ then we have $$y = A + x - \frac{x^2}{2}$$ you can solve from there - not pretty, but clearer.