61.22.2 problem 2

Internal problem ID [12248]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.3. Abel Equations of the Second Kind. subsection 1.3.1-2. Solvable equations and their solutions
Problem number : 2
Date solved : Wednesday, March 05, 2025 at 06:25:58 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} y y^{\prime }-y&=A x +B \end{align*}

Maple. Time used: 1.990 (sec). Leaf size: 68
ode:=y(x)*diff(y(x),x)-y(x) = A*x+B; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (x A +B \right ) \operatorname {RootOf}\left (\textit {\_Z}^{2}-A +\textit {\_Z} +{\mathrm e}^{\operatorname {RootOf}\left (\left (x A +B \right )^{2} \left (-2 \,{\mathrm e}^{\textit {\_Z}} \cosh \left (\left (\textit {\_Z} +2 \ln \left (x A +B \right )+2 c_{1} \right ) \sqrt {4 A +1}\right )+4 A -2 \,{\mathrm e}^{\textit {\_Z}}+1\right )\right )}\right )}{A} \]
Mathematica. Time used: 0.038 (sec). Leaf size: 46
ode=y[x]*D[y[x],x]-y[x]==A*x+B; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^{\frac {y(x)}{B+A x}}\frac {1}{-A K[1]+1+\frac {1}{K[1]}}dK[1]=\frac {\log (A x+B)}{A}+c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
A = symbols("A") 
B = symbols("B") 
y = Function("y") 
ode = Eq(-A*x - B + y(x)*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : argument of type Pow is not iterable