2.25.20 Problem 37
Internal
problem
ID
[13635]
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
:
37
Date
solved
:
Sunday, January 18, 2026 at 08:57:28 PM
CAS
classification
:
[_rational, [_Abel, `2nd type`, `class B`]]
2.25.20.1 Solved using first_order_ode_exact
0.649 (sec)
Entering first order ode exact solver
\begin{align*}
x \left (2 a \,x^{n} y+b \right ) y^{\prime }&=-a \left (3 n +m \right ) x^{n} y^{2}-b \left (m +2 n \right ) y+A \,x^{m}+x \,x^{-n} \\
\end{align*}
To solve an ode of the form
\begin{equation} M\left ( x,y\right ) +N\left ( x,y\right ) \frac {dy}{dx}=0\tag {A}\end{equation}
We assume there exists a function \(\phi \left ( x,y\right ) =c\) where \(c\) is constant, that
satisfies the ode. Taking derivative of \(\phi \) w.r.t. \(x\) gives\[ \frac {d}{dx}\phi \left ( x,y\right ) =0 \]
Hence\begin{equation} \frac {\partial \phi }{\partial x}+\frac {\partial \phi }{\partial y}\frac {dy}{dx}=0\tag {B}\end{equation}
Comparing (A,B) shows
that\begin{align*} \frac {\partial \phi }{\partial x} & =M\\ \frac {\partial \phi }{\partial y} & =N \end{align*}
But since \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) then for the above to be valid, we require that
\[ \frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\]
If the above condition is satisfied, then
the original ode is called exact. We still need to determine \(\phi \left ( x,y\right ) \) but at least we know now that we can
do that since the condition \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) is satisfied. If this condition is not satisfied then this method will not
work and we have to now look for an integrating factor to force this condition, which might or
might not exist. The first step is to write the ODE in standard form to check for exactness, which
is \[ M(x,y) \mathop {\mathrm {d}x}+ N(x,y) \mathop {\mathrm {d}y}=0 \tag {1A} \]
Therefore \begin{align*} \left (x \left (2 a \,x^{n} y +b \right )\right )\mathop {\mathrm {d}y} &= \left (-a \left (3 n +m \right ) x^{n} y^{2}-b \left (m +2 n \right ) y +A \,x^{m}+x \,x^{-n}\right )\mathop {\mathrm {d}x}\\ \left (a \left (3 n +m \right ) x^{n} y^{2}+b \left (m +2 n \right ) y -A \,x^{m}-x \,x^{-n}\right )\mathop {\mathrm {d}x} + \left (x \left (2 a \,x^{n} y +b \right )\right )\mathop {\mathrm {d}y} &= 0 \tag {2A} \end{align*}
Comparing (1A) and (2A) shows that
\begin{align*} M(x,y) &= a \left (3 n +m \right ) x^{n} y^{2}+b \left (m +2 n \right ) y -A \,x^{m}-x \,x^{-n}\\ N(x,y) &= x \left (2 a \,x^{n} y +b \right ) \end{align*}
The next step is to determine if the ODE is is exact or not. The ODE is exact when the following
condition is satisfied
\[ \frac {\partial M}{\partial y} = \frac {\partial N}{\partial x} \]
Using result found above gives \begin{align*} \frac {\partial M}{\partial y} &= \frac {\partial }{\partial y} \left (a \left (3 n +m \right ) x^{n} y^{2}+b \left (m +2 n \right ) y -A \,x^{m}-x \,x^{-n}\right )\\ &= 2 a \left (3 n +m \right ) x^{n} y +b \left (m +2 n \right ) \end{align*}
And
\begin{align*} \frac {\partial N}{\partial x} &= \frac {\partial }{\partial x} \left (x \left (2 a \,x^{n} y +b \right )\right )\\ &= 2 y a \left (n +1\right ) x^{n}+b \end{align*}
Since \(\frac {\partial M}{\partial y} \neq \frac {\partial N}{\partial x}\), then the ODE is not exact. Since the ODE is not exact, we will try to find an integrating
factor to make it exact. Let
\begin{align*} A &= \frac {1}{N} \left (\frac {\partial M}{\partial y} - \frac {\partial N}{\partial x} \right ) \\ &=\frac {1}{\left (2 a \,x^{n} y +b \right ) x}\left ( \left ( 2 a \left (3 n +m \right ) x^{n} y +b \left (m +2 n \right )\right ) - \left (2 a \,x^{n} y +b +2 a n y \,x^{n} \right ) \right ) \\ &=\frac {m -1+2 n}{x} \end{align*}
Since \(A\) does not depend on \(y\), then it can be used to find an integrating factor. The integrating
factor \(\mu \) is
\begin{align*} \mu &= e^{ \int A \mathop {\mathrm {d}x} } \\ &= e^{\int \frac {m -1+2 n}{x}\mathop {\mathrm {d}x} } \end{align*}
The result of integrating gives
\begin{align*} \mu &= e^{\left (m -1+2 n \right ) \ln \left (x \right ) } \\ &= x^{m -1+2 n} \end{align*}
\(M\) and \(N\) are multiplied by this integrating factor, giving new \(M\) and new \(N\) which are called \(\overline {M}\) and \(\overline {N}\) for
now so not to confuse them with the original \(M\) and \(N\).
\begin{align*} \overline {M} &=\mu M \\ &= x^{m -1+2 n}\left (a \left (3 n +m \right ) x^{n} y^{2}+b \left (m +2 n \right ) y -A \,x^{m}-x \,x^{-n}\right ) \\ &= -x^{m -1+2 n} \left (x^{1-n}+\left (-3 n -m \right ) a \,y^{2} x^{n}+A \,x^{m}+\left (-m -2 n \right ) b y \right ) \end{align*}
And
\begin{align*} \overline {N} &=\mu N \\ &= x^{m -1+2 n}\left (x \left (2 a \,x^{n} y +b \right )\right ) \\ &= x^{m +2 n} \left (2 a \,x^{n} y +b \right ) \end{align*}
Now a modified ODE is ontained from the original ODE, which is exact and can be solved. The
modified ODE is
\begin{align*} \overline {M} + \overline {N} \frac { \mathop {\mathrm {d}y}}{\mathop {\mathrm {d}x}} &= 0 \\ \left (-x^{m -1+2 n} \left (x^{1-n}+\left (-3 n -m \right ) a \,y^{2} x^{n}+A \,x^{m}+\left (-m -2 n \right ) b y \right )\right ) + \left (x^{m +2 n} \left (2 a \,x^{n} y +b \right )\right ) \frac { \mathop {\mathrm {d}y}}{\mathop {\mathrm {d}x}} &= 0 \end{align*}
The following equations are now set up to solve for the function \(\phi \left (x,y\right )\)
\begin{align*} \frac {\partial \phi }{\partial x } &= \overline {M}\tag {1} \\ \frac {\partial \phi }{\partial y } &= \overline {N}\tag {2} \end{align*}
Integrating (1) w.r.t. \(x\) gives
\begin{align*}
\int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int \overline {M}\mathop {\mathrm {d}x} \\
\int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int -x^{m -1+2 n} \left (x^{1-n}+\left (-3 n -m \right ) a \,y^{2} x^{n}+A \,x^{m}+\left (-m -2 n \right ) b y \right )\mathop {\mathrm {d}x} \\
\tag{3} \phi &= x^{m} x^{n} \left (x^{2 n} a \,y^{2}-\frac {\left (-2 b y m -2 b y n +A \,x^{m}\right ) x^{n}}{2 \left (n +m \right )}-\frac {x}{m +1+n}\right )+ f(y) \\
\end{align*}
Where \(f(y)\) is used for the constant of integration since \(\phi \) is a function of
both \(x\) and \(y\). Taking derivative of equation (3) w.r.t \(y\) gives \begin{align*}
\tag{4} \frac {\partial \phi }{\partial y} &= x^{m} x^{n} \left (2 a \,x^{2 n} y -\frac {\left (-2 b m -2 b n \right ) x^{n}}{2 \left (n +m \right )}\right )+f'(y) \\
&=x^{n +m} \left (2 a \,x^{2 n} y +b \,x^{n}\right )+f'(y) \\
\end{align*}
But equation (2) says that \(\frac {\partial \phi }{\partial y} = x^{m +2 n} \left (2 a \,x^{n} y +b \right )\). Therefore
equation (4) becomes \begin{equation}
\tag{5} x^{m +2 n} \left (2 a \,x^{n} y +b \right ) = x^{n +m} \left (2 a \,x^{2 n} y +b \,x^{n}\right )+f'(y)
\end{equation}
Solving equation (5) for \( f'(y)\) gives \[ f'(y) = 0 \]
Therefore \[ f(y) = c_1 \]
Where \(c_1\) is constant of
integration. Substituting this result for \(f(y)\) into equation (3) gives \(\phi \) \[
\phi = x^{m} x^{n} \left (x^{2 n} a \,y^{2}-\frac {\left (-2 b y m -2 b y n +A \,x^{m}\right ) x^{n}}{2 \left (n +m \right )}-\frac {x}{m +1+n}\right )+ c_1
\]
But since \(\phi \) itself is a constant
function, then let \(\phi =c_2\) where \(c_2\) is new constant and combining \(c_1\) and \(c_2\) constants into the constant \(c_1\) gives
the solution as \[
c_1 = x^{m} x^{n} \left (x^{2 n} a \,y^{2}-\frac {\left (-2 b y m -2 b y n +A \,x^{m}\right ) x^{n}}{2 \left (n +m \right )}-\frac {x}{m +1+n}\right )
\]
Summary of solutions found
\begin{align*}
x^{m} x^{n} \left (x^{2 n} a y^{2}-\frac {\left (-2 b y m -2 b y n +A \,x^{m}\right ) x^{n}}{2 \left (n +m \right )}-\frac {x}{m +1+n}\right ) &= c_1 \\
\end{align*}
Entering first order ode abel second kind solver\begin{align*}
x \left (2 a \,x^{n} y+b \right ) y^{\prime }&=-a \left (3 n +m \right ) x^{n} y^{2}-b \left (m +2 n \right ) y+A \,x^{m}+x \,x^{-n} \\
\end{align*}
2.25.20.2 Solved using first_order_ode_abel_second_kind_case_5
7.350 (sec)
Abel first order ode of the second kind has the form
\begin{align} (y+ g)y' &= f_0 + f_1 y+ f_2 y^2 + f_3 y^3\tag {1} \end{align}
Comparing the given ode
\[
x \left (2 a \,x^{n} y+b \right ) y^{\prime } = -a \left (3 n +m \right ) x^{n} y^{2}-b \left (m +2 n \right ) y+A \,x^{m}+x \,x^{-n}
\]
To the form in (1) shows that \begin{align*} g &=\frac {b \,x^{-n}}{2 a}\\ f_0 &=\frac {A \,x^{m -n -1}+x^{-2 n}}{2 a}\\ f_1 &=\frac {b \,x^{-1-n} \left (-\frac {m}{2}-n \right )}{a}\\ f_2 &=\frac {-3 n -m}{2 x}\\ f_3 &=0 \end{align*}
When the condition \(f_1 = 2 f_2 g - g'\) is satisfied, then this ode has direct solution given by
\begin{align} y &= -g \pm \triangle \tag {2} \end{align}
Where
\begin{align} \triangle = U \sqrt { 2 \int { \frac {f_0+g g' - f_2 g^2}{U^2} \,dx}+ c_1 } \tag {3}\end{align}
And \(U\) is given by
\begin{align} U &= e^{\int {f_2 \,dx}} \tag {4}\end{align}
But \(f_1=\frac {b \,x^{-1-n} \left (-\frac {m}{2}-n \right )}{a}\) and \(2 f_2 g - g'=-\frac {b \,x^{-1-n} \left (m +2 n \right )}{2 a}\). Hence the condition is satisfied. Calcuating \(U\) from (4) gives
\begin{align*} U &= e^{\int {f_2 \,dx}}\\ U &= e^{\int {\frac {-3 n -m}{2 x}\,dx}}\\ U &= {\mathrm e}^{\left (-\frac {3 n}{2}-\frac {m}{2}\right ) \ln \left (x \right )} \end{align*}
Substituting the above in (3) gives
\begin{align*} \triangle &= U \sqrt { 2 \int { \frac {f_0+g g' - f_2 g^2}{U^2} \,dx}+ c_1 }\\ &= {\mathrm e}^{\left (-\frac {3 n}{2}-\frac {m}{2}\right ) \ln \left (x \right )}\sqrt { 2 \int { \frac {\left (\frac {A \,x^{m -n -1}+x^{-2 n}}{2 a}\right )+\left (\frac {b \,x^{-n}}{2 a}\right ) \left (-\frac {b \,x^{-n} n}{2 x a}\right ) - \left (\frac {-3 n -m}{2 x}\right ) \left (\frac {b^{2} x^{-2 n}}{4 a^{2}}\right )}{{\mathrm e}^{\left (-3 n -m \right ) \ln \left (x \right )}} \,dx}+ c_1 }\\ &= \frac {{\mathrm e}^{\left (-\frac {3 n}{2}-\frac {m}{2}\right ) \ln \left (x \right )} \sqrt {\frac {b^{2} x^{n +m}+\frac {4 a \,x^{m +1+n}}{m +1+n}+\frac {4 A a \,x^{2 n +2 m}}{2 n +2 m}}{a^{2}}+4 c_1}}{2} \end{align*}
Hence from (2) the solution is
\begin{align*}
y &= -g \pm \triangle \\
y &= -\frac {b \,x^{-n}}{2 a}+\frac {{\mathrm e}^{\left (-\frac {3 n}{2}-\frac {m}{2}\right ) \ln \left (x \right )} \sqrt {\frac {b^{2} x^{n +m}+\frac {4 a \,x^{m +1+n}}{m +1+n}+\frac {4 A a \,x^{2 n +2 m}}{2 n +2 m}}{a^{2}}+4 c_1}}{2} \\
y &= -\frac {b \,x^{-n}}{2 a}-\frac {{\mathrm e}^{\left (-\frac {3 n}{2}-\frac {m}{2}\right ) \ln \left (x \right )} \sqrt {\frac {b^{2} x^{n +m}+\frac {4 a \,x^{m +1+n}}{m +1+n}+\frac {4 A a \,x^{2 n +2 m}}{2 n +2 m}}{a^{2}}+4 c_1}}{2} \\
\end{align*}
Simplifying the above gives \begin{align*}
y &= \frac {x^{-\frac {3 n}{2}-\frac {m}{2}} \sqrt {\frac {2 A a \left (m +1+n \right ) x^{2 n +2 m}+4 \left (n +m \right ) \left (a \,x^{m +1+n}+\left (m +1+n \right ) \left (c_1 \,a^{2}+\frac {b^{2} x^{n +m}}{4}\right )\right )}{a^{2} \left (n +m \right ) \left (m +1+n \right )}}\, a -b \,x^{-n}}{2 a} \\
y &= -\frac {x^{-\frac {3 n}{2}-\frac {m}{2}} \sqrt {\frac {2 A a \left (m +1+n \right ) x^{2 n +2 m}+4 \left (n +m \right ) \left (a \,x^{m +1+n}+\left (m +1+n \right ) \left (c_1 \,a^{2}+\frac {b^{2} x^{n +m}}{4}\right )\right )}{a^{2} \left (n +m \right ) \left (m +1+n \right )}}\, a +b \,x^{-n}}{2 a} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= \frac {x^{-\frac {3 n}{2}-\frac {m}{2}} \sqrt {\frac {2 A a \left (m +1+n \right ) x^{2 n +2 m}+4 \left (n +m \right ) \left (a \,x^{m +1+n}+\left (m +1+n \right ) \left (c_1 \,a^{2}+\frac {b^{2} x^{n +m}}{4}\right )\right )}{a^{2} \left (n +m \right ) \left (m +1+n \right )}}\, a -b \,x^{-n}}{2 a} \\
y &= -\frac {x^{-\frac {3 n}{2}-\frac {m}{2}} \sqrt {\frac {2 A a \left (m +1+n \right ) x^{2 n +2 m}+4 \left (n +m \right ) \left (a \,x^{m +1+n}+\left (m +1+n \right ) \left (c_1 \,a^{2}+\frac {b^{2} x^{n +m}}{4}\right )\right )}{a^{2} \left (n +m \right ) \left (m +1+n \right )}}\, a +b \,x^{-n}}{2 a} \\
\end{align*}
2.25.20.3 ✓ Maple. Time used: 0.019 (sec). Leaf size: 236
ode:=x*(2*a*x^n*y(x)+b)*diff(y(x),x) = -a*(3*n+m)*x^n*y(x)^2-b*(2*n+m)*y(x)+A*x^m+x*x^(-n);
dsolve(ode,y(x), singsol=all);
\begin{align*}
y &= -\frac {x^{-3 n -m} \left (-\sqrt {2}\, \sqrt {\left (m +n \right ) \left (1+m +n \right ) x^{3 n +m} \left (A a \left (1+m +n \right ) x^{2 m +2 n}+2 \left (x^{1+m +n} a -\left (-\frac {b^{2} x^{m +n}}{4}+a c_1 \right ) \left (1+m +n \right )\right ) \left (m +n \right )\right )}+x^{2 n +m} b \left (1+m +n \right ) \left (m +n \right )\right )}{2 a \left (1+m +n \right ) \left (m +n \right )} \\
y &= -\frac {\left (\sqrt {2}\, \sqrt {\left (m +n \right ) \left (1+m +n \right ) x^{3 n +m} \left (A a \left (1+m +n \right ) x^{2 m +2 n}+2 \left (x^{1+m +n} a -\left (-\frac {b^{2} x^{m +n}}{4}+a c_1 \right ) \left (1+m +n \right )\right ) \left (m +n \right )\right )}+x^{2 n +m} b \left (1+m +n \right ) \left (m +n \right )\right ) x^{-3 n -m}}{2 a \left (1+m +n \right ) \left (m +n \right )} \\
\end{align*}
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
<- exact successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \left (2 a \,x^{13635} y \left (x \right )+b \right ) \left (\frac {d}{d x}y \left (x \right )\right )=-a \left (40905+m \right ) x^{13635} y \left (x \right )^{2}-b \left (27270+m \right ) y \left (x \right )+A \,x^{m}+\frac {1}{x^{13634}} \\ \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 \left (40905+m \right ) x^{13635} y \left (x \right )^{2}-b \left (27270+m \right ) y \left (x \right )+A \,x^{m}+\frac {1}{x^{13634}}}{x \left (2 a \,x^{13635} y \left (x \right )+b \right )} \end {array} \]
2.25.20.4 ✓ Mathematica. Time used: 47.235 (sec). Leaf size: 226
ode=x*(2*a*x^n*y[x]+b)*D[y[x],x]==-a*(3*n+m)*x^n*y[x]^2-b*(2*n+m)*y[x]+A*x^m+x*x^(-n);
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to -\frac {1}{2} x^{-m-3 n} \sqrt {\frac {x^{m+n-1}}{a}} \left (b x^{n+1} \sqrt {\frac {x^{m+n-1}}{a}}+\sqrt {x^{2 n+1} \left (\frac {b^2 x^{m+n}}{a}+4 a c_1+2 x^{m+n} \left (\frac {A x^{m+n}}{m+n}+\frac {2 x}{m+n+1}\right )\right )}\right )\\ y(x)&\to \frac {1}{2} x^{-m-3 n} \sqrt {\frac {x^{m+n-1}}{a}} \left (-b x^{n+1} \sqrt {\frac {x^{m+n-1}}{a}}+\sqrt {x^{2 n+1} \left (\frac {b^2 x^{m+n}}{a}+4 a c_1+2 x^{m+n} \left (\frac {A x^{m+n}}{m+n}+\frac {2 x}{m+n+1}\right )\right )}\right ) \end{align*}
2.25.20.5 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
n = symbols("n")
b = symbols("b")
m = symbols("m")
A = symbols("A")
c = symbols("c")
y = Function("y")
ode = Eq(-A*x**m + a*x**n*(m + 3*n)*y(x)**2 + b*(m + 2*n)*y(x) + x*(2*a*x**n*y(x) + b)*Derivative(y(x), x) - x/x**n,0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
Timed Out
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
Sympy version 1.14.0