29.12.19 problem 338

Internal problem ID [4938]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 12
Problem number : 338
Date solved : Sunday, March 30, 2025 at 04:16:29 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

\begin{align*} a \,x^{2} y^{\prime }&=x^{2}+a x y+b^{2} y^{2} \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 19
ode:=a*x^2*diff(y(x),x) = x^2+a*x*y(x)+b^2*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\tan \left (\frac {b \left (\ln \left (x \right )+c_1 \right )}{a}\right ) x}{b} \]
Mathematica. Time used: 0.257 (sec). Leaf size: 23
ode=a x^2 D[y[x],x]==x^2+a x y[x]+b^2 y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x \tan \left (\frac {b (\log (x)+a c_1)}{a}\right )}{b} \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(a*x**2*Derivative(y(x), x) - a*x*y(x) - b**2*y(x)**2 - x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : cannot determine truth value of Relational