2.19.25 Problem 26

2.19.25.1 Maple
2.19.25.2 Mathematica
2.19.25.3 Sympy

Internal problem ID [13473]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. subsection 1.2.8-1. Equations containing arbitrary functions (but not containing their derivatives).
Problem number : 26
Date solved : Friday, December 19, 2025 at 04:47:11 AM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

\begin{align*} y^{\prime } x&=f \left (x \right ) \left (y+a \ln \left (x \right )\right )^{2}-a \\ \end{align*}
Unknown ode type.
2.19.25.1 Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=x*diff(y(x),x) = f(x)*(y(x)+a*ln(x))^2-a; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -a \ln \left (x \right )+\frac {1}{c_1 -\int \frac {f \left (x \right )}{x}d x} \]

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying Chini 
differential order: 1; looking for linear symmetries 
trying exact 
Looking for potential symmetries 
trying Riccati 
trying Riccati sub-methods: 
   <- Riccati particular case Kamke (d) successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \left (\frac {d}{d x}y \left (x \right )\right )=f \left (x \right ) \left (y \left (x \right )+a \ln \left (x \right )\right )^{2}-a \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=\frac {f \left (x \right ) \left (y \left (x \right )+a \ln \left (x \right )\right )^{2}-a}{x} \end {array} \]
2.19.25.2 Mathematica. Time used: 0.193 (sec). Leaf size: 42
ode=x*D[y[x],x]==f[x]*(y[x]+a*Log[x])^2-a; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -a \log (x)+\frac {1}{-\int _1^x\frac {f(K[2])}{K[2]}dK[2]+c_1}\\ y(x)&\to -a \log (x) \end{align*}
2.19.25.3 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
f = Function("f") 
ode = Eq(a + x*Derivative(y(x), x) - (a*log(x) + y(x))**2*f(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
IndexError : Index out of range: a[1]
 
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] 
Sympy version 1.14.0
 
classify_ode(ode,func=y(x)) 
 
('factorable', 'lie_group')