2.4.9 Problem 30

2.4.9.1 Solved using first_order_ode_riccati
2.4.9.2 Maple
2.4.9.3 Mathematica
2.4.9.4 Sympy

Internal problem ID [13309]
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 : 30
Date solved : Wednesday, April 29, 2026 at 07:34:40 PM
CAS classification : [_Riccati]

2.4.9.1 Solved using first_order_ode_riccati

7.737 (sec)

Entering first order ode riccati solver

\begin{align*} y^{\prime }&=x^{n} y^{2} a -a b \,x^{n} {\mathrm e}^{\lambda x} y+b \lambda \,{\mathrm e}^{\lambda x} \\ \end{align*}

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= x^{n} y^{2} a -a b \,x^{n} {\mathrm e}^{\lambda x} y+b \lambda \,{\mathrm e}^{\lambda x} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = x^{n} y^{2} a -a b \,x^{n} {\mathrm e}^{\lambda x} y+b \lambda \,{\mathrm e}^{\lambda x} \]

With Riccati ODE standard form

\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]

Shows that \(f_0(x)=b \lambda \,{\mathrm e}^{\lambda x}\), \(f_1(x)=-x^{n} {\mathrm e}^{\lambda x} a b\) and \(f_2(x)=a \,x^{n}\). Let

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

Substituting the above terms back in equation (2) gives

\[ a \,x^{n} u^{\prime \prime }\left (x \right )-\left (\frac {a \,x^{n} n}{x}-x^{2 n} {\mathrm e}^{\lambda x} a^{2} b \right ) u^{\prime }\left (x \right )+a^{2} x^{2 n} b \lambda \,{\mathrm e}^{\lambda x} u \left (x \right ) = 0 \]

Entering second order ode lagrange adjoint equation method solverIn normal form the ode

\begin{align*} a \,x^{n} \left (\frac {d^{2}u}{d x^{2}}\right )-\left (\frac {a \,x^{n} n}{x}-x^{2 n} {\mathrm e}^{\lambda x} a^{2} b \right ) \left (\frac {d u}{d x}\right )+a^{2} x^{2 n} b \lambda \,{\mathrm e}^{\lambda x} u = 0 \tag {1} \end{align*}

Becomes

\begin{align*} \frac {d^{2}u}{d x^{2}}+p \left (x \right ) \left (\frac {d u}{d x}\right )+q \left (x \right ) u&=r \left (x \right ) \tag {2} \end{align*}

Where

\begin{align*} p \left (x \right )&=x^{n} {\mathrm e}^{\lambda x} a b -\frac {n}{x}\\ q \left (x \right )&=x^{n} \lambda \,{\mathrm e}^{\lambda x} a b\\ r \left (x \right )&=0 \end{align*}

The Lagrange adjoint ode is given by

\begin{align*} \xi ^{''}-(\xi \, p)'+\xi q &= 0\\ \xi ^{''}-\left (\left (x^{n} {\mathrm e}^{\lambda x} a b -\frac {n}{x}\right ) \xi \left (x \right )\right )' + \left (x^{n} \lambda \,{\mathrm e}^{\lambda x} a b \xi \left (x \right )\right ) &= 0\\ \frac {d^{2}}{d x^{2}}\xi \left (x \right )+\left (-x^{n} {\mathrm e}^{\lambda x} a b +\frac {n}{x}\right ) \left (\frac {d}{d x}\xi \left (x \right )\right )-n \left (a b \,x^{n -1} {\mathrm e}^{\lambda x}+\frac {1}{x^{2}}\right ) \xi \left (x \right )&= 0 \end{align*}

Which is solved for \(\xi (x)\). Entering second order change of variable on \(y\) method 2 solverIn normal form the ode

\begin{align*} \xi ^{\prime \prime }+\left (-x^{n} {\mathrm e}^{\lambda x} a b +\frac {n}{x}\right ) \xi ^{\prime }-n \left (a b \,x^{n -1} {\mathrm e}^{\lambda x}+\frac {1}{x^{2}}\right ) \xi = 0\tag {1} \end{align*}

