2.2.36 Problem 39
Internal
problem
ID
[13242]
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
:
39
Date
solved
:
Sunday, January 18, 2026 at 06:51:10 PM
CAS
classification
:
[[_homogeneous, `class G`], _rational, _Riccati]
2.2.36.1 Solved using first_order_ode_homog_type_G
0.192 (sec)
Entering first order ode homog type G solver
\begin{align*}
y^{\prime } x&=a \,x^{n} y^{2}+b y+c \,x^{-n} \\
\end{align*}
Multiplying the right side of the ode, which is \(\frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x}\) by \(\frac {x}{y}\)
gives \begin{align*} y^{\prime } &= \left (\frac {x}{y}\right ) \frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x}\\ &= \frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{y}\\ &= F(x,y) \end{align*}
Since \(F \left (x , y\right )\) has \(y\), then let
\begin{align*} f_x&= x \left (\frac {\partial }{\partial x}F \left (x , y\right )\right )\\ &= \frac {n \left (a \,x^{n} y^{2}-c \,x^{-n}\right )}{y}\\ f_y&= y \left (\frac {\partial }{\partial y}F \left (x , y\right )\right )\\ &= \frac {a \,x^{n} y^{2}-c \,x^{-n}}{y}\\ \alpha &= \frac {f_x}{f_y} \\ &=n \end{align*}
Since \(\alpha \) is independent of \(x,y\) then this is Homogeneous type G.
Let
\begin{align*} y&=\frac {z}{x^ \alpha }\\ &=\frac {z}{x^{n}} \end{align*}
Substituting the above back into \(F(x,y)\) gives
\begin{align*} F \left (z \right ) &=\frac {a \,z^{2}+z b +c}{z} \end{align*}
We see that \(F \left (z \right )\) does not depend on \(x\) nor on \(y\). If this was not the case, then this method will not
work.
Therefore, the implicit solution is given by
\begin{align*} \ln \left (x \right )- c_1 - \int ^{y x^\alpha } \frac {1}{z \left (\alpha + F(z)\right ) } \,dz & = 0 \end{align*}
Which gives
\[
\ln \left (x \right )-c_1 +\int _{}^{y x^{n}}\frac {1}{z \left (-n -\frac {a \,z^{2}+z b +c}{z}\right )}d z = 0
\]
The value of the above is \[
\ln \left (x \right )-c_1 -\frac {2 \arctan \left (\frac {2 a \,x^{n} y+b +n}{\sqrt {4 a c -b^{2}-2 b n -n^{2}}}\right )}{\sqrt {4 a c -b^{2}-2 b n -n^{2}}} = 0
\]
Solving for \(y\) gives \begin{align*}
y &= -\frac {\left (\tan \left (-\frac {\ln \left (x \right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}+\frac {c_1 \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}\right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}+b +n \right ) x^{-n}}{2 a} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= -\frac {\left (\tan \left (-\frac {\ln \left (x \right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}+\frac {c_1 \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}\right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}+b +n \right ) x^{-n}}{2 a} \\
\end{align*}
2.2.36.2 Solved using first_order_ode_riccati
0.674 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime } x&=a \,x^{n} y^{2}+b y+c \,x^{-n} \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= \frac {a \,x^{n} y^{2}+b y+c \,x^{-n}}{x} \end{align*}
This is a Riccati ODE. Comparing the ODE to solve
\[
y' = \frac {x^{n} a y^{2}}{x}+\frac {b y}{x}+\frac {c \,x^{-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 {c \,x^{-n}}{x}\), \(f_1(x)=\frac {b}{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 {b a \,x^{n}}{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 \,x^{n} u^{\prime \prime }\left (x \right )}{x}-\left (\frac {a \,x^{n} n}{x^{2}}-\frac {a \,x^{n}}{x^{2}}+\frac {b a \,x^{n}}{x^{2}}\right ) u^{\prime }\left (x \right )+\frac {a^{2} c \,x^{n} u \left (x \right )}{x^{3}} = 0
\]
Entering second order change of variable
on \(x\) method 2 solverIn normal form the ode \begin{align*} \frac {a \,x^{n} \left (\frac {d^{2}u}{d x^{2}}\right )}{x}-\left (\frac {a \,x^{n} n}{x^{2}}-\frac {a \,x^{n}}{x^{2}}+\frac {b a \,x^{n}}{x^{2}}\right ) \left (\frac {d u}{d x}\right )+\frac {a^{2} c \,x^{n} u}{x^{3}} = 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&=0 \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=\frac {1-b -n}{x}\\ q \left (x \right )&=\frac {a c}{x^{2}} \end{align*}
Applying change of variables \(\tau = g \left (x \right )\) to (2) gives
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+p_{1} \left (\frac {d}{d \tau }u \left (\tau \right )\right )+q_{1} u \left (\tau \right )&=0 \tag {3} \end{align*}
Where \(\tau \) is the new independent variable, and
\begin{align*} p_{1} \left (\tau \right ) &=\frac {\frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {4} \\ q_{1} \left (\tau \right ) &=\frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {5} \end{align*}
Let \(p_{1} = 0\). Eq (4) simplifies to
\begin{align*} \frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )&=0 \end{align*}
This ode is solved resulting in
\begin{align*} \tau &= \int {\mathrm e}^{-\int p \left (x \right )d x}d x\\ &= \int {\mathrm e}^{-\int \frac {1-b -n}{x}d x}d x\\ &= \int e^{\left (b +n -1\right ) \ln \left (x \right )} \,dx\\ &= \int x^{b +n -1}d x\\ &= \frac {x^{b +n}}{b +n}\tag {6} \end{align*}
Using (6) to evaluate \(q_{1}\) from (5) gives
\begin{align*} q_{1} \left (\tau \right ) &= \frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\\ &= \frac {\frac {a c}{x^{2}}}{x^{2 b +2 n -2}}\\ &= a c \,x^{-2 b -2 n}\tag {7} \end{align*}
Substituting the above in (3) and noting that now \(p_{1} = 0\) results in
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+q_{1} u \left (\tau \right )&=0 \\ \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+a c \,x^{-2 b -2 n} u \left (\tau \right )&=0 \\ \end{align*}
But in terms of \(\tau \)
\begin{align*} a c \,x^{-2 b -2 n}&=\frac {a c}{\left (b +n \right )^{2} \tau ^{2}} \end{align*}
Hence the above ode becomes
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+\frac {a c u \left (\tau \right )}{\left (b +n \right )^{2} \tau ^{2}}&=0 \end{align*}
The above ode is now solved for \(u \left (\tau \right )\). Entering kovacic solverWriting the ode as
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+\frac {a c u \left (\tau \right )}{\left (b +n \right )^{2} \tau ^{2}} &= 0 \tag {1} \\ A \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right ) + B \frac {d}{d \tau }u \left (\tau \right ) + C u \left (\tau \right ) &= 0 \tag {2} \end{align*}
Comparing (1) and (2) shows that
\begin{align*} A &= 1 \\ B &= 0\tag {3} \\ C &= \frac {a c}{\left (b +n \right )^{2} \tau ^{2}} \end{align*}
Applying the Liouville transformation on the dependent variable gives
\begin{align*} z(\tau ) &= u \left (\tau \right ) e^{\int \frac {B}{2 A} \,d\tau } \end{align*}
Then (2) becomes
\begin{align*} z''(\tau ) = r z(\tau )\tag {4} \end{align*}
Where \(r\) is given by
\begin{align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end{align*}
Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives
\begin{align*} r &= \frac {-a c}{\tau ^{2} \left (b^{2}+2 b n +n^{2}\right )}\tag {6} \end{align*}
Comparing the above to (5) shows that
\begin{align*} s &= -a c\\ t &= \tau ^{2} \left (b^{2}+2 b n +n^{2}\right ) \end{align*}
Therefore eq. (4) becomes
\begin{align*} z''(\tau ) &= \left ( -\frac {a c}{\tau ^{2} \left (b^{2}+2 b n +n^{2}\right )}\right ) z(\tau )\tag {7} \end{align*}
Equation (7) is now solved. After finding \(z(\tau )\) then \(u \left (\tau \right )\) is found using the inverse transformation
\begin{align*} u \left (\tau \right ) &= z \left (\tau \right ) e^{-\int \frac {B}{2 A} \,d\tau } \end{align*}
The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases
depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table summarizes these
cases.
| | |
| Case |
Allowed pole order for \(r\) |
Allowed value for \(\mathcal {O}(\infty )\) |
| | |
| 1 |
\(\left \{ 0,1,2,4,6,8,\cdots \right \} \) |
\(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \) |
| | |
|
2
|
Need to have at least one pole
that is either order \(2\) or odd order
greater than \(2\). Any other pole order
is allowed as long as the above
condition is satisfied. Hence the
following set of pole orders are all
allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\). |
no condition |
| | |
| 3 |
\(\left \{ 1,2\right \} \) |
\(\left \{ 2,3,4,5,6,7,\cdots \right \} \) |
| | |
Table 2.4: Necessary conditions for each Kovacic case
The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore
\begin{align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 2 - 0 \\ &= 2 \end{align*}
The poles of \(r\) in eq. (7) and the order of each pole are determined by solving for the roots of \(t=\tau ^{2} \left (b^{2}+2 b n +n^{2}\right )\).
There is a pole at \(\tau =0\) of order \(2\). Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is
\(2\) then the necessary conditions for case one are met. Since there is a pole of order \(2\)
then necessary conditions for case two are met. Since pole order is not larger than \(2\)
and the order at \(\infty \) is \(2\) then the necessary conditions for case three are met. Therefore
\begin{align*} L &= [1, 2, 4, 6, 12] \end{align*}
Attempting to find a solution using case \(n=1\).
Unable to find solution using case one
Attempting to find a solution using case \(n=2\).
Looking at poles of order 2. The partial fractions decomposition of \(r\) is
\[
r = -\frac {a c}{\tau ^{2} \left (b^{2}+2 b n +n^{2}\right )}
\]
For the pole at \(\tau =0\) let \(b\) be the
coefficient of \(\frac {1}{ \tau ^{2}}\) in the partial fractions decomposition of \(r\) given above. Therefore \(b=-\frac {a c}{\left (b +n \right )^{2}}\). Hence
\begin{align*} E_c &= \{2, 2+2\sqrt {1+4 b}, 2-2\sqrt {1+4 b} \} \\ &= \left \{2, 2-2 \sqrt {1-\frac {4 a c}{\left (b +n \right )^{2}}}, 2+2 \sqrt {1-\frac {4 a c}{\left (b +n \right )^{2}}}\right \} \end{align*}
Since the order of \(r\) at \(\infty \) is 2 then let \(b\) be the coefficient of \(\frac {1}{\tau ^{2}}\) in the Laurent series expansion of \(r\) at \(\infty \).
which can be found by dividing the leading coefficient of \(s\) by the leading coefficient of \(t\) from
\begin{alignat*}{2} r &= \frac {s}{t} &&= -\frac {a c}{\tau ^{2} \left (b^{2}+2 b n +n^{2}\right )} \end{alignat*}
Since the \(\text {gcd}(s,t)=1\). This gives \(b=-1\). Hence
\begin{align*} E_\infty &= \{2, 2+2\sqrt {1+4 b}, 2-2\sqrt {1+4 b} \} \\ &= \{2\} \end{align*}
The following table summarizes the findings so far for poles and for the order of \(r\) at \(\infty \) for case 2 of
Kovacic algorithm.
| | |
| pole \(c\) location |
pole order |
\(E_c\) |
| | |
| \(0\) | \(2\) | \(\left \{2, 2-2 \sqrt {1-\frac {4 a c}{\left (b +n \right )^{2}}}, 2+2 \sqrt {1-\frac {4 a c}{\left (b +n \right )^{2}}}\right \}\) |
| | |
| |
| Order of \(r\) at \(\infty \) |
\(E_\infty \) |
| |
| \(2\) |
\(\{2\}\) |
| |
Using the family \(\{e_1,e_2,\dots ,e_\infty \}\) given by
\[ e_1=2,\hspace {3pt} e_\infty =2 \]
Gives a non negative integer \(d\) (the degree of the polynomial \(p(\tau )\)), which is
generated using \begin{align*} d &= \frac {1}{2} \left ( e_\infty - \sum _{c \in \Gamma } e_c \right )\\ &= \frac {1}{2} \left ( 2 - \left (2\right )\right )\\ &= 0 \end{align*}
We now form the following rational function
\begin{align*} \theta &= \frac {1}{2} \sum _{c \in \Gamma } \frac {e_c}{\tau -c} \\ &= \frac {1}{2} \left (\frac {2}{\left (\tau -\left (0\right )\right )}\right ) \\ &= \frac {1}{\tau } \end{align*}
Now we search for a monic polynomial \(p(\tau )\) of degree \(d=0\) such that
\[ p'''+3 \theta p'' + \left (3 \theta ^2 + 3 \theta ' - 4 r\right )p' + \left (\theta '' + 3 \theta \theta ' + \theta ^3 - 4 r \theta - 2 r' \right ) p = 0 \tag {1A} \]
Since \(d=0\), then letting \[ p = 1\tag {2A} \]
Substituting \(p\)
and \(\theta \) into Eq. (1A) gives \[
0 = 0
\]
And solving for \(p\) gives \[ p = 1 \]
Now that \(p(\tau )\) is found let \begin{align*} \phi &= \theta + \frac {p'}{p}\\ &= \frac {1}{\tau } \end{align*}
Let \(\omega \) be the solution of
\begin{align*} \omega ^2 - \phi \omega + \left ( \frac {1}{2} \phi ' + \frac {1}{2} \phi ^2 - r \right ) &= 0 \end{align*}
Substituting the values for \(\phi \) and \(r\) into the above equation gives
\[
w^{2}-\frac {w}{\tau }+\frac {a c}{\left (b +n \right )^{2} \tau ^{2}} = 0
\]
Solving for \(\omega \) gives \begin{align*} \omega &= \frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 \left (b +n \right ) \tau } \end{align*}
Therefore the first solution to the ode \(z'' = r z\) is
\begin{align*} z_1(\tau ) &= e^{ \int \omega \,d\tau } \\ &= {\mathrm e}^{\int \frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 \left (b +n \right ) \tau }d \tau }\\ &= \tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \end{align*}
The first solution to the original ode in \(u \left (\tau \right )\) is found from
\[
u_1 = z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,d\tau }
\]
Since \(B=0\) then the above reduces to
\begin{align*}
u_1 &= z_1 \\
&= \tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \\
\end{align*}
Which simplifies to \[
u_1 = \tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}
\]
The second solution \(u_2\) to the original ode is
found using reduction of order \[ u_2 = u_1 \int \frac { e^{\int -\frac {B}{A} \,d\tau }}{u_1^2} \,d\tau \]
Since \(B=0\) then the above becomes \begin{align*}
u_2 &= u_1 \int \frac {1}{u_1^2} \,d\tau \\
&= \tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\int \frac {1}{\tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{b +n}}} \,d\tau \\
&= \tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\left (\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\, \left (b +n \right ) \tau \,{\mathrm e}^{-\frac {\left (b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \ln \left (\tau \right )}{b +n}}}{4 a c -b^{2}-2 b n -n^{2}}\right ) \\
\end{align*}
Therefore the solution
is
\begin{align*}
u \left (\tau \right ) &= c_1 u_1 + c_2 u_2 \\
&= c_1 \left (\tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\right ) + c_2 \left (\tau ^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\left (\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\, \left (b +n \right ) \tau \,{\mathrm e}^{-\frac {\left (b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \ln \left (\tau \right )}{b +n}}}{4 a c -b^{2}-2 b n -n^{2}}\right )\right ) \\
\end{align*}
The above solution is now transformed back to \(u\) using (6) which results in \[
u = c_1 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}-\frac {c_2 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n \right )}{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}
\]
Taking derivative
gives \begin{equation}
\tag{4} u^{\prime }\left (x \right ) = \frac {c_1 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right )}{2 x}-\frac {c_2 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \left (b +n \right )^{2}}{\left (2 b +2 n \right ) x \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}
\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 (\frac {c_1 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right )}{2 x}-\frac {c_2 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \left (b +n \right )^{2}}{\left (2 b +2 n \right ) x \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}\right ) x^{-n} x}{a \left (c_1 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}-\frac {c_2 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n \right )}{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}\right )} \\
\end{align*}
Doing change of constants, the above
solution becomes \[
y = -\frac {\left (\frac {\left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right )}{2 x}-\frac {c_3 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \left (b +n \right )^{2}}{\left (2 b +2 n \right ) x \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}\right ) x^{-n} x}{a \left (\left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}-\frac {c_3 \left (\frac {x^{b +n}}{b +n}\right )^{\frac {b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}} \left (b +n \right )}{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}\right )}
\]
Simplifying the above gives \begin{align*}
y &= -\frac {2 x^{-n} \left (\frac {c_3 \left (b +n \right ) \left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \left (\frac {x^{b +n}}{b +n}\right )^{-\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}}{4}+\left (-\frac {\left (b +n \right ) \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+a c -\frac {b^{2}}{4}-\frac {b n}{2}-\frac {n^{2}}{4}\right ) \left (\frac {x^{b +n}}{b +n}\right )^{\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\right )}{a \left (\left (b +n \right ) c_3 \left (\frac {x^{b +n}}{b +n}\right )^{-\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}-\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\, \left (\frac {x^{b +n}}{b +n}\right )^{\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\right )} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= -\frac {2 x^{-n} \left (\frac {c_3 \left (b +n \right ) \left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) \left (\frac {x^{b +n}}{b +n}\right )^{-\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}}{4}+\left (-\frac {\left (b +n \right ) \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+a c -\frac {b^{2}}{4}-\frac {b n}{2}-\frac {n^{2}}{4}\right ) \left (\frac {x^{b +n}}{b +n}\right )^{\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\right )}{a \left (\left (b +n \right ) c_3 \left (\frac {x^{b +n}}{b +n}\right )^{-\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}-\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\, \left (\frac {x^{b +n}}{b +n}\right )^{\frac {\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{2 b +2 n}}\right )} \\
\end{align*}
2.2.36.3 Solved using first_order_ode_riccati_by_guessing_particular_solution
0.181 (sec)
Entering first order ode riccati guess solver
\begin{align*}
y^{\prime } x&=a \,x^{n} y^{2}+b y+c \,x^{-n} \\
\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 {c \,x^{-n}}{x}\\ f_1(x) & =\frac {b}{x}\\ f_2(x) &=\frac {a \,x^{n}}{x} \end{align*}
Using trial and error, the following particular solution was found
\[
y_p = \frac {\left (-b -n +\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) x^{-n}}{2 a}
\]
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 = \frac {\left (a \left (-\frac {\left (b +n \right ) \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+a c -\frac {\left (b +n \right )^{2}}{4}\right ) x^{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}-\left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) c_1 \left (a c -\frac {\left (b +n \right )^{2}}{4}\right )\right ) x^{-n}}{2 a \left (\frac {a \,x^{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}} \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+c_1 \left (a c -\frac {\left (b +n \right )^{2}}{4}\right )\right )}
\]
Summary of solutions found
\begin{align*}
y &= \frac {\left (a \left (-\frac {\left (b +n \right ) \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+a c -\frac {\left (b +n \right )^{2}}{4}\right ) x^{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}}-\left (b +n -\sqrt {-4 a c +b^{2}+2 b n +n^{2}}\right ) c_1 \left (a c -\frac {\left (b +n \right )^{2}}{4}\right )\right ) x^{-n}}{2 a \left (\frac {a \,x^{\sqrt {-4 a c +b^{2}+2 b n +n^{2}}} \sqrt {-4 a c +b^{2}+2 b n +n^{2}}}{4}+c_1 \left (a c -\frac {\left (b +n \right )^{2}}{4}\right )\right )} \\
\end{align*}
2.2.36.4 Solved using first_order_ode_LIE
1.006 (sec)
Entering first order ode LIE solver
\begin{align*}
y^{\prime } x&=a \,x^{n} y^{2}+b y+c \,x^{-n} \\
\end{align*}
Writing the ode as \begin{align*} y^{\prime }&=\frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x}\\ y^{\prime }&= \omega \left ( x,y\right ) \end{align*}
The condition of Lie symmetry is the linearized PDE given by
\begin{align*} \eta _{x}+\omega \left ( \eta _{y}-\xi _{x}\right ) -\omega ^{2}\xi _{y}-\omega _{x}\xi -\omega _{y}\eta =0\tag {A} \end{align*}
To determine \(\xi ,\eta \) then (A) is solved using ansatz. Making bivariate polynomials of degree 1 to use as
anstaz gives
\begin{align*}
\tag{1E} \xi &= x a_{2}+y a_{3}+a_{1} \\
\tag{2E} \eta &= x b_{2}+y b_{3}+b_{1} \\
\end{align*}
Where the unknown coefficients are \[
\{a_{1}, a_{2}, a_{3}, b_{1}, b_{2}, b_{3}\}
\]
Substituting equations (1E,2E) and \(\omega \) into (A)
gives \begin{equation}
\tag{5E} b_{2}+\frac {\left (a \,x^{n} y^{2}+b y +c \,x^{-n}\right ) \left (b_{3}-a_{2}\right )}{x}-\frac {\left (a \,x^{n} y^{2}+b y +c \,x^{-n}\right )^{2} a_{3}}{x^{2}}-\left (\frac {\frac {a \,x^{n} n \,y^{2}}{x}-\frac {c \,x^{-n} n}{x}}{x}-\frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x^{2}}\right ) \left (x a_{2}+y a_{3}+a_{1}\right )-\frac {\left (2 a \,x^{n} y +b \right ) \left (x b_{2}+y b_{3}+b_{1}\right )}{x} = 0
\end{equation}
Putting the above in normal form gives \[
-\frac {2 x^{n} a \,x^{2} y b_{2}+x^{n} a x \,y^{2} b_{3}+2 x^{n} a x y b_{1}+2 x^{-n} b c y a_{3}-x^{-n} c n x a_{2}-x^{-n} c n y a_{3}+2 x^{n} a b \,y^{3} a_{3}+x^{n} a n \,y^{3} a_{3}+x^{n} a n \,y^{2} a_{1}+x^{2 n} a^{2} y^{4} a_{3}+2 x^{n} x^{-n} a c \,y^{2} a_{3}+x^{n} a n x \,y^{2} a_{2}+b^{2} y^{2} a_{3}+b \,x^{2} b_{2}-b \,y^{2} a_{3}+b x b_{1}-b y a_{1}-x^{-n} c a_{1}-x^{n} a \,y^{3} a_{3}-x^{n} a \,y^{2} a_{1}-x^{-n} c n a_{1}-x^{-n} c x b_{3}-x^{-n} c y a_{3}-b_{2} x^{2}+x^{-2 n} c^{2} a_{3}}{x^{2}} = 0
\]
Setting the numerator to zero gives \begin{equation}
\tag{6E} -2 x^{n} a \,x^{2} y b_{2}-x^{n} a x \,y^{2} b_{3}-2 x^{n} a x y b_{1}-2 x^{-n} b c y a_{3}+x^{-n} c n x a_{2}+x^{-n} c n y a_{3}-2 x^{n} a b \,y^{3} a_{3}-x^{n} a n \,y^{3} a_{3}-x^{n} a n \,y^{2} a_{1}-x^{2 n} a^{2} y^{4} a_{3}-2 x^{n} x^{-n} a c \,y^{2} a_{3}-x^{n} a n x \,y^{2} a_{2}-b^{2} y^{2} a_{3}-b \,x^{2} b_{2}+b \,y^{2} a_{3}-b x b_{1}+b y a_{1}+x^{-n} c a_{1}+x^{n} a \,y^{3} a_{3}+x^{n} a \,y^{2} a_{1}+x^{-n} c n a_{1}+x^{-n} c x b_{3}+x^{-n} c y a_{3}+b_{2} x^{2}-x^{-2 n} c^{2} a_{3} = 0
\end{equation}
Simplifying
the above gives \begin{equation}
\tag{6E} -\left (2 b c y a_{3} x^{n}-c n x a_{2} x^{n}-c n y a_{3} x^{n}+x^{3 n} a n \,y^{2} a_{1}+2 x^{3 n} a \,x^{2} y b_{2}+x^{3 n} a x \,y^{2} b_{3}+2 x^{3 n} a x y b_{1}+2 a c \,y^{2} a_{3} x^{2 n}+2 x^{3 n} a b \,y^{3} a_{3}+x^{3 n} a n \,y^{3} a_{3}+x^{3 n} a n x \,y^{2} a_{2}-c n a_{1} x^{n}-c x b_{3} x^{n}-c y a_{3} x^{n}+x^{4 n} a^{2} y^{4} a_{3}-x^{3 n} a \,y^{3} a_{3}-x^{3 n} a \,y^{2} a_{1}+b^{2} y^{2} a_{3} x^{2 n}+b \,x^{2} b_{2} x^{2 n}-b \,y^{2} a_{3} x^{2 n}+b x b_{1} x^{2 n}-b y a_{1} x^{2 n}+c^{2} a_{3}-c a_{1} x^{n}-b_{2} x^{2} x^{2 n}\right ) x^{-2 n} = 0
\end{equation}
Looking at the above PDE shows the following are all the terms with \(\{x, y\}\) in them. \[
\{x, y, x^{n}\}
\]
The following substitution is now made to be able to collect on all terms with \(\{x, y\}\) in them \[
\{x = v_{1}, y = v_{2}, x^{n} = v_{3}\}
\]
The
above PDE (6E) now becomes \begin{equation}
\tag{7E} -\frac {v_{3}^{4} a^{2} v_{2}^{4} a_{3}+2 v_{3}^{3} a b v_{2}^{3} a_{3}+v_{3}^{3} a n v_{1} v_{2}^{2} a_{2}+v_{3}^{3} a n v_{2}^{3} a_{3}+v_{3}^{3} a n v_{2}^{2} a_{1}-v_{3}^{3} a v_{2}^{3} a_{3}+2 v_{3}^{3} a v_{1}^{2} v_{2} b_{2}+v_{3}^{3} a v_{1} v_{2}^{2} b_{3}+2 a c v_{2}^{2} a_{3} v_{3}^{2}-v_{3}^{3} a v_{2}^{2} a_{1}+2 v_{3}^{3} a v_{1} v_{2} b_{1}+b^{2} v_{2}^{2} a_{3} v_{3}^{2}-b v_{2}^{2} a_{3} v_{3}^{2}+b v_{1}^{2} b_{2} v_{3}^{2}+2 b c v_{2} a_{3} v_{3}-b v_{2} a_{1} v_{3}^{2}+b v_{1} b_{1} v_{3}^{2}-c n v_{1} a_{2} v_{3}-c n v_{2} a_{3} v_{3}-b_{2} v_{1}^{2} v_{3}^{2}-c n a_{1} v_{3}-c v_{2} a_{3} v_{3}-c v_{1} b_{3} v_{3}+c^{2} a_{3}-c a_{1} v_{3}}{v_{3}^{2}} = 0
\end{equation}
Collecting the above on the terms \(v_i\) introduced, and these are \[
\{v_{1}, v_{2}, v_{3}\}
\]
Equation (7E) now becomes \begin{equation}
\tag{8E} -2 a b_{2} v_{3} v_{1}^{2} v_{2}+\left (-b b_{2}+b_{2}\right ) v_{1}^{2}+\left (-a n a_{2}-a b_{3}\right ) v_{1} v_{2}^{2} v_{3}-2 a b_{1} v_{3} v_{1} v_{2}-b b_{1} v_{1}+\frac {\left (c n a_{2}+c b_{3}\right ) v_{1}}{v_{3}}-a^{2} a_{3} v_{3}^{2} v_{2}^{4}+\left (-2 a b a_{3}-a n a_{3}+a a_{3}\right ) v_{2}^{3} v_{3}+\left (-a n a_{1}+a a_{1}\right ) v_{2}^{2} v_{3}+\left (-2 a c a_{3}-b^{2} a_{3}+b a_{3}\right ) v_{2}^{2}+b a_{1} v_{2}+\frac {\left (-2 b c a_{3}+c n a_{3}+c a_{3}\right ) v_{2}}{v_{3}}+\frac {c n a_{1}+c a_{1}}{v_{3}}-\frac {c^{2} a_{3}}{v_{3}^{2}} = 0
\end{equation}
Setting each coefficients in (8E) to zero gives the following equations
to solve \begin{align*} b a_{1}&=0\\ -2 a b_{1}&=0\\ -2 a b_{2}&=0\\ -a^{2} a_{3}&=0\\ -b b_{1}&=0\\ -c^{2} a_{3}&=0\\ -b b_{2}+b_{2}&=0\\ -a n a_{1}+a a_{1}&=0\\ c n a_{1}+c a_{1}&=0\\ -a n a_{2}-a b_{3}&=0\\ c n a_{2}+c b_{3}&=0\\ -2 a c a_{3}-b^{2} a_{3}+b a_{3}&=0\\ -2 a b a_{3}-a n a_{3}+a a_{3}&=0\\ -2 b c a_{3}+c n a_{3}+c a_{3}&=0 \end{align*}
Solving the above equations for the unknowns gives
\begin{align*} a_{1}&=0\\ a_{2}&=a_{2}\\ a_{3}&=0\\ b_{1}&=0\\ b_{2}&=0\\ b_{3}&=-n a_{2} \end{align*}
Substituting the above solution in the anstaz (1E,2E) (using \(1\) as arbitrary value for any unknown
in the RHS) gives
\begin{align*}
\xi &= x \\
\eta &= -n y \\
\end{align*}
Shifting is now applied to make \(\xi =0\) in order to simplify the rest of the
computation \begin{align*} \eta &= \eta - \omega \left (x,y\right ) \xi \\ &= -n y - \left (\frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x}\right ) \left (x\right ) \\ &= -c \,x^{-n}-y \left (a \,x^{n} y +b +n \right )\\ \xi &= 0 \end{align*}
The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( x,y\right ) \to \left ( R,S \right )\) where \(\left ( R,S \right )\)
are the canonical coordinates which make the original ode become a quadrature and hence solved
by integration.
The characteristic pde which is used to find the canonical coordinates is
\begin{align*} \frac {d x}{\xi } &= \frac {d y}{\eta } = dS \tag {1} \end{align*}
The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial x} + \eta \frac {\partial }{\partial y}\right ) S(x,y) = 1\). Starting with the first pair of ode’s in (1) gives an
ode to solve for the independent variable \(R\) in the canonical coordinates, where \(S(R)\). Since \(\xi =0\) then in this
special case
\begin{align*} R = x \end{align*}
\(S\) is found from
\begin{align*} S &= \int { \frac {1}{\eta }} dy\\ &= \int { \frac {1}{-c \,x^{-n}-y \left (a \,x^{n} y +b +n \right )}} dy \end{align*}
Which results in
\begin{align*} S&= -\frac {2 \arctan \left (\frac {2 a \,x^{n} y +b +n}{\sqrt {4 x^{n} x^{-n} a c -b^{2}-2 b n -n^{2}}}\right )}{\sqrt {4 x^{n} x^{-n} a c -b^{2}-2 b n -n^{2}}} \end{align*}
Now that \(R,S\) are found, we need to setup the ode in these coordinates. This is done by evaluating
\begin{align*} \frac {dS}{dR} &= \frac { S_{x} + \omega (x,y) S_{y} }{ R_{x} + \omega (x,y) R_{y} }\tag {2} \end{align*}
Where in the above \(R_{x},R_{y},S_{x},S_{y}\) are all partial derivatives and \(\omega (x,y)\) is the right hand side of the original ode given
by
\begin{align*} \omega (x,y) &= \frac {a \,x^{n} y^{2}+b y +c \,x^{-n}}{x} \end{align*}
Evaluating all the partial derivatives gives
\begin{align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= -\frac {n y \,x^{n -1}}{x^{2 n} a \,y^{2}+x^{n} \left (b +n \right ) y +c}\\ S_{y} &= -\frac {x^{n}}{x^{2 n} a \,y^{2}+x^{n} \left (b +n \right ) y +c} \end{align*}
Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.
\begin{align*} \frac {dS}{dR} &= -\frac {1}{x}\tag {2A} \end{align*}
We now need to express the RHS as function of \(R\) only. This is done by solving for \(x,y\) in terms of \(R,S\)
from the result obtained earlier and simplifying. This gives
\begin{align*} \frac {dS}{dR} &= -\frac {1}{R} \end{align*}
The above is a quadrature ode. This is the whole point of Lie symmetry method. It converts an
ode, no matter how complicated it is, to one that can be solved by integration when the ode is in
the canonical coordiates \(R,S\).
Since the ode has the form \(\frac {d}{d R}S \left (R \right )=f(R)\), then we only need to integrate \(f(R)\).
\begin{align*} \int {dS} &= \int {-\frac {1}{R}\, dR}\\ S \left (R \right ) &= -\ln \left (R \right ) + c_2 \end{align*}
\begin{align*} S \left (R \right )&= -\ln \left (R \right )+c_2 \end{align*}
To complete the solution, we just need to transform the above back to \(x,y\) coordinates. This results
in
\begin{align*} -\frac {2 \arctan \left (\frac {2 a \,x^{n} y+b +n}{\sqrt {4 a c -b^{2}-2 b n -n^{2}}}\right )}{\sqrt {4 a c -b^{2}-2 b n -n^{2}}} = -\ln \left (x \right )+c_2 \end{align*}
Solving for \(y\) gives
\begin{align*}
y &= -\frac {\left (\tan \left (-\frac {\ln \left (x \right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}+\frac {c_2 \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}\right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}+b +n \right ) x^{-n}}{2 a} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= -\frac {\left (\tan \left (-\frac {\ln \left (x \right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}+\frac {c_2 \sqrt {4 a c -b^{2}-2 b n -n^{2}}}{2}\right ) \sqrt {4 a c -b^{2}-2 b n -n^{2}}+b +n \right ) x^{-n}}{2 a} \\
\end{align*}
2.2.36.5 ✓ Maple. Time used: 0.006 (sec). Leaf size: 73
ode:=x*diff(y(x),x) = a*x^n*y(x)^2+b*y(x)+c*x^(-n);
dsolve(ode,y(x), singsol=all);
\[
y = \frac {x^{-n} \left (\tan \left (\frac {\sqrt {4 c a -b^{2}-2 b n -n^{2}}\, \left (\ln \left (x \right )-c_1 \right )}{2}\right ) \sqrt {4 c a -b^{2}-2 b n -n^{2}}-b -n \right )}{2 a}
\]
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 homogeneous G
<- homogeneous 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^{13242} y \left (x \right )^{2}+b y \left (x \right )+\frac {c}{x^{13242}} \\ \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^{13242} y \left (x \right )^{2}+b y \left (x \right )+\frac {c}{x^{13242}}}{x} \end {array} \]
2.2.36.6 ✓ Mathematica. Time used: 0.344 (sec). Leaf size: 138
ode=x*D[y[x],x]==a*x^n*y[x]^2+b*y[x]+c*x^(-n);
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \frac {x^{-n} \left (\frac {\sqrt {-4 a c+b^2+2 b n+n^2} \left (-x^{\sqrt {-4 a c+b^2+2 b n+n^2}}+c_1\right )}{x^{\sqrt {-4 a c+b^2+2 b n+n^2}}+c_1}-b-n\right )}{2 a}\\ y(x)&\to \frac {x^{-n} \left (\sqrt {-4 a c+b^2+2 b n+n^2}-b-n\right )}{2 a} \end{align*}
2.2.36.7 ✗ 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*x**n*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 -x**(-n - 2)*(c*x + x**(n + 1)*(a*x**n*y(x) + b)*y(x)) + Derivat
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')