2.4.6 Problem 27

2.4.6.1 Solved using first_order_ode_riccati
2.4.6.2 Solved using first_order_ode_riccati_by_guessing_particular_solution
2.4.6.3 Maple
2.4.6.4 Mathematica
2.4.6.5 Sympy

Internal problem ID [13306]
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.3-2. Equations with power and exponential functions
Problem number : 27
Date solved : Sunday, January 18, 2026 at 07:12:02 PM
CAS classification : [_Riccati]

2.4.6.1 Solved using first_order_ode_riccati

0.877 (sec)

Entering first order ode riccati solver

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

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = a \,{\mathrm e}^{\lambda x} y^{2}-a b \,x^{n} {\mathrm e}^{\lambda x} y+\frac {b \,x^{n} n}{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 {b \,x^{n} n}{x}\), \(f_1(x)=-x^{n} {\mathrm e}^{\lambda x} a b\) and \(f_2(x)={\mathrm e}^{\lambda x} a\). Let
\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u \,{\mathrm e}^{\lambda x} a} \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' &=a \lambda \,{\mathrm e}^{\lambda x}\\ f_1 f_2 &=-x^{n} {\mathrm e}^{2 \lambda x} a^{2} b\\ f_2^2 f_0 &=\frac {{\mathrm e}^{2 \lambda x} a^{2} b \,x^{n} n}{x} \end{align*}

Substituting the above terms back in equation (2) gives

\[ {\mathrm e}^{\lambda x} a u^{\prime \prime }\left (x \right )-\left (a \lambda \,{\mathrm e}^{\lambda x}-x^{n} {\mathrm e}^{2 \lambda x} a^{2} b \right ) u^{\prime }\left (x \right )+\frac {{\mathrm e}^{2 \lambda x} a^{2} b \,x^{n} n u \left (x \right )}{x} = 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 \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_2 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x} \end{equation}
Taking derivative gives
\begin{equation} \tag{4} u^{\prime }\left (x \right ) = -c_1 \,{\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_2 \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x} {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}-c_2 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x} \end{equation}
Substituting equations (3,4) into (1) results in
\begin{align*} y &= \frac {-u'}{f_2 u} \\ y &= \frac {-u'}{u \,{\mathrm e}^{\lambda x} a} \\ y &= -\frac {\left (-c_1 \,{\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_2 \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x} {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}-c_2 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right ) {\mathrm e}^{-\lambda x}}{a \left (c_1 \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_2 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right )} \\ \end{align*}
Doing change of constants, the above solution becomes
\[ y = -\frac {\left (-{\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_3 \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x} {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}-c_3 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right ) {\mathrm e}^{-\lambda x}}{a \left ({\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_3 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right )} \]

Summary of solutions found

\begin{align*} y &= -\frac {\left (-{\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_3 \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x} {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}-c_3 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{\lambda x} x^{n} a b \,{\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right ) {\mathrm e}^{-\lambda x}}{a \left ({\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}+c_3 \int \lambda \,{\mathrm e}^{\lambda x +a b \int {\mathrm e}^{\lambda x} x^{n}d x}d x {\mathrm e}^{-a b \int {\mathrm e}^{\lambda x} x^{n}d x}\right )} \\ \end{align*}
2.4.6.2 Solved using first_order_ode_riccati_by_guessing_particular_solution

0.145 (sec)

Entering first order ode riccati guess solver

\begin{align*} y^{\prime }&=a \,{\mathrm e}^{\lambda x} y^{2}-a b \,x^{n} {\mathrm e}^{\lambda x} y+b n \,x^{n -1} \\ \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 {b \,x^{n} n}{x}\\ f_1(x) & =-x^{n} {\mathrm e}^{\lambda x} a b\\ f_2(x) &={\mathrm e}^{\lambda x} a \end{align*}

Using trial and error, the following particular solution was found

\[ y_p = b \,x^{n} \]
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 \,x^{n}+\frac {{\mathrm e}^{-\frac {\left (-\lambda \right )^{-n} a b \left (x^{n} \left (-\lambda \right )^{n} n \Gamma \left (n \right ) \left (-\lambda x \right )^{-n}-x^{n} \left (-\lambda \right )^{n} {\mathrm e}^{\lambda x}-x^{n} \left (-\lambda \right )^{n} n \left (-\lambda x \right )^{-n} \Gamma \left (n , -\lambda x \right )\right )}{\lambda }}}{c_1 -\int {\mathrm e}^{-\frac {\left (-\lambda \right )^{-n} a b \left (x^{n} \left (-\lambda \right )^{n} n \Gamma \left (n \right ) \left (-\lambda x \right )^{-n}-x^{n} \left (-\lambda \right )^{n} {\mathrm e}^{\lambda x}-x^{n} \left (-\lambda \right )^{n} n \left (-\lambda x \right )^{-n} \Gamma \left (n , -\lambda x \right )\right )}{\lambda }} {\mathrm e}^{\lambda x} a d x} \]

Summary of solutions found

\begin{align*} y &= b \,x^{n}+\frac {{\mathrm e}^{-\frac {\left (-\lambda \right )^{-n} a b \left (x^{n} \left (-\lambda \right )^{n} n \Gamma \left (n \right ) \left (-\lambda x \right )^{-n}-x^{n} \left (-\lambda \right )^{n} {\mathrm e}^{\lambda x}-x^{n} \left (-\lambda \right )^{n} n \left (-\lambda x \right )^{-n} \Gamma \left (n , -\lambda x \right )\right )}{\lambda }}}{c_1 -\int {\mathrm e}^{-\frac {\left (-\lambda \right )^{-n} a b \left (x^{n} \left (-\lambda \right )^{n} n \Gamma \left (n \right ) \left (-\lambda x \right )^{-n}-x^{n} \left (-\lambda \right )^{n} {\mathrm e}^{\lambda x}-x^{n} \left (-\lambda \right )^{n} n \left (-\lambda x \right )^{-n} \Gamma \left (n , -\lambda x \right )\right )}{\lambda }} {\mathrm e}^{\lambda x} a d x} \\ \end{align*}
2.4.6.3 Maple. Time used: 0.003 (sec). Leaf size: 58
ode:=diff(y(x),x) = a*exp(lambda*x)*y(x)^2-a*b*x^n*exp(lambda*x)*y(x)+b*n*x^(n-1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {c_1 \lambda \,{\mathrm e}^{a b \int x^{n} {\mathrm e}^{\lambda x}d x}}{a \left (\lambda \int {\mathrm e}^{\lambda x +a b \int x^{n} {\mathrm e}^{\lambda x}d x}d x c_1 +1\right )}+x^{n} b \]

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) = (-a*b*x^n*exp(lambda 
*x)+lambda)*diff(y(x),x)-a*exp(lambda*x)*b*n*x^(n-1)*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 
      -> Heun: Equivalence to the GHE or one of its 4 confluent cases under a \ 
