76.10.10 problem 10

Internal problem ID [17461]
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 : 10
Date solved : Monday, March 31, 2025 at 04:14:20 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )&=-x \left (t \right )+y \left (t \right )+x \left (t \right )^{2}\\ \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.209 (sec). Leaf size: 77
ode:=[diff(x(t),t) = -x(t)+y(t)+x(t)^2, diff(y(t),t) = y(t)-2*x(t)*y(t)]; 
dsolve(ode);
 
\begin{align*} \left \{x \left (t \right ) &= \operatorname {RootOf}\left (-\int _{}^{\textit {\_Z}}\frac {1}{\sqrt {\textit {\_a}^{4}-2 \textit {\_a}^{3}+\textit {\_a}^{2}+c_1}}d \textit {\_a} +t +c_2 \right ), x \left (t \right ) = \operatorname {RootOf}\left (-\int _{}^{\textit {\_Z}}-\frac {1}{\sqrt {\textit {\_a}^{4}-2 \textit {\_a}^{3}+\textit {\_a}^{2}+c_1}}d \textit {\_a} +t +c_2 \right )\right \} \\ \{y \left (t \right ) &= -x \left (t \right )^{2}+x \left (t \right )+\frac {d}{d t}x \left (t \right )\} \\ \end{align*}
Mathematica. Time used: 3.581 (sec). Leaf size: 6795
ode={D[x[t],t]==-x[t]+y[t]+x[t]^2,D[y[t],t]==y[t]-2*x[t]*y[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 

Too large to display

Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-x(t)**2 + x(t) - y(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)