# Solving a system consisting of an ODE and a non-differential equation

I would like to solve the following system of equations:

y'[t] == x[t]*y[t] - x[t];
10 == x[t]*y[t]/(x[t] + y[t]) + x[t]/(x[t] + y[t]^2)


Is there any way to solve this equations with Mathematica?

-
Have you tried solving them? If you have, what result did you get? –  Szabolcs Mar 9 '13 at 16:04
Try reading documentation - there are examples: Differential-Algebraic equation –  Vitaliy Kaurov Mar 9 '13 at 16:54
@Vitaliy Something seems to be wrong with how v9 handles these equations: first, NDSolve[{y'[t] == x[t]*y[t] - x[t], 10 == x[t]*y[t]/(x[t] + y[t]) + x[t]/(x[t] + y[t]^2)}, {x, y}, {t, 0, 10}] does give a solution even though initial conditions are missing. Second, NSolve[{10 == (x y)/(x + y) + x/(x + y^2), x == 1}, {x, y}] does not give a solution, even though Solve for the same equation does. Do you also think there's a bug here? Version 8 has neither of the problems: it correctly complains about the lack of initial conditions and NSolve does return a result for that eq. –  Szabolcs Mar 9 '13 at 17:11
initial condition? –  Spawn1701D Mar 9 '13 at 21:02
@Szabolcs sorry, I used the same thing in my answer without reading your comment before –  belisarius Mar 9 '13 at 21:22

sol = NDSolve[{y'[t] == x[t]*y[t] - x[t],
10 == x[t]*y[t]/(x[t] + y[t]) + x[t]/(x[t] + y[t]^2),
x[0] == 1/14 (-50 + 2 Sqrt[65]), y[0] == 2}, {x, y}, {t, 0, 20}];

ParametricPlot[{x[t], y[t]} /. sol[[1]], {t, 0, 20}, PlotRange -> All]


-
In V9.0.1 your NDSolve expression fails with the following message: 'NDSolve::ndcf: Repeated convergence test failure at t == 15.489851117996881`; unable to continue. >>' –  m_goldberg Mar 9 '13 at 18:45
@m_goldberg Sorry, v8 here ... –  belisarius Mar 9 '13 at 18:50
Not sure there is anything to be sorry about. I only wanted to point out that OP's problem may be a V.9 issue. –  m_goldberg Mar 9 '13 at 18:54