76.10.13 problem 13

Internal problem ID [17464]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 3. Systems of two first order equations. Section 3.6 (A brief introduction to nonlinear systems). Problems at page 195
Problem number : 13
Date solved : Monday, March 31, 2025 at 04:14:23 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )&=x \left (t \right )-x \left (t \right ) y \left (t \right )\\ \frac {d}{d t}y \left (t \right )&=y \left (t \right )+2 x \left (t \right ) y \left (t \right ) \end{align*}

Maple. Time used: 0.570 (sec). Leaf size: 70
ode:=[diff(x(t),t) = x(t)-x(t)*y(t), diff(y(t),t) = y(t)+2*x(t)*y(t)]; 
dsolve(ode);
 
\begin{align*} \\ \left [\left \{x \left (t \right ) &= \frac {{\mathrm e}^{t} {\mathrm e}^{-c_1 \,{\mathrm e}^{t}} {\mathrm e}^{c_2 c_1} c_1}{2 \,{\mathrm e}^{-c_1 \,{\mathrm e}^{t}} {\mathrm e}^{c_2 c_1}-1}\right \}, \left \{y \left (t \right ) = \frac {-\frac {d}{d t}x \left (t \right )+x \left (t \right )}{x \left (t \right )}\right \}\right ] \\ \end{align*}
Mathematica. Time used: 0.153 (sec). Leaf size: 94
ode={D[x[t],t]==x[t]-x[t]*y[t],D[y[t],t]==y[t]+2*x[t]*y[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {K[1]-1}{K[1]}dK[1]\&\right ][-2 x(t)-\log (x(t))+c_1] \\ \text {Solve}\left [\int _1^{x(t)}\frac {1}{K[2] \left (\text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {K[1]-1}{K[1]}dK[1]\&\right ][c_1-2 K[2]-\log (K[2])]-1\right )}dK[2]&=-t+c_2,x(t)\right ] \\ \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(x(t)*y(t) - x(t) + Derivative(x(t), t),0),Eq(-2*x(t)*y(t) - y(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)