Becomes

\begin{align*} \xi ^{\prime \prime }+p \left (x \right ) \xi ^{\prime }+q \left (x \right ) \xi &=0 \tag {2} \end{align*}

Where

\begin{align*} p \left (x \right )&=-x^{n} {\mathrm e}^{\lambda x} a b +\frac {n}{x}\\ q \left (x \right )&=-{\mathrm e}^{\lambda x} a \,x^{n -1} n b -\frac {n}{x^{2}} \end{align*}

Applying change of variables on the depndent variable \(\xi = v \left (x \right ) x^{n}\) to (2) gives the following ode where the dependent variables is \(v \left (x \right )\) and not \(\xi \).

\begin{align*} v^{\prime \prime }\left (x \right )+\left (\frac {2 n}{x}+p \right ) v^{\prime }\left (x \right )+\left (\frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q \right ) v \left (x \right )&=0 \tag {3} \end{align*}

Let the coefficient of \(v \left (x \right )\) above be zero. Hence

\begin{align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q&=0 \tag {4} \end{align*}

Substituting the earlier values found for \(p \left (x \right )\) and \(q \left (x \right )\) into (4) gives

\begin{align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n \left (-x^{n} {\mathrm e}^{\lambda x} a b +\frac {n}{x}\right )}{x}-{\mathrm e}^{\lambda x} a \,x^{n -1} n b -\frac {n}{x^{2}}&=0 \tag {5} \end{align*}

Solving (5) for \(n\) gives

\begin{align*} n&=-n \tag {6} \end{align*}

Substituting this value in (3) gives

\begin{align*} v^{\prime \prime }\left (x \right )+\left (-\frac {n}{x}-x^{n} {\mathrm e}^{\lambda x} a b \right ) v^{\prime }\left (x \right )&=0 \\ v^{\prime \prime }\left (x \right )+\left (-\frac {n}{x}-x^{n} {\mathrm e}^{\lambda x} a b \right ) v^{\prime }\left (x \right )&=0 \tag {7} \\ \end{align*}

Using the substitution

\begin{align*} u \left (x \right ) = v^{\prime }\left (x \right ) \end{align*}

Then (7) becomes

\begin{align*} u^{\prime }\left (x \right )+\left (-\frac {n}{x}-x^{n} {\mathrm e}^{\lambda x} a b \right ) u \left (x \right ) = 0 \tag {8} \\ \end{align*}

The above is now solved for \(u \left (x \right )\). Entering first order ode linear solverIn canonical form a linear first order is

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

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}\\ p(x) &=0 \end{align*}

The integrating factor \(\mu \) is

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

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \mu u &= 0 \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (u \,{\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}\right ) &= 0 \end{align*}

Integrating gives

\begin{align*} u \,{\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}&= \int {0 \,dx} + c_1 \\ &=c_1 \end{align*}

Dividing throughout by the integrating factor \({\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}\) gives the final solution

\[ u \left (x \right ) = {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 \]

Now that \(u \left (x \right )\) is known, then

\begin{align*} v^{\prime }\left (x \right )&= u \left (x \right )\\ v \left (x \right )&= \int u \left (x \right )d x +c_2\\ &= \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2 \end{align*}

Hence

\begin{align*} \xi &= v \left (x \right ) x^{n}\\ &= \left (\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2 \right ) x^{-n}\\ &= \left (c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2 \right ) x^{-n}\\ \end{align*}

The original ode now reduces to first order ode

\begin{align*} \xi \left (x \right ) u^{\prime }-u \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) u&=\int \xi \left (x \right ) r \left (x \right )d x\\ u^{\prime }+u \left (p \left (x \right )-\frac {\xi ^{\prime }\left (x \right )}{\xi \left (x \right )}\right )&=\frac {\int \xi \left (x \right ) r \left (x \right )d x}{\xi \left (x \right )} \end{align*}

