29.6.18 problem 164

Internal problem ID [4764]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 164
Date solved : Tuesday, March 04, 2025 at 07:14:13 PM
CAS classification : [[_homogeneous, `class D`], _rational, _Riccati]

\begin{align*} x y^{\prime }&=x^{2}+y \left (1+y\right ) \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 10
ode:=x*diff(y(x),x) = x^2+y(x)*(1+y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \tan \left (x +c_{1} \right ) x \]
Mathematica. Time used: 0.214 (sec). Leaf size: 12
ode=x D[y[x],x]==x^2+y[x](1+y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \tan (x+c_1) \]
Sympy. Time used: 0.322 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + x*Derivative(y(x), x) - (y(x) + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (i C_{1} + i e^{2 i x}\right )}{C_{1} - e^{2 i x}} \]