2.25.9 Problem 15
Internal
problem
ID
[13624]
Book
:
Handbook
of
exact
solutions
for
ordinary
differential
equations.
By
Polyanin
and
Zaitsev.
Second
edition
Section
:
Chapter
1,
section
1.3.
Abel
Equations
of
the
Second
Kind.
subsection
1.3.4-2.
Problem
number
:
15
Date
solved
:
Wednesday, December 31, 2025 at 10:03:47 PM
CAS
classification
:
[[_1st_order, _with_linear_symmetries], _rational, [_Abel, `2nd type`, `class B`]]
Entering first order ode abel second kind solver
\begin{align*}
\left (x y+x^{2}+a \right ) y^{\prime }&=y^{2}+x y+b \\
\end{align*}
2.25.9.1 Solved using first_order_ode_abel_second_kind_solved_by_converting_to_first_kind
14.721 (sec)
This is Abel second kind ODE, it has the form
\[ \left (y+g\right )y^{\prime }= f_0(x)+f_1(x) y +f_2(x)y^{2}+f_3(x)y^{3} \]
Comparing the above to given ODE which is
\begin{align*}\left (x y+x^{2}+a \right ) y^{\prime } = y^{2}+x y+b\tag {1} \end{align*}
Shows that
\begin{align*} g &= \frac {x^{2}+a}{x}\\ f_0 &= \frac {b}{x}\\ f_1 &= 1\\ f_2 &= \frac {1}{x}\\ f_3 &= 0 \end{align*}
Applying transformation
\begin{align*} y&=\frac {1}{u(x)}-g \end{align*}
Results in the new ode which is Abel first kind
\begin{align*} u^{\prime }\left (x \right ) = -\frac {\left (a \,x^{2}+b \,x^{2}+a^{2}\right ) u \left (x \right )^{3}}{x^{3}}+\frac {3 a u \left (x \right )^{2}}{x^{2}}-\frac {u \left (x \right )}{x} \end{align*}
Which is now solved.
Entering first order ode abel first kind solverThis is Abel first kind ODE, it has the form
\[ u^{\prime }\left (x \right )= f_0(x)+f_1(x) u \left (x \right ) +f_2(x)u \left (x \right )^{2}+f_3(x)u \left (x \right )^{3} \]
Comparing the above to given ODE which is \begin{align*}u^{\prime }\left (x \right )&=-\frac {\left (a \,x^{2}+b \,x^{2}+a^{2}\right ) u \left (x \right )^{3}}{x^{3}}+\frac {3 a u \left (x \right )^{2}}{x^{2}}-\frac {u \left (x \right )}{x}\tag {1} \end{align*}
Therefore
\begin{align*} f_0 &= 0\\ f_1 &= -\frac {1}{x}\\ f_2 &= \frac {3 a}{x^{2}}\\ f_3 &= -\frac {a}{x}-\frac {b}{x}-\frac {a^{2}}{x^{3}} \end{align*}
Hence
\begin{align*} f'_{0} &= 0\\ f'_{3} &= \frac {a}{x^{2}}+\frac {b}{x^{2}}+\frac {3 a^{2}}{x^{4}} \end{align*}
Since \(f_2(x)=\frac {3 a}{x^{2}}\) is not zero, then the followingtransformation is used to remove \(f_2\). Let \(u \left (x \right ) = u(x) - \frac {f_2}{3 f_3}\) or
\begin{align*} u \left (x \right ) &= u(x) - \left ( \frac {\frac {3 a}{x^{2}}}{-\frac {3 a}{x}-\frac {3 b}{x}-\frac {3 a^{2}}{x^{3}}} \right ) \\ &= u \left (x \right )+\frac {a x}{\left (a +b \right ) x^{2}+a^{2}} \end{align*}
The above transformation applied to (1) gives a new ODE as
\begin{align*} u^{\prime }\left (x \right ) = -\frac {\left (a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}\right ) u \left (x \right )^{3}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}-\frac {\left (x^{4} a +b \,x^{4}-2 a^{2} x^{2}\right ) u \left (x \right )}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\tag {2} \end{align*}
The above ODE (2) can now be solved.
Entering first order ode bernoulli solver In canonical form, the ODE is
\begin{align*} u' &= F(x,u)\\ &= \left (-\frac {u \left (a^{2} u^{2} x^{4}+2 a b \,u^{2} x^{4}+b^{2} u^{2} x^{4}+2 a^{3} u^{2} x^{2}+2 a^{2} b \,u^{2} x^{2}+a^{4} u^{2}+x^{4} a +b \,x^{4}-2 a^{2} x^{2}\right )}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\right )_{1} \end{align*}
This is a Bernoulli ODE.
\[ u' = \left (-\frac {x^{4} a +b \,x^{4}-2 a^{2} x^{2}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\right ) u \left (x \right ) + \left (-\frac {a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\right )u^{3} \tag {1} \]
The standard Bernoulli ODE has the form \[ u' = f_0(x)u+f_1(x)u^n \tag {2} \]
Comparing this to (1)
shows that \begin{align*} f_0 &=-\frac {x^{4} a +b \,x^{4}-2 a^{2} x^{2}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\\ f_1 &=-\frac {a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \end{align*}
The first step is to divide the above equation by \(u^n \) which gives
\[ \frac {u'}{u^n} = f_0(x) u^{1-n} +f_1(x) \tag {3} \]
The next step is use the
substitution \(v = u^{1-n}\) in equation (3) which generates a new ODE in \(v \left (x \right )\) which will be linear and can be
easily solved using an integrating factor. Backsubstitution then gives the solution \(u(x)\) which is what
we want.
This method is now applied to the ODE at hand. Comparing the ODE (1) With (2) Shows that
\begin{align*} f_0(x)&=-\frac {x^{4} a +b \,x^{4}-2 a^{2} x^{2}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\\ f_1(x)&=-\frac {a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\\ n &=3 \end{align*}
Dividing both sides of ODE (1) by \(u^n=u^{3}\) gives
\begin{align*} u'\frac {1}{u^{3}} &= -\frac {x^{4} a +b \,x^{4}-2 a^{2} x^{2}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right ) u^{2}} -\frac {a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \tag {4} \end{align*}
Let
\begin{align*} v &= u^{1-n} \\ &= \frac {1}{u^{2}} \tag {5} \end{align*}
Taking derivative of equation (5) w.r.t \(x\) gives
\begin{align*} v' &= -\frac {2}{u^{3}}u' \tag {6} \end{align*}
Substituting equations (5) and (6) into equation (4) gives
\begin{align*} -\frac {v^{\prime }\left (x \right )}{2}&= -\frac {\left (x^{4} a +b \,x^{4}-2 a^{2} x^{2}\right ) v \left (x \right )}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}-\frac {a^{2} x^{4}+2 a b \,x^{4}+x^{4} b^{2}+2 a^{3} x^{2}+2 a^{2} b \,x^{2}+a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\\ v' &= \frac {2 \left (x^{4} a +b \,x^{4}-2 a^{2} x^{2}\right ) v}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}+\frac {2 a^{2} x^{4}+4 a b \,x^{4}+2 x^{4} b^{2}+4 a^{3} x^{2}+4 a^{2} b \,x^{2}+2 a^{4}}{x^{3} \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \tag {7} \end{align*}
The above now is a linear ODE in \(v \left (x \right )\) which is now solved.
In canonical form a linear first order is
\begin{align*} v^{\prime }\left (x \right ) + q(x)v \left (x \right ) &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=-\frac {\left (2 a +2 b \right ) x^{2}-4 a^{2}}{x \left (\left (a +b \right ) x^{2}+a^{2}\right )}\\ p(x) &=\frac {\left (2 a +2 b \right ) x^{2}+2 a^{2}}{x^{3}} \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {\left (2 a +2 b \right ) x^{2}-4 a^{2}}{x \left (\left (a +b \right ) x^{2}+a^{2}\right )}d x}\\ &= \frac {x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}} \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \left (\mu \right ) \left (\frac {\left (2 a +2 b \right ) x^{2}+2 a^{2}}{x^{3}}\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {v \,x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}\right ) &= \left (\frac {x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}\right ) \left (\frac {\left (2 a +2 b \right ) x^{2}+2 a^{2}}{x^{3}}\right ) \\
\mathrm {d} \left (\frac {v \,x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}\right ) &= \left (\frac {\left (\left (2 a +2 b \right ) x^{2}+2 a^{2}\right ) x}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}\right )\, \mathrm {d} x \\
\end{align*}
Integrating gives \begin{align*} \frac {v \,x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}&= \int {\frac {\left (\left (2 a +2 b \right ) x^{2}+2 a^{2}\right ) x}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}} \,dx} \\ &=-\frac {1}{\left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} + c_1 \end{align*}
Dividing throughout by the integrating factor \(\frac {x^{4}}{\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3}}\) gives the final solution
\[ v \left (x \right ) = \frac {\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3} \left (-\frac {1}{\left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}+c_1 \right )}{x^{4}} \]
The substitution \(v = u^{1-n}\) is now
used to convert the above solution back to \(u \left (x \right )\) which results in \[
\frac {1}{u \left (x \right )^{2}} = \frac {\left (\left (a +b \right ) x^{2}+a^{2}\right )^{3} \left (-\frac {1}{\left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}+c_1 \right )}{x^{4}}
\]
Solving for \(u \left (x \right )\) gives \begin{align*}
u \left (x \right ) &= \frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \\
u \left (x \right ) &= -\frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \\
\end{align*}
Now we transform
the solution \(u \left (x \right ) = \frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\) to \(u \left (x \right )\) using \(u \left (x \right ) = u(x) - \frac {f_2}{3 f_3}\), which gives \begin{align*} u \left (x \right ) &= \frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} - \left (\frac {a}{x^{2} \left (-\frac {a}{x}-\frac {b}{x}-\frac {a^{2}}{x^{3}}\right )}\right ) \\ &= \frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}-\frac {a}{x^{2} \left (-\frac {a}{x}-\frac {b}{x}-\frac {a^{2}}{x^{3}}\right )}\\ &= \frac {x \left (\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )\right )}{\left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \end{align*}
Now we transform the solution \(u \left (x \right ) = -\frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\) to \(u \left (x \right )\) using \(u \left (x \right ) = u(x) - \frac {f_2}{3 f_3}\), which gives
\begin{align*} u \left (x \right ) &= -\frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} - \left (\frac {a}{x^{2} \left (-\frac {a}{x}-\frac {b}{x}-\frac {a^{2}}{x^{3}}\right )}\right ) \\ &= -\frac {\sqrt {\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a +b \right )}\, x^{2}}{\left (c_1 \,a^{2} x^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}+c_1 \,a^{3}+c_1 \,a^{2} b -1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}-\frac {a}{x^{2} \left (-\frac {a}{x}-\frac {b}{x}-\frac {a^{2}}{x^{3}}\right )}\\ &= \frac {x \left (-\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )\right )}{\left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )} \end{align*}
Now we transform the solution \(u \left (x \right ) = \frac {x \left (-\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )\right )}{\left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\) to \(y\) using \(u \left (x \right )=\frac {1}{y+\frac {x^{2}+a}{x}}\) which gives
\[
y = \frac {\left (x^{2}+a \right ) \sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}+x \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) b}{-\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )}
\]
Now we transform the solution \(u \left (x \right ) = \frac {x \left (\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )\right )}{\left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )}\) to \(y\) using \(u \left (x \right )=\frac {1}{y+\frac {x^{2}+a}{x}}\)
which gives \[
y = \frac {-\left (x^{2}+a \right ) \sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}+x \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) b}{\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )}
\]
Summary of solutions found
\begin{align*}
y &= \frac {-\left (x^{2}+a \right ) \sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}+x \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) b}{\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )} \\
y &= \frac {\left (x^{2}+a \right ) \sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}+x \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right ) b}{-\sqrt {\left (a +b \right ) \left (-1+c_1 \left (a +b \right ) \left (a \,x^{2}+b \,x^{2}+a^{2}\right )\right )}\, x +a \left (c_1 \,a^{3}+c_1 \left (x^{2}+b \right ) a^{2}+2 c_1 a b \,x^{2}+c_1 \,b^{2} x^{2}-1\right )} \\
\end{align*}
2.25.9.2 Solved using first_order_ode_LIE
10.705 (sec)
Entering first order ode LIE solver
\begin{align*}
\left (x y+x^{2}+a \right ) y^{\prime }&=y^{2}+x y+b \\
\end{align*}
Writing the ode as \begin{align*} y^{\prime }&=\frac {x y +y^{2}+b}{x^{2}+x y +a}\\ 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 (x y +y^{2}+b \right ) \left (b_{3}-a_{2}\right )}{x^{2}+x y +a}-\frac {\left (x y +y^{2}+b \right )^{2} a_{3}}{\left (x^{2}+x y +a \right )^{2}}-\left (\frac {y}{x^{2}+x y +a}-\frac {\left (x y +y^{2}+b \right ) \left (2 x +y \right )}{\left (x^{2}+x y +a \right )^{2}}\right ) \left (x a_{2}+y a_{3}+a_{1}\right )-\left (\frac {x +2 y}{x^{2}+x y +a}-\frac {\left (x y +y^{2}+b \right ) x}{\left (x^{2}+x y +a \right )^{2}}\right ) \left (x b_{2}+y b_{3}+b_{1}\right ) = 0
\end{equation}
Putting the above in normal form gives \[
\frac {a \,x^{2} b_{2}-2 a x y a_{2}-a \,y^{2} a_{2}-a \,y^{2} a_{3}-a \,y^{2} b_{3}+b \,x^{2} a_{2}+b \,x^{2} b_{2}+b \,x^{2} b_{3}+2 b x y b_{3}-b \,y^{2} a_{3}-x^{3} b_{1}+x^{2} y a_{1}-2 x^{2} y b_{1}+2 x \,y^{2} a_{1}-x \,y^{2} b_{1}+y^{3} a_{1}+a^{2} b_{2}-a b a_{2}+a b b_{3}-a x b_{1}-a y a_{1}-2 a y b_{1}-b^{2} a_{3}+2 b x a_{1}+b x b_{1}+b y a_{1}}{\left (x^{2}+x y +a \right )^{2}} = 0
\]
Setting the numerator to zero gives \begin{equation}
\tag{6E} a \,x^{2} b_{2}-2 a x y a_{2}-a \,y^{2} a_{2}-a \,y^{2} a_{3}-a \,y^{2} b_{3}+b \,x^{2} a_{2}+b \,x^{2} b_{2}+b \,x^{2} b_{3}+2 b x y b_{3}-b \,y^{2} a_{3}-x^{3} b_{1}+x^{2} y a_{1}-2 x^{2} y b_{1}+2 x \,y^{2} a_{1}-x \,y^{2} b_{1}+y^{3} a_{1}+a^{2} b_{2}-a b a_{2}+a b b_{3}-a x b_{1}-a y a_{1}-2 a y b_{1}-b^{2} a_{3}+2 b x a_{1}+b x b_{1}+b y a_{1} = 0
\end{equation}
Looking at the
above PDE shows the following are all the terms with \(\{x, y\}\) in them. \[
\{x, y\}
\]
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}\}
\]
The above PDE (6E) now becomes
\begin{equation}
\tag{7E} -2 a a_{2} v_{1} v_{2}-a a_{2} v_{2}^{2}-a a_{3} v_{2}^{2}+a b_{2} v_{1}^{2}-a b_{3} v_{2}^{2}+b a_{2} v_{1}^{2}-b a_{3} v_{2}^{2}+b b_{2} v_{1}^{2}+b b_{3} v_{1}^{2}+2 b b_{3} v_{1} v_{2}+a_{1} v_{1}^{2} v_{2}+2 a_{1} v_{1} v_{2}^{2}+a_{1} v_{2}^{3}-b_{1} v_{1}^{3}-2 b_{1} v_{1}^{2} v_{2}-b_{1} v_{1} v_{2}^{2}+a^{2} b_{2}-a b a_{2}+a b b_{3}-a a_{1} v_{2}-a b_{1} v_{1}-2 a b_{1} v_{2}-b^{2} a_{3}+2 b a_{1} v_{1}+b a_{1} v_{2}+b b_{1} v_{1} = 0
\end{equation}
Collecting the above on the terms \(v_i\) introduced, and these are \[
\{v_{1}, v_{2}\}
\]
Equation (7E) now
becomes \begin{equation}
\tag{8E} -b_{1} v_{1}^{3}+\left (a_{1}-2 b_{1}\right ) v_{1}^{2} v_{2}+\left (a b_{2}+b a_{2}+b b_{2}+b b_{3}\right ) v_{1}^{2}+\left (2 a_{1}-b_{1}\right ) v_{1} v_{2}^{2}+\left (-2 a a_{2}+2 b b_{3}\right ) v_{1} v_{2}+\left (-a b_{1}+2 b a_{1}+b b_{1}\right ) v_{1}+a_{1} v_{2}^{3}+\left (-a a_{2}-a a_{3}-a b_{3}-b a_{3}\right ) v_{2}^{2}+\left (-a a_{1}-2 a b_{1}+b a_{1}\right ) v_{2}+a^{2} b_{2}-a b a_{2}+a b b_{3}-b^{2} a_{3} = 0
\end{equation}
Setting each coefficients in (8E) to zero gives the following equations to solve
\begin{align*} a_{1}&=0\\ -b_{1}&=0\\ a_{1}-2 b_{1}&=0\\ 2 a_{1}-b_{1}&=0\\ -2 a a_{2}+2 b b_{3}&=0\\ -a b_{1}+2 b a_{1}+b b_{1}&=0\\ -a a_{1}-2 a b_{1}+b a_{1}&=0\\ -a a_{2}-a a_{3}-a b_{3}-b a_{3}&=0\\ a b_{2}+b a_{2}+b b_{2}+b b_{3}&=0\\ a^{2} b_{2}-a b a_{2}+a b b_{3}-b^{2} a_{3}&=0 \end{align*}
Solving the above equations for the unknowns gives
\begin{align*} a_{1}&=0\\ a_{2}&=-\frac {b a_{3}}{a}\\ a_{3}&=a_{3}\\ b_{1}&=0\\ b_{2}&=\frac {b a_{3}}{a}\\ b_{3}&=-a_{3} \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 &= \frac {a y -b x}{a} \\
\eta &= -\frac {a y -b x}{a} \\
\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 \\ &= -\frac {a y -b x}{a} - \left (\frac {x y +y^{2}+b}{x^{2}+x y +a}\right ) \left (\frac {a y -b x}{a}\right ) \\ &= -\frac {\left (a y -b x \right ) \left (x^{2}+2 x y +y^{2}+a +b \right )}{\left (x^{2}+x y +a \right ) a}\\ \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}{-\frac {\left (a y -b x \right ) \left (x^{2}+2 x y +y^{2}+a +b \right )}{\left (x^{2}+x y +a \right ) a}}} dy \end{align*}
Which results in
\begin{align*} S&= \frac {a \ln \left (x^{2}+2 x y +y^{2}+a +b \right )}{2 a +2 b}-\frac {a \ln \left (a y -b x \right )}{a +b} \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 {x y +y^{2}+b}{x^{2}+x y +a} \end{align*}
Evaluating all the partial derivatives gives
\begin{align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= \frac {\left (x y +y^{2}+b \right ) a}{\left (a y -b x \right ) \left (x^{2}+2 x y +y^{2}+a +b \right )}\\ S_{y} &= -\frac {\left (x^{2}+x y +a \right ) a}{\left (a y -b x \right ) \left (x^{2}+2 x y +y^{2}+a +b \right )} \end{align*}
Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.
\begin{align*} \frac {dS}{dR} &= 0\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} &= 0 \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 {0\, dR} + c_2 \\ S \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 {a \left (\ln \left (x^{2}+2 x y+y^{2}+a +b \right )-2 \ln \left (a y-b x \right )\right )}{2 a +2 b} = c_2 \end{align*}
Summary of solutions found
\begin{align*}
\frac {a \left (\ln \left (x^{2}+2 x y+y^{2}+a +b \right )-2 \ln \left (a y-b x \right )\right )}{2 a +2 b} &= c_2 \\
\end{align*}
2.25.9.3 ✓ Maple. Time used: 0.005 (sec). Leaf size: 91
ode:=(x^2+y(x)*x+a)*diff(y(x),x) = y(x)^2+y(x)*x+b;
dsolve(ode,y(x), singsol=all);
\begin{align*}
y &= \frac {c_1 a b x +x +\sqrt {\left (a +b \right ) \left (-1+\left (a \,x^{2}+b \,x^{2}+a^{2}\right ) c_1 \right )}}{c_1 \,a^{2}-1} \\
y &= \frac {c_1 a b x +x -\sqrt {\left (a +b \right ) \left (-1+\left (a \,x^{2}+b \,x^{2}+a^{2}\right ) c_1 \right )}}{c_1 \,a^{2}-1} \\
\end{align*}
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
differential order: 1; found: 1 linear symmetries. Trying reduction of order
1st order, trying the canonical coordinates of the invariance group
-> Calling odsolve with the ODE, diff(y(x),x) = (-a*y(x)+b*x)/(a*y(x)-b*x),
y(x)
*** Sublevel 2 ***
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful
<- 1st order, canonical coordinates successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (x y \left (x \right )+x^{2}+a \right ) \left (\frac {d}{d x}y \left (x \right )\right )=y \left (x \right )^{2}+x y \left (x \right )+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 {y \left (x \right )^{2}+x y \left (x \right )+b}{x y \left (x \right )+x^{2}+a} \end {array} \]
2.25.9.4 ✓ Mathematica. Time used: 4.063 (sec). Leaf size: 186
ode=(x*y[x]+x^2+a)*D[y[x],x]==y[x]^2+x*y[x]+b;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to -\frac {-\frac {1}{\frac {a}{a^2+a x^2+b x^2}-\frac {x}{\left (a^2+a x^2+b x^2\right )^{3/2} \sqrt {-\frac {1}{(a+b) \left (a^2+a x^2+b x^2\right )}+c_1}}}+a+x^2}{x}\\ y(x)&\to -\frac {-\frac {1}{\frac {a}{a^2+a x^2+b x^2}+\frac {x}{\left (a^2+a x^2+b x^2\right )^{3/2} \sqrt {-\frac {1}{(a+b) \left (a^2+a x^2+b x^2\right )}+c_1}}}+a+x^2}{x}\\ y(x)&\to \frac {b x}{a} \end{align*}
2.25.9.5 ✓ Sympy. Time used: 53.404 (sec). Leaf size: 37
from sympy import *
x = symbols("x")
a = symbols("a")
b = symbols("b")
y = Function("y")
ode = Eq(-b - x*y(x) + (a + x**2 + x*y(x))*Derivative(y(x), x) - y(x)**2,0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
\[
C_{1} + \frac {a \log {\left (- a y{\left (x \right )} + b x \right )}}{a + b} - \frac {a \log {\left (a + b + \left (x + y{\left (x \right )}\right )^{2} \right )}}{2 \left (a + b\right )} = 0
\]