2.2.32 Problem 35

2.2.32.1 Solved using first_order_ode_riccati
2.2.32.2 Maple
2.2.32.3 Mathematica
2.2.32.4 Sympy

Internal problem ID [13238]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. 1.2.2. Equations Containing Power Functions
Problem number : 35
Date solved : Wednesday, December 31, 2025 at 12:20:06 PM
CAS classification : [_rational, _Riccati]

2.2.32.1 Solved using first_order_ode_riccati

9.175 (sec)

Entering first order ode riccati solver

\begin{align*} y^{\prime } x&=a y^{2}+y b +c \,x^{n} \\ \end{align*}
In canonical form the ODE is
\begin{align*} y' &= F(x,y)\\ &= \frac {a y^{2}+y b +c \,x^{n}}{x} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = \textit {the\_rhs} \]
With Riccati ODE standard form
\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \(f_0(x)=\frac {c \,x^{n}}{x}\), \(f_1(x)=\frac {b}{x}\) and \(f_2(x)=\frac {a}{x}\). Let
\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\frac {u a}{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^{2}}\\ f_1 f_2 &=\frac {a b}{x^{2}}\\ f_2^2 f_0 &=\frac {a^{2} c \,x^{n}}{x^{3}} \end{align*}

Substituting the above terms back in equation (2) gives

\[ \frac {a u^{\prime \prime }\left (x \right )}{x}-\left (-\frac {a}{x^{2}}+\frac {a b}{x^{2}}\right ) u^{\prime }\left (x \right )+\frac {a^{2} c \,x^{n} u \left (x \right )}{x^{3}} = 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 {b}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+c_2 \,x^{\frac {b}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) \end{equation}
Taking derivative gives
\begin{equation} \tag{4} u^{\prime }\left (x \right ) = \frac {c_1 \,x^{\frac {b}{2}} b \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {c_1 \,x^{\frac {b}{2}} \left (-\operatorname {BesselJ}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{x}+\frac {c_2 \,x^{\frac {b}{2}} b \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {c_2 \,x^{\frac {b}{2}} \left (-\operatorname {BesselY}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{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}} \\ y &= -\frac {\left (\frac {c_1 \,x^{\frac {b}{2}} b \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {c_1 \,x^{\frac {b}{2}} \left (-\operatorname {BesselJ}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{x}+\frac {c_2 \,x^{\frac {b}{2}} b \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {c_2 \,x^{\frac {b}{2}} \left (-\operatorname {BesselY}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{x}\right ) x}{a \left (c_1 \,x^{\frac {b}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+c_2 \,x^{\frac {b}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \\ \end{align*}
Doing change of constants, the above solution becomes
\[ y = -\frac {\left (\frac {x^{\frac {b}{2}} b \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {x^{\frac {b}{2}} \left (-\operatorname {BesselJ}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{x}+\frac {c_3 \,x^{\frac {b}{2}} b \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 x}+\frac {c_3 \,x^{\frac {b}{2}} \left (-\operatorname {BesselY}\left (\frac {b}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+\frac {b \,x^{-\frac {n}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )}{2 \sqrt {a c}}\right ) \sqrt {a c}\, x^{\frac {n}{2}}}{x}\right ) x}{a \left (x^{\frac {b}{2}} \operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )+c_3 \,x^{\frac {b}{2}} \operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \]
Simplifying the above gives
\begin{align*} y &= \frac {\left (\operatorname {BesselY}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right ) \sqrt {a c}\, x^{\frac {n}{2}}-b \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )}{a \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \\ \end{align*}

Summary of solutions found

\begin{align*} y &= \frac {\left (\operatorname {BesselY}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right ) \sqrt {a c}\, x^{\frac {n}{2}}-b \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )}{a \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_3 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \\ \end{align*}
2.2.32.2 Maple. Time used: 0.001 (sec). Leaf size: 164
ode:=x*diff(y(x),x) = a*y(x)^2+b*y(x)+c*x^n; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\operatorname {BesselY}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {b +n}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right ) \sqrt {a c}\, x^{\frac {n}{2}}-b \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )}{a \left (\operatorname {BesselY}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {b}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \]

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: 
   trying Riccati_symmetries 
   trying Riccati to 2nd Order 
   -> Calling odsolve with the ODE, diff(diff(y(x),x),x) = (b-1)/x*diff(y(x),x) 
-1/x*a*c*x^(-1+n)*y(x), y(x) 
      *** Sublevel 2 *** 
      Methods for second order ODEs: 
      --- Trying classification methods --- 
      trying a symmetry of the form [xi=0, eta=F(x)] 
      checking if the LODE is missing y 
      -> Trying an equivalence, under non-integer power transformations, 
         to LODEs admitting Liouvillian solutions. 
         -> Trying a Liouvillian solution using Kovacics algorithm 
         <- No Liouvillian solutions exists 
      -> Trying a solution in terms of special functions: 
         -> Bessel 
         <- Bessel successful 
      <- special function solution successful 
   <- Riccati to 2nd Order 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 y \left (x \right )^{2}+b y \left (x \right )+c \,x^{13238} \\ \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 y \left (x \right )+c \,x^{13238}}{x} \end {array} \]
2.2.32.3 Mathematica. Time used: 0.194 (sec). Leaf size: 402
ode=x*D[y[x],x]==a*y[x]^2+b*y[x]+c*x^n; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\sqrt {a} \sqrt {c} x^{n/2} \left (-2 \operatorname {BesselJ}\left (\frac {b}{n}-1,\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )+c_1 \left (\operatorname {BesselJ}\left (1-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )-\operatorname {BesselJ}\left (-\frac {b+n}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )\right )\right )-b c_1 \operatorname {BesselJ}\left (-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )}{2 a \left (\operatorname {BesselJ}\left (\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )+c_1 \operatorname {BesselJ}\left (-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )\right )}\\ y(x)&\to -\frac {-\sqrt {a} \sqrt {c} x^{n/2} \operatorname {BesselJ}\left (1-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )+\sqrt {a} \sqrt {c} x^{n/2} \operatorname {BesselJ}\left (-\frac {b+n}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )+b \operatorname {BesselJ}\left (-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )}{2 a \operatorname {BesselJ}\left (-\frac {b}{n},\frac {2 \sqrt {a} \sqrt {c} x^{n/2}}{n}\right )} \end{align*}
2.2.32.4 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*y(x)**2 - b*y(x) - c*x**n + x*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (a*y(x)**2 + b*y(x) + c*x**n)/x cannot be solved by the factorable group method