2.8.10 Problem 19
Internal
problem
ID
[13362]
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.5-2
Problem
number
:
19
Date
solved
:
Sunday, January 18, 2026 at 07:30:51 PM
CAS
classification
:
[[_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]
2.8.10.1 Solved using first_order_ode_riccati
1.196 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime } x&=a \,x^{n} \left (y+b \ln \left (x \right )\right )^{2}-b \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= \frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}+2 x^{n} \ln \left (x \right ) a b y+a \,x^{n} y^{2}-b}{x} \end{align*}
This is a Riccati ODE. Comparing the ODE to solve
\[
y' = \frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}}{x}+\frac {2 x^{n} \ln \left (x \right ) a b y}{x}+\frac {x^{n} a y^{2}}{x}-\frac {b}{x}
\]
With Riccati ODE standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows
that \(f_0(x)=\frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}}{x}-\frac {b}{x}\), \(f_1(x)=\frac {2 b \ln \left (x \right ) a \,x^{n}}{x}\) and \(f_2(x)=\frac {a \,x^{n}}{x}\). Let \begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\frac {u a \,x^{n}}{x}} \tag {1} \end{align*}
Using the above substitution in the given ODE results (after some simplification) in a second
order ODE to solve for \(u(x)\) which is
\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}
But
\begin{align*} f_2' &=\frac {a \,x^{n} n}{x^{2}}-\frac {a \,x^{n}}{x^{2}}\\ f_1 f_2 &=\frac {2 b \ln \left (x \right ) a^{2} x^{2 n}}{x^{2}}\\ f_2^2 f_0 &=\frac {a^{2} x^{2 n} \left (\frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}}{x}-\frac {b}{x}\right )}{x^{2}} \end{align*}
Substituting the above terms back in equation (2) gives
\[
\frac {a \,x^{n} u^{\prime \prime }\left (x \right )}{x}-\left (\frac {a \,x^{n} n}{x^{2}}-\frac {a \,x^{n}}{x^{2}}+\frac {2 b \ln \left (x \right ) a^{2} x^{2 n}}{x^{2}}\right ) u^{\prime }\left (x \right )+\frac {a^{2} x^{2 n} \left (\frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}}{x}-\frac {b}{x}\right ) u \left (x \right )}{x^{2}} = 0
\]
Unable to solve. Will ask Maple to solve
this ode now.
The solution for \(u \left (x \right )\) is
\begin{equation}
\tag{3} u \left (x \right ) = c_1 \,x^{\frac {x^{n} a b}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}+c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}
\end{equation}
Taking derivative gives \begin{equation}
\tag{4} u^{\prime }\left (x \right ) = c_1 \,x^{\frac {x^{n} a b}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {c_1 \,x^{\frac {x^{n} a b}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}+c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {n^{2}+a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{\frac {u a \,x^{n}}{x}} \\
y &= -\frac {\left (c_1 \,x^{\frac {x^{n} a b}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {c_1 \,x^{\frac {x^{n} a b}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}+c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {n^{2}+a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}\right ) x^{-n} x}{a \left (c_1 \,x^{\frac {x^{n} a b}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}+c_2 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}\right )} \\
\end{align*}
Doing change of constants, the above solution becomes \[
y = -\frac {\left (x^{\frac {x^{n} a b}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {x^{\frac {x^{n} a b}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}+c_3 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} \left (\frac {b \ln \left (x \right ) a \,x^{n}}{x}+\frac {n^{2}+a b \,x^{n}}{n x}\right ) {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}-\frac {c_3 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} a b \,x^{n} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}}{n x}\right ) x^{-n} x}{a \left (x^{\frac {x^{n} a b}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}+c_3 \,x^{\frac {n^{2}+a b \,x^{n}}{n}} {\mathrm e}^{-\frac {a b \,x^{n}}{n^{2}}}\right )}
\]
Simplifying the above gives
\begin{align*}
y &= \frac {-\ln \left (x \right ) x^{n} c_3 a b -a b \ln \left (x \right )-c_3 n}{a \left (x^{n} c_3 +1\right )} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= \frac {-\ln \left (x \right ) x^{n} c_3 a b -a b \ln \left (x \right )-c_3 n}{a \left (x^{n} c_3 +1\right )} \\
\end{align*}
2.8.10.2 Solved using first_order_ode_riccati_by_guessing_particular_solution
0.055 (sec)
Entering first order ode riccati guess solver
\begin{align*}
y^{\prime } x&=a \,x^{n} \left (y+b \ln \left (x \right )\right )^{2}-b \\
\end{align*}
This is a Riccati ODE. Comparing the above ODE to
solve with the Riccati standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \begin{align*} f_0(x) & =\frac {a \,b^{2} x^{n} \ln \left (x \right )^{2}}{x}-\frac {b}{x}\\ f_1(x) & =\frac {2 b \ln \left (x \right ) a \,x^{n}}{x}\\ f_2(x) &=\frac {a \,x^{n}}{x} \end{align*}
Using trial and error, the following particular solution was found
\[
y_p = -b \ln \left (x \right )
\]
Since a particular solution is
known, then the general solution is given by \begin{align*} y &= y_p + \frac { \phi (x) }{ c_1 - \int { \phi (x) f_2 \,dx} } \end{align*}
Where
\begin{align*} \phi (x) &= e^{ \int 2 f_2 y_p + f_1 \,dx } \end{align*}
Evaluating the above gives the general solution as
\[
y = -b \ln \left (x \right )+\frac {n}{c_1 n -x^{n} a}
\]
Summary of solutions found
\begin{align*}
y &= -b \ln \left (x \right )+\frac {n}{c_1 n -x^{n} a} \\
\end{align*}
2.8.10.3 ✓ Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=x*diff(y(x),x) = a*x^n*(y(x)+b*ln(x))^2-b;
dsolve(ode,y(x), singsol=all);
\[
y = -b \ln \left (x \right )+\frac {n}{c_1 n -a \,x^{n}}
\]
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 )=a \,x^{13362} \left (y \left (x \right )+b \ln \left (x \right )\right )^{2}-b \\ \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 \,x^{13362} \left (y \left (x \right )+b \ln \left (x \right )\right )^{2}-b}{x} \end {array} \]
2.8.10.4 ✓ Mathematica. Time used: 0.28 (sec). Leaf size: 35
ode=x*D[y[x],x]==a*x^n*(y[x]+b*Log[x])^2-b;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to -b \log (x)+\frac {n}{-a x^n+c_1 n}\\ y(x)&\to -b \log (x) \end{align*}
2.8.10.5 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
b = symbols("b")
n = symbols("n")
y = Function("y")
ode = Eq(-a*x**n*(b*log(x) + y(x))**2 + b + x*Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE Derivative(y(x), x) - (a*b**2*x**n*log(x)**2 + 2*a*b*x**n*y(x)*l
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')