23.1.189 problem 189

Internal problem ID [4796]
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 : 189
Date solved : Tuesday, September 30, 2025 at 08:40:46 AM
CAS classification : [[_homogeneous, `class D`], _Riccati]

\begin{align*} x y^{\prime }&=y+\left (x^{2}-y^{2}\right ) f \left (x \right ) \end{align*}
Maple. Time used: 0.012 (sec). Leaf size: 13
ode:=x*diff(y(x),x) = y(x)+(x^2-y(x)^2)*f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tanh \left (\int f \left (x \right )d x +c_1 \right ) x \]
Mathematica. Time used: 0.07 (sec). Leaf size: 44
ode=x*D[y[x],x]==y[x]+(x^2-y[x]^2)*f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^{\frac {y(x)}{x}}\frac {1}{(K[1]-1) (K[1]+1)}dK[1]=\int _1^x-f(K[2])dK[2]+c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
f = Function("f") 
ode = Eq(x*Derivative(y(x), x) - (x**2 - y(x)**2)*f(x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x**2*f(x) - f(x)*y(x)**2 + y(x))/x cannot be solved by the factorable group method