23.1.401 problem 387

Internal problem ID [5008]
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 : 387
Date solved : Tuesday, September 30, 2025 at 11:22:41 AM
CAS classification : [[_homogeneous, `class G`], _Riccati]

\begin{align*} x^{n} y^{\prime }+x^{2 n -2}+y^{2}+\left (1-n \right ) x^{n -1} y&=0 \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 17
ode:=x^n*diff(y(x),x)+x^(2*n-2)+y(x)^2+(-n+1)*x^(n-1)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (-\ln \left (x \right )+c_1 \right ) x^{n -1} \]
Mathematica. Time used: 0.386 (sec). Leaf size: 19
ode=x^n*D[y[x],x]+x^(2*n-2)+y[x]^2+(1-n)*x^(n-1)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x^{n-1} \tan (-\log (x)+c_1) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(x**n*Derivative(y(x), x) + x**(n - 1)*(1 - n)*y(x) + x**(2*n - 2) + y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (n*x**(n - 1)*y(x) - x**(n - 1)*y(x) - x**