23.1.184 problem 184

Internal problem ID [4791]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 184
Date solved : Tuesday, September 30, 2025 at 08:37:43 AM
CAS classification : [_rational, _Riccati]

\begin{align*} x y^{\prime }+x^{m}+\frac {\left (n -m \right ) y}{2}+x^{n} y^{2}&=0 \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 39
ode:=x*diff(y(x),x)+x^m+1/2*(n-m)*y(x)+x^n*y(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (\frac {2 x^{\frac {m}{2}+\frac {n}{2}}+c_1 \left (m +n \right )}{m +n}\right ) x^{\frac {m}{2}-\frac {n}{2}} \]
Mathematica. Time used: 0.378 (sec). Leaf size: 40
ode=x*D[y[x],x]+x^m+((n-m)/2)*y[x]+x^n*y[x]^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x^{\frac {m-n}{2}} \tan \left (\frac {2 x^{\frac {m+n}{2}}}{m+n}-c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
m = symbols("m") 
n = symbols("n") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + x**m + x**n*y(x)**2 + (-m + n)*y(x)/2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (m*y(x)/2 - n*y(x)/2 - x**m - x**n*y(x)**2)/x cannot be solved by the factorable group method