Or

\begin{align*} u^{\prime }+u \left (x^{n} {\mathrm e}^{\lambda x} a b -\frac {n}{x}-\frac {\left ({\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 \,x^{-n}-\frac {\left (\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2 \right ) x^{-n} n}{x}\right ) x^{n}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2}\right )&=0 \end{align*}

Which is now a first order ode. This is now solved for \(u\). Entering first order ode separable solverThe ode

\begin{equation} u^{\prime } = -\frac {u \left (x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x a b +x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_2 a b -c_1 \right ) {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2} \end{equation}

is separable as it can be written as

\begin{align*} u^{\prime }&= -\frac {u \left (x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x a b +x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_2 a b -c_1 \right ) {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2}\\ &= f(x) g(u) \end{align*}

Where

\begin{align*} f(x) &= -\frac {\left (x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x a b +x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_2 a b -c_1 \right ) {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2}\\ g(u) &= u \end{align*}

Integrating gives

\begin{align*} \int { \frac {1}{g(u)} \,du} &= \int { f(x) \,dx} \\ \int { \frac {1}{u}\,du} &= \int { -\frac {\left (x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x a b +x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_2 a b -c_1 \right ) {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2} \,dx} \\ \end{align*}
\[ \ln \left (u\right )=\int -\frac {\left (x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} \int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x a b +x^{n} {\mathrm e}^{\lambda x} {\mathrm e}^{\int -\frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_2 a b -c_1 \right ) {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x}}{\int {\mathrm e}^{\int \frac {a b \,x^{n +1} {\mathrm e}^{\lambda x}+n}{x}d x} c_1 d x +c_2}d x +c_3 \]

Solving for \(u\) gives

\begin{align*} u &= {\mathrm e}^{-c_1 a b \int \frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x -c_2 a b \int \frac {x^{n} {\mathrm e}^{\lambda x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_1 \int \frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_3} \\ \end{align*}

Hence, the solution found using Lagrange adjoint equation method is

\begin{align*} u &= {\mathrm e}^{-c_1 a b \int \frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x -c_2 a b \int \frac {x^{n} {\mathrm e}^{\lambda x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_1 \int \frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_3} \\ \end{align*}

The constants can be merged to give

\[ u = {\mathrm e}^{-c_1 a b \int \frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x -c_2 a b \int \frac {x^{n} {\mathrm e}^{\lambda x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_1 \int \frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +1} \]

Taking derivative gives

\begin{equation} \tag{4} u^{\prime }\left (x \right ) = \left (-\frac {x^{n} {\mathrm e}^{\lambda x} c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x a b}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}-\frac {x^{n} {\mathrm e}^{\lambda x} c_2 a b}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}+\frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x} c_1}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}\right ) {\mathrm e}^{-c_1 a b \int \frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x -c_2 a b \int \frac {x^{n} {\mathrm e}^{\lambda x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +c_1 \int \frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}d x +1} \end{equation}

Substituting equations (3,4) into (1) results in

\begin{align*} y &= \frac {-u'}{f_2 u} \\ y &= \frac {-u'}{u a \,x^{n}} \\ y &= -\frac {\left (-\frac {x^{n} {\mathrm e}^{\lambda x} c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x a b}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}-\frac {x^{n} {\mathrm e}^{\lambda x} c_2 a b}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}+\frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x} c_1}{c_1 \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_2}\right ) x^{-n}}{a} \\ \end{align*}

Doing change of constants, the above solution becomes

\[ y = -\frac {\left (-\frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x a b}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}-\frac {x^{n} {\mathrm e}^{\lambda x} c_4 a b}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}+\frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}\right ) x^{-n}}{a} \]

Summary of solutions found