power @ Moebius 
      -> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int\ 
(r(x), dx)) * 2F1([a1, a2], [b1], f) 
      -> Trying changes of variables to rationalize or make the ODE simpler 
         trying a symmetry of the form [xi=0, eta=F(x)] 
         checking if the LODE is missing y 
         -> Heun: Equivalence to the GHE or one of its 4 confluent cases under \ 
a power @ Moebius 
         -> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(\ 
int(r(x), dx)) * 2F1([a1, a2], [b1], f) 
            trying a symmetry of the form [xi=0, eta=F(x)] 
            trying 2nd order exact linear 
            <- 2nd order exact_linear successful 
         Change of variables used: 
            [x = ln(t)/lambda] 
         Linear ODE actually solved: 
            a*b*n*(ln(t)/lambda)^n/ln(t)*lambda*u(t)+t*(ln(t)/lambda)^n*a*b*lam\ 
bda*diff(u(t),t)+lambda^2*t*diff(diff(u(t),t),t) = 0 
      <- change of variables successful 
   <- Riccati to 2nd Order successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,{\mathrm e}^{\lambda x} y \left (x \right )^{2}-a b \,x^{13306} {\mathrm e}^{\lambda x} y \left (x \right )+13306 b \,x^{13305} \\ \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 )=a \,{\mathrm e}^{\lambda x} y \left (x \right )^{2}-a b \,x^{13306} {\mathrm e}^{\lambda x} y \left (x \right )+13306 b \,x^{13305} \end {array} \]
2.4.6.4 Mathematica. Time used: 2.333 (sec). Leaf size: 260
ode=D[y[x],x]==a*Exp[\[Lambda]*x]*y[x]^2-a*b*x^(n)*Exp[\[Lambda]*x]*y[x]+b*n*x^(n-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {-a b c_1 \left (\frac {\log \left (e^{\lambda x}\right )}{\lambda }\right )^n \int _1^{e^{x \lambda }}\exp \left (-\int _1^{K[2]}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )dK[2]+c_1 \lambda \exp \left (-\int _1^{e^{x \lambda }}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )-a b \left (\frac {\log \left (e^{\lambda x}\right )}{\lambda }\right )^n}{a+a c_1 \int _1^{e^{x \lambda }}\exp \left (-\int _1^{K[2]}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )dK[2]}\\ y(x)&\to b \left (\frac {\log \left (e^{\lambda x}\right )}{\lambda }\right )^n-\frac {\lambda \exp \left (-\int _1^{e^{x \lambda }}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )}{a \int _1^{e^{x \lambda }}\exp \left (-\int _1^{K[2]}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )dK[2]} \end{align*}
2.4.6.5 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
lambda_ = symbols("lambda_") 
n = symbols("n") 
y = Function("y") 
ode = Eq(a*b*x**n*y(x)*exp(lambda_*x) - a*y(x)**2*exp(lambda_*x) - b*n*x**(n - 1) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE a*b*x**n*y(x)*exp(lambda_*x) - a*y(x)**2*exp(lambda_*x) - b*n*x*
 
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)) 
 
('1st_power_series', 'lie_group')