2.25.11 Problem 18

2.25.11.1 Solved by factoring the differential equation
2.25.11.2 Maple
2.25.11.3 Mathematica
2.25.11.4 Sympy

Internal problem ID [13626]
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.4-2.
Problem number : 18
Date solved : Sunday, January 18, 2026 at 08:56:17 PM
CAS classification : [_separable]

2.25.11.1 Solved by factoring the differential equation

Time used: 0.085 (sec)

\begin{align*} \left (A x y+B \,x^{2}+k x \right ) y^{\prime }&=A y^{2}+B x y+\left (A b +k \right ) y+B b x +b k \\ \end{align*}
Writing the ode as
\begin{align*} \left (y^{\prime } x -y-b\right )\left (A y+B x +k\right )&=0 \end{align*}

Therefore we need to solve the following equations

\begin{align*} \tag{1} y^{\prime } x -y-b &= 0 \\ \tag{2} A y+B x +k &= 0 \\ \end{align*}
Now each of the above equations is solved in turn.

Solving equation (1)

Entering first order ode linear solverIn canonical form a linear first order is

\begin{align*} y^{\prime } + q(x)y &= p(x) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\frac {1}{x}\\ p(x) &=\frac {b}{x} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {1}{x}d x}\\ &= \frac {1}{x} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\frac {b}{x}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {y}{x}\right ) &= \left (\frac {1}{x}\right ) \left (\frac {b}{x}\right ) \\ \mathrm {d} \left (\frac {y}{x}\right ) &= \left (\frac {b}{x^{2}}\right )\, \mathrm {d} x \\ \end{align*}
Integrating gives
\begin{align*} \frac {y}{x}&= \int {\frac {b}{x^{2}} \,dx} \\ &=-\frac {b}{x} + c_1 \end{align*}

Dividing throughout by the integrating factor \(\frac {1}{x}\) gives the final solution

\[ y = x \left (-\frac {b}{x}+c_1 \right ) \]
Simplifying the above gives
\begin{align*} y &= c_1 x -b \\ \end{align*}
Solving equation (2)

Entering zero order ode solverSolving for \(y\) from

\begin{align*} A y+B x +k = 0 \end{align*}

Solving gives

\begin{align*} y &= -\frac {B x +k}{A} \\ \end{align*}
Simplifying the above gives
\begin{align*} y &= \frac {-B x -k}{A} \\ \end{align*}

Summary of solutions found

\begin{align*} y &= \frac {-B x -k}{A} \\ y &= c_1 x -b \\ \end{align*}
2.25.11.2 Maple. Time used: 0.001 (sec). Leaf size: 26
ode:=(A*x*y(x)+B*x^2+k*x)*diff(y(x),x) = A*y(x)^2+B*x*y(x)+(A*b+k)*y(x)+B*b*x+b*k; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {-B x -k}{A} \\ y &= c_1 x -b \\ \end{align*}

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (A x y \left (x \right )+B \,x^{2}+k x \right ) \left (\frac {d}{d x}y \left (x \right )\right )=A y \left (x \right )^{2}+B x y \left (x \right )+\left (A b +k \right ) y \left (x \right )+B b x +b k \\ \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 {A y \left (x \right )^{2}+B x y \left (x \right )+\left (A b +k \right ) y \left (x \right )+B b x +b k}{A x y \left (x \right )+B \,x^{2}+k x} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {\frac {d}{d x}y \left (x \right )}{b +y \left (x \right )}=\frac {1}{x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {\frac {d}{d x}y \left (x \right )}{b +y \left (x \right )}d x =\int \frac {1}{x}d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \ln \left (b +y \left (x \right )\right )=\ln \left (x \right )+\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (x \right ) \\ {} & {} & y \left (x \right )=x \,{\mathrm e}^{\mathit {C1}}-b \\ \bullet & {} & \textrm {Redefine the integration constant(s)}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} x -b \end {array} \]
2.25.11.3 Mathematica. Time used: 0.041 (sec). Leaf size: 41
ode=(A*x*y[x]+B*x^2+k*x)*D[y[x],x]==A*y[x]^2+B*x*y[x]+(A*b+k)*y[x]+B*b*x+b*k; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {B x+k}{A}\\ y(x)&\to -b+c_1 x\\ y(x)&\to -\frac {B x+k}{A} \end{align*}
2.25.11.4 Sympy. Time used: 0.736 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
A = symbols("A") 
B = symbols("B") 
k = symbols("k") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-A*y(x)**2 - B*b*x - B*x*y(x) - b*k - (A*b + k)*y(x) + (A*x*y(x) + B*x**2 + k*x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {- B x - k}{A}, \ y{\left (x \right )} = C_{1} x - b\right ] \]
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')