\begin{align*} y &= -\frac {\left (-\frac {x^{n} {\mathrm e}^{\lambda x} \int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x a b}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}-\frac {x^{n} {\mathrm e}^{\lambda x} c_4 a b}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}+\frac {{\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}}{\int {\mathrm e}^{\int \left (\frac {n}{x}+x^{n} {\mathrm e}^{\lambda x} a b \right )d x}d x +c_4}\right ) x^{-n}}{a} \\ \end{align*}
2.4.9.2 Maple
ode:=diff(y(x),x) = a*x^n*y(x)^2-a*b*x^n*exp(lambda*x)*y(x)+b*lambda*exp(lambda*x); 
dsolve(ode,y(x), singsol=all);
 
\[ \text {No solution found} \]

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)*x-n)/x*diff(y(x),x)-a*x^n*b*lambda*exp(lambda*x)*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 
            trying symmetries linear in x and y(x) 
            trying to convert to a linear ODE with constant coefficients 
      <- unable to find a useful change of variables 
         trying a symmetry of the form [xi=0, eta=F(x)] 
         trying 2nd order exact linear 
         trying symmetries linear in x and y(x) 
         trying to convert to a linear ODE with constant coefficients 
         trying 2nd order, integrating factor of the form mu(x,y) 
         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 und\ 
er a power @ Moebius 
            -> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = e\ 
xp(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 
               trying symmetries linear in x and y(x) 
               trying to convert to a linear ODE with constant coefficients 
         <- unable to find a useful change of variables 
            trying a symmetry of the form [xi=0, eta=F(x)] 
         trying to convert to an ODE of Bessel type 
   -> Trying a change of variables to reduce to Bernoulli 
   -> Calling odsolve with the ODE, diff(y(x),x)-(a*x^n*y(x)^2+y(x)-a*b*x^n*exp 
(lambda*x)*y(x)*x+x^2*b*lambda*exp(lambda*x))/x, y(x), explicit 
      *** Sublevel 2 *** 
      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 inverse_Riccati 
      trying 1st order ODE linearizable_by_differentiation 
   -> trying a symmetry pattern of the form [F(x)*G(y), 0] 
   -> trying a symmetry pattern of the form [F(x),G(x)*y+H(x)] 
trying inverse_Riccati 
trying 1st order ODE linearizable_by_differentiation 
--- Trying Lie symmetry methods, 1st order --- 
   -> Computing symmetries using: way = 4 
   -> Computing symmetries using: way = 2 
   -> Computing symmetries using: way = 6
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,x^{13309} y \left (x \right )^{2}-a b \,x^{13309} {\mathrm e}^{\lambda x} y \left (x \right )+b \lambda \,{\mathrm e}^{\lambda x} \\ \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 \,x^{13309} y \left (x \right )^{2}-a b \,x^{13309} {\mathrm e}^{\lambda x} y \left (x \right )+b \lambda \,{\mathrm e}^{\lambda x} \end {array} \]
2.4.9.3 Mathematica. Time used: 44.857 (sec). Leaf size: 217
ode=D[y[x],x]==a*x^n*y[x]^2-a*b*x^n*Exp[\[Lambda]*x]*y[x]+b*\[Lambda]*Exp[\[Lambda]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {b \exp \left (\int _1^{e^{x \lambda }}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]+2 \lambda x\right ) \left (\int _1^{e^{x \lambda }}\frac {\exp \left (-\int _1^{K[2]}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )}{K[2]^2}dK[2]+c_1\right )}{\exp \left (\int _1^{e^{x \lambda }}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]+\lambda x\right ) \int _1^{e^{x \lambda }}\frac {\exp \left (-\int _1^{K[2]}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]\right )}{K[2]^2}dK[2]+c_1 \exp \left (\int _1^{e^{x \lambda }}-\frac {a b \left (\frac {\log (K[1])}{\lambda }\right )^n}{\lambda }dK[1]+\lambda x\right )+1}\\ y(x)&\to b e^{\lambda x} \end{align*}
2.4.9.4 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*x**n*y(x)**2 - b*lambda_*exp(lambda_*x) + 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*x**n*y(x)**2 - b*lambda_*exp(la
 
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')