2.29.17 Problem 77
Internal
problem
ID
[13738]
Book
:
Handbook
of
exact
solutions
for
ordinary
differential
equations.
By
Polyanin
and
Zaitsev.
Second
edition
Section
:
Chapter
2,
Second-Order
Differential
Equations.
section
2.1.2-3
Problem
number
:
77
Date
solved
:
Thursday, January 01, 2026 at 02:27:27 AM
CAS
classification
:
[[_2nd_order, _missing_y]]
2.29.17.1 second order ode missing y
1.092 (sec)
\begin{align*}
x y^{\prime \prime }+\left (a x +b \right ) y^{\prime }+c x \left (-c \,x^{2}+a x +b +1\right )&=0 \\
\end{align*}
Entering second order ode missing \(y\) solverThis is second order ode with missing dependent
variable \(y\). Let \begin{align*} u(x) &= y^{\prime } \end{align*}
Then
\begin{align*} u'(x) &= y^{\prime \prime } \end{align*}
Hence the ode becomes
\begin{align*} x u^{\prime }\left (x \right )+\left (a x +b \right ) u \left (x \right )+c x \left (-c \,x^{2}+a x +b +1\right ) = 0 \end{align*}
Which is now solved for \(u(x)\) as first order ode.
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 x -b}{x}\\ p(x) &=-c \left (-c \,x^{2}+a x +b +1\right ) \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {-a x -b}{x}d x}\\ &= x^{b} {\mathrm e}^{a x} \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu u\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu u\right ) &= \left (\mu \right ) \left (-c \left (-c \,x^{2}+a x +b +1\right )\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (u \,x^{b} {\mathrm e}^{a x}\right ) &= \left (x^{b} {\mathrm e}^{a x}\right ) \left (-c \left (-c \,x^{2}+a x +b +1\right )\right ) \\
\mathrm {d} \left (u \,x^{b} {\mathrm e}^{a x}\right ) &= \left (-c \left (-c \,x^{2}+a x +b +1\right ) x^{b} {\mathrm e}^{a x}\right )\, \mathrm {d} x \\
\end{align*}
Integrating gives \begin{align*} u \,x^{b} {\mathrm e}^{a x}&= \int {-c \left (-c \,x^{2}+a x +b +1\right ) x^{b} {\mathrm e}^{a x} \,dx} \\ &=-\frac {c \left (-c \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) \left (-a x \right )^{-b}+\left (\left (-b^{2}+\left (a x -3\right ) b -a^{2} x^{2}+2 a x -2\right ) c +a^{3} x \right ) {\mathrm e}^{a x}\right ) x^{b}}{a^{3}} + c_1 \end{align*}
Dividing throughout by the integrating factor \(x^{b} {\mathrm e}^{a x}\) gives the final solution
\[ u \left (x \right ) = x^{-b} {\mathrm e}^{-a x} \left (-\frac {c \left (-c \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) \left (-a x \right )^{-b}+\left (\left (-b^{2}+\left (a x -3\right ) b -a^{2} x^{2}+2 a x -2\right ) c +a^{3} x \right ) {\mathrm e}^{a x}\right ) x^{b}}{a^{3}}+c_1 \right ) \]
Simplifying the above gives
\begin{align*}
u \left (x \right ) &= \frac {\left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) {\mathrm e}^{-a x} c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}-c \left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +a^{3} x \right )}{a^{3}} \\
\end{align*}
In summary, these are the solution found for \(y\) \begin{align*}
u \left (x \right ) &= \frac {\left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) {\mathrm e}^{-a x} c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}-c \left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +a^{3} x \right )}{a^{3}} \\
\end{align*}
For solution \(u \left (x \right ) = \frac {\left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) {\mathrm e}^{-a x} c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}-c \left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +a^{3} x \right )}{a^{3}}\), since \(u=y^{\prime }\) then we now have a new first
order ode to solve which is \begin{align*} y^{\prime } = \frac {\left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (3+b \right )\right ) {\mathrm e}^{-a x} c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}-c \left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +a^{3} x \right )}{a^{3}} \end{align*}
Entering first order ode quadrature solverSince the ode has the form \(y^{\prime }=f(x)\), then we only need to
integrate \(f(x)\).
\begin{align*} \int {dy} &= \int {\frac {{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{3} c^{2}+3 \,{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{2} c^{2}+2 \left (-a x \right )^{-b} b \,c^{2} {\mathrm e}^{-a x} \Gamma \left (b , -a x \right )+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+a^{2} c^{2} x^{2}-c^{2} \left (-a x \right )^{-b} {\mathrm e}^{-a x} \Gamma \left (3+b \right )-c x \,a^{3}-a b x \,c^{2}-2 a \,c^{2} x +b^{2} c^{2}+3 b \,c^{2}+2 c^{2}}{a^{3}}\, dx}\\ y &= \int \frac {{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{3} c^{2}+3 \,{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{2} c^{2}+2 \left (-a x \right )^{-b} b \,c^{2} {\mathrm e}^{-a x} \Gamma \left (b , -a x \right )+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+a^{2} c^{2} x^{2}-c^{2} \left (-a x \right )^{-b} {\mathrm e}^{-a x} \Gamma \left (3+b \right )-c x \,a^{3}-a b x \,c^{2}-2 a \,c^{2} x +b^{2} c^{2}+3 b \,c^{2}+2 c^{2}}{a^{3}}d x + c_2 \end{align*}
\begin{align*} y&= \int \frac {{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{3} c^{2}+3 \,{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{2} c^{2}+2 \left (-a x \right )^{-b} b \,c^{2} {\mathrm e}^{-a x} \Gamma \left (b , -a x \right )+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+a^{2} c^{2} x^{2}-c^{2} \left (-a x \right )^{-b} {\mathrm e}^{-a x} \Gamma \left (3+b \right )-c x \,a^{3}-a b x \,c^{2}-2 a \,c^{2} x +b^{2} c^{2}+3 b \,c^{2}+2 c^{2}}{a^{3}}d x +c_2 \end{align*}
In summary, these are the solution found for \((y)\)
\begin{align*}
y &= \int \frac {{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{3} c^{2}+3 \,{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{2} c^{2}+2 \left (-a x \right )^{-b} b \,c^{2} {\mathrm e}^{-a x} \Gamma \left (b , -a x \right )+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+a^{2} c^{2} x^{2}-c^{2} \left (-a x \right )^{-b} {\mathrm e}^{-a x} \Gamma \left (3+b \right )-c x \,a^{3}-a b x \,c^{2}-2 a \,c^{2} x +b^{2} c^{2}+3 b \,c^{2}+2 c^{2}}{a^{3}}d x +c_2 \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= \int \frac {{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{3} c^{2}+3 \,{\mathrm e}^{-a x} \left (-a x \right )^{-b} \Gamma \left (b , -a x \right ) b^{2} c^{2}+2 \left (-a x \right )^{-b} b \,c^{2} {\mathrm e}^{-a x} \Gamma \left (b , -a x \right )+{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+a^{2} c^{2} x^{2}-c^{2} \left (-a x \right )^{-b} {\mathrm e}^{-a x} \Gamma \left (3+b \right )-c x \,a^{3}-a b x \,c^{2}-2 a \,c^{2} x +b^{2} c^{2}+3 b \,c^{2}+2 c^{2}}{a^{3}}d x +c_2 \\
\end{align*}
2.29.17.2 second order kovacic
1.920 (sec)
\begin{align*}
x y^{\prime \prime }+\left (a x +b \right ) y^{\prime }+c x \left (-c \,x^{2}+a x +b +1\right )&=0 \\
\end{align*}
Entering kovacic solverWriting the ode as \begin{align*} x y^{\prime \prime }+\left (a x +b \right ) y^{\prime } &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end{align*}
Comparing (1) and (2) shows that
\begin{align*} A &= x \\ B &= a x +b\tag {3} \\ C &= 0 \end{align*}
Applying the Liouville transformation on the dependent variable gives
\begin{align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end{align*}
Then (2) becomes
\begin{align*} z''(x) = r z(x)\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^{2} x^{2}+2 a b x +b^{2}-2 b}{4 x^{2}}\tag {6} \end{align*}
Comparing the above to (5) shows that
\begin{align*} s &= a^{2} x^{2}+2 a b x +b^{2}-2 b\\ t &= 4 x^{2} \end{align*}
Therefore eq. (4) becomes
\begin{align*} z''(x) &= \left ( \frac {a^{2} x^{2}+2 a b x +b^{2}-2 b}{4 x^{2}}\right ) z(x)\tag {7} \end{align*}
Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation
\begin{align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \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.42: 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 - 2 \\ &= 0 \end{align*}
The poles of \(r\) in eq. (7) and the order of each pole are determined by solving for the roots of \(t=4 x^{2}\).
There is a pole at \(x=0\) of order \(2\). Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is \(0\)
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. Therefore
\begin{align*} L &= [1, 2] \end{align*}
Attempting to find a solution using case \(n=1\).
Looking at poles of order 2. The partial fractions decomposition of \(r\) is
\[
r = \frac {a^{2}}{4}+\frac {b a}{2 x}+\frac {b \left (b -2\right )}{4 x^{2}}
\]
For the pole at \(x=0\) let \(b\) be the
coefficient of \(\frac {1}{ x^{2}}\) in the partial fractions decomposition of \(r\) given above. Therefore \(b=\frac {b \left (b -2\right )}{4}\). Hence
\begin{alignat*}{2} [\sqrt r]_c &= 0 \\ \alpha _c^{+} &= \frac {1}{2} + \sqrt {1+4 b} &&= \frac {b}{2}\\ \alpha _c^{-} &= \frac {1}{2} - \sqrt {1+4 b} &&= -\frac {b}{2}+1 \end{alignat*}
Since the order of \(r\) at \(\infty \) is \(O_r(\infty ) = 0\) then
\begin{alignat*}{3} v &= \frac {-O_r(\infty )}{2} &&= \frac {0}{2} &&= 0 \end{alignat*}
\([\sqrt r]_\infty \) is the sum of terms involving \(x^i\) for \(0\leq i \leq v\) in the Laurent series for \(\sqrt r\) at \(\infty \). Therefore
\begin{align*} [\sqrt r]_\infty &= \sum _{i=0}^{v} a_i x^i \\ &= \sum _{i=0}^{0} a_i x^i \tag {8} \end{align*}
Let \(a\) be the coefficient of \(x^v=x^0\) in the above sum. The Laurent series of \(\sqrt r\) at \(\infty \) is
\begin{equation}
\tag{9} \sqrt r \approx \frac {a}{2}+\frac {b}{2 x}-\frac {b}{2 a \,x^{2}}+\frac {b^{2}}{2 a^{2} x^{3}}-\frac {b^{3}}{2 a^{3} x^{4}}-\frac {b^{2}}{4 a^{3} x^{4}}+\frac {b^{4}}{2 a^{4} x^{5}}+\frac {3 b^{3}}{4 a^{4} x^{5}}-\frac {b^{5}}{2 a^{5} x^{6}}-\frac {3 b^{4}}{2 a^{5} x^{6}}+\frac {b^{6}}{2 a^{6} x^{7}}-\frac {b^{3}}{4 a^{5} x^{6}}+\frac {5 b^{5}}{2 a^{6} x^{7}}+\frac {5 b^{4}}{4 a^{6} x^{7}} + \dots
\end{equation}
Comparing Eq. (9) with
Eq. (8) shows that \[ a = \frac {a}{2} \]
From Eq. (9) the sum up to \(v=0\) gives \begin{align*} [\sqrt r]_\infty &= \sum _{i=0}^{0} a_i x^i \\ &= \frac {a}{2} \tag {10} \end{align*}
Now we need to find \(b\), where \(b\) be the coefficient of \(x^{v-1} = x^{-1}=\frac {1}{x}\) in \(r\) minus the coefficient of same term but in \(\left ( [\sqrt r]_\infty \right )^2 \)
where \([\sqrt r]_\infty \) was found above in Eq (10). Hence
\[ \left ( [\sqrt r]_\infty \right )^2 = \frac {a^{2}}{4} \]
This shows that the coefficient of \(\frac {1}{x}\) in the above is \(0\).
Now we need to find the coefficient of \(\frac {1}{x}\) in \(r\). How this is done depends on if \(v=0\) or not. Since \(v=0\) then
starting from \(r=\frac {s}{t}\) and doing long division in the form \[ r = Q + \frac {R}{t} \]
Where \(Q\) is the quotient and \(R\) is the
remainder. Then the coefficient of \(\frac {1}{x}\) in \(r\) will be the coefficient in \(R\) of the term in \(x\) of
degree of \(t\) minus one, divided by the leading coefficient in \(t\). Doing long division gives
\begin{align*} r &= \frac {s}{t} \\ &= \frac {a^{2} x^{2}+2 a b x +b^{2}-2 b}{4 x^{2}} \\ &= Q + \frac {R}{4 x^{2}}\\ &= \left (\frac {a^{2}}{4}\right ) + \left ( \frac {2 a b x +b^{2}-2 b}{4 x^{2}}\right ) \\ &= \frac {a^{2}}{4}+\frac {2 a b x +b^{2}-2 b}{4 x^{2}} \end{align*}
Since the degree of \(t\) is \(2\), then we see that the coefficient of the term \(x\) in the remainder \(R\) is \(2 a b\). Dividing
this by leading coefficient in \(t\) which is \(4\) gives \(\frac {a b}{2}\). Now \(b\) can be found.
\begin{align*} b &= \left (\frac {a b}{2}\right )-\left (0\right )\\ &= \frac {a b}{2} \end{align*}
Hence
\begin{alignat*}{3} [\sqrt r]_\infty &= \frac {a}{2}\\ \alpha _{\infty }^{+} &= \frac {1}{2} \left ( \frac {b}{a} - v \right ) &&= \frac {1}{2} \left ( \frac {\frac {a b}{2}}{\frac {a}{2}} - 0 \right ) &&= \frac {b}{2}\\ \alpha _{\infty }^{-} &= \frac {1}{2} \left ( -\frac {b}{a} - v \right ) &&= \frac {1}{2} \left ( -\frac {\frac {a b}{2}}{\frac {a}{2}} - 0 \right ) &&= -\frac {b}{2} \end{alignat*}
The following table summarizes the findings so far for poles and for the order of \(r\) at \(\infty \) where \(r\) is
\[ r=\frac {a^{2} x^{2}+2 a b x +b^{2}-2 b}{4 x^{2}} \]
| | | | |
| pole \(c\) location |
pole order |
\([\sqrt r]_c\) |
\(\alpha _c^{+}\) |
\(\alpha _c^{-}\) |
| | | | |
| \(0\) | \(2\) | \(0\) | \(\frac {b}{2}\) | \(-\frac {b}{2}+1\) |
| | | | |
| | | |
| Order of \(r\) at \(\infty \) |
\([\sqrt r]_\infty \) |
\(\alpha _\infty ^{+}\) |
\(\alpha _\infty ^{-}\) |
| | | |
| \(0\) |
\(\frac {a}{2}\) | \(\frac {b}{2}\) | \(-\frac {b}{2}\) |
| | | |
Now that the all \([\sqrt r]_c\) and its associated \(\alpha _c^{\pm }\) have been determined for all the poles in the set \(\Gamma \) and \([\sqrt r]_\infty \) and
its associated \(\alpha _\infty ^{\pm }\) have also been found, the next step is to determine possible non negative integer \(d\)
from these using
\begin{align*} d &= \alpha _\infty ^{s(\infty )} - \sum _{c \in \Gamma } \alpha _c^{s(c)} \end{align*}
Where \(s(c)\) is either \(+\) or \(-\) and \(s(\infty )\) is the sign of \(\alpha _\infty ^{\pm }\). This is done by trial over all set of families \(s=(s(c))_{c \in \Gamma \cup {\infty }}\) until such \(d\) is
found to work in finding candidate \(\omega \). Trying \(\alpha _\infty ^{+} = \frac {b}{2}\) then
\begin{align*} d &= \alpha _\infty ^{+} - \left ( \alpha _{c_1}^{+} \right ) \\ &= \frac {b}{2} - \left ( \frac {b}{2} \right ) \\ &= 0 \end{align*}
Since \(d\) an integer and \(d \geq 0\) then it can be used to find \(\omega \) using
\begin{align*} \omega &= \sum _{c \in \Gamma } \left ( s(c) [\sqrt r]_c + \frac {\alpha _c^{s(c)}}{x-c} \right ) + s(\infty ) [\sqrt r]_\infty \end{align*}
Substituting the above values in the above results in
\begin{align*} \omega &= \left ( (+) [\sqrt r]_{c_1} + \frac { \alpha _{c_1}^{+} }{x- c_1}\right ) + (+) [\sqrt r]_\infty \\ &= \frac {b}{2 x} + \left ( \frac {a}{2} \right ) \\ &= \frac {b}{2 x}+\frac {a}{2}\\ &= \frac {a x +b}{2 x} \end{align*}
Now that \(\omega \) is determined, the next step is find a corresponding minimal polynomial \(p(x)\) of degree \(d=0\) to
solve the ode. The polynomial \(p(x)\) needs to satisfy the equation
\begin{align*} p'' + 2 \omega p' + \left ( \omega ' +\omega ^2 -r\right ) p = 0 \tag {1A} \end{align*}
Let
\begin{align*} p(x) &= 1\tag {2A} \end{align*}
Substituting the above in eq. (1A) gives
\begin{align*} \left (0\right ) + 2 \left (\frac {b}{2 x}+\frac {a}{2}\right ) \left (0\right ) + \left ( \left (-\frac {b}{2 x^{2}}\right ) + \left (\frac {b}{2 x}+\frac {a}{2}\right )^2 - \left (\frac {a^{2} x^{2}+2 a b x +b^{2}-2 b}{4 x^{2}}\right ) \right ) &= 0\\ 0 = 0 \end{align*}
The equation is satisfied since both sides are zero. Therefore the first solution to the ode \(z'' = r z\) is
\begin{align*} z_1(x) &= p e^{ \int \omega \,dx} \\ &= {\mathrm e}^{\int \left (\frac {b}{2 x}+\frac {a}{2}\right )d x}\\ &= x^{\frac {b}{2}} {\mathrm e}^{\frac {a x}{2}} \end{align*}
The first solution to the original ode in \(y\) is found from
\begin{align*}
y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\
&= z_1 e^{ -\int \frac {1}{2} \frac {a x +b}{x} \,dx} \\
&= z_1 e^{-\frac {a x}{2}-\frac {b \ln \left (x \right )}{2}} \\
&= z_1 \left (x^{-\frac {b}{2}} {\mathrm e}^{-\frac {a x}{2}}\right ) \\
\end{align*}
Which simplifies to \[
y_1 = 1
\]
The second solution \(y_2\)
to the original ode is found using reduction of order \[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \]
Substituting gives \begin{align*}
y_2 &= y_1 \int \frac { e^{\int -\frac {a x +b}{x} \,dx}}{\left (y_1\right )^2} \,dx \\
&= y_1 \int \frac { e^{-a x -b \ln \left (x \right )}}{\left (y_1\right )^2} \,dx \\
&= y_1 \left (\int {\mathrm e}^{-a x -b \ln \left (x \right )}d x\right ) \\
\end{align*}
Therefore the solution
is
\begin{align*}
y &= c_1 y_1 + c_2 y_2 \\
&= c_1 \left (1\right ) + c_2 \left (1\left (\int {\mathrm e}^{-a x -b \ln \left (x \right )}d x\right )\right ) \\
\end{align*}
This is second order nonhomogeneous ODE. Let the solution be \[
y = y_h + y_p
\]
Where \(y_h\) is the solution to the
homogeneous ODE \[
A y''(x) + B y'(x) + C y(x) = 0
\]
And \(y_p\) is a particular solution to the nonhomogeneous ODE \[
A y''(x) + B y'(x) + C y(x) = f(x)
\]
\(y_h\) is the solution to
\[
x y^{\prime \prime }+\left (a x +b \right ) y^{\prime } = 0
\]
The homogeneous solution is found using the Kovacic algorithm which results in \[
y_h = c_1 +c_2 \int x^{-b} {\mathrm e}^{-a x}d x
\]
The particular
solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of
variation of parameters. The method of variation of parameters will be used as it is more general
and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation}
\tag{1} y_p(x) = u_1 y_1 + u_2 y_2
\end{equation}
Where \(u_1,u_2\) to be
determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the
homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*}
y_1 &= 1 \\
y_2 &= \int x^{-b} {\mathrm e}^{-a x}d x \\
\end{align*}
In the Variation of
parameters \(u_1,u_2\) are found using \begin{align*}
\tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\
\tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\
\end{align*}
Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in
the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} 1 & \int x^{-b} {\mathrm e}^{-a x}d x \\ \frac {d}{dx}\left (1\right ) & \frac {d}{dx}\left (\int x^{-b} {\mathrm e}^{-a x}d x\right ) \end {vmatrix} \]
Which gives \[ W = \begin {vmatrix} 1 & \int x^{-b} {\mathrm e}^{-a x}d x \\ 0 & x^{-b} {\mathrm e}^{-a x} \end {vmatrix} \]
Therefore \[
W = \left (1\right )\left (x^{-b} {\mathrm e}^{-a x}\right ) - \left (\int x^{-b} {\mathrm e}^{-a x}d x\right )\left (0\right )
\]
Which
simplifies to \[
W = x^{-b} {\mathrm e}^{-a x}
\]
Which simplifies to \[
W = x^{-b} {\mathrm e}^{-a x}
\]
Therefore Eq. (2) becomes \[
u_1 = -\int \frac {-\int x^{-b} {\mathrm e}^{-a x}d x c x \left (-c \,x^{2}+a x +b +1\right )}{x \,x^{-b} {\mathrm e}^{-a x}}\,dx
\]
Which simplifies to \[
u_1 = - \int -\int x^{-b} {\mathrm e}^{-a x}d x c \left (-c \,x^{2}+a x +b +1\right ) x^{b} {\mathrm e}^{a x}d x
\]
Hence \[
u_1 = -\int _{0}^{x}-\int \alpha ^{-b} {\mathrm e}^{-a \alpha }d \alpha c \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha
\]
And Eq. (3) becomes \[
u_2 = \int \frac {-c x \left (-c \,x^{2}+a x +b +1\right )}{x \,x^{-b} {\mathrm e}^{-a x}}\,dx
\]
Which simplifies to \[
u_2 = \int -c \left (-c \,x^{2}+a x +b +1\right ) x^{b} {\mathrm e}^{a x}d x
\]
Hence \[
u_2 = \int _{0}^{x}-c \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha
\]
Therefore the particular
solution, from equation (1) is \[
y_p(x) = -\int _{0}^{x}-\int \alpha ^{-b} {\mathrm e}^{-a \alpha }d \alpha c \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha +\int x^{-b} {\mathrm e}^{-a x}d x \int _{0}^{x}-c \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha
\]
Which simplifies to \[
y_p(x) = c \left (-\int _{0}^{x}\left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \int x^{-b} {\mathrm e}^{-a x}d x +\int _{0}^{x}\int \alpha ^{-b} {\mathrm e}^{-a \alpha }d \alpha \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \right )
\]
Therefore the general solution is
\begin{align*}
y &= y_h + y_p \\
&= \left (c_1 +c_2 \int x^{-b} {\mathrm e}^{-a x}d x\right ) + \left (c \left (-\int _{0}^{x}\left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \int x^{-b} {\mathrm e}^{-a x}d x +\int _{0}^{x}\int \alpha ^{-b} {\mathrm e}^{-a \alpha }d \alpha \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \right )\right ) \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= c \left (-\int _{0}^{x}\left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \int x^{-b} {\mathrm e}^{-a x}d x +\int _{0}^{x}\int \alpha ^{-b} {\mathrm e}^{-a \alpha }d \alpha \left (-\alpha ^{2} c +a \alpha +b +1\right ) \alpha ^{b} {\mathrm e}^{a \alpha }d \alpha \right )+c_1 +c_2 \int x^{-b} {\mathrm e}^{-a x}d x \\
\end{align*}
2.29.17.3 ✓ Maple. Time used: 0.001 (sec). Leaf size: 115
ode:=x*diff(diff(y(x),x),x)+(a*x+b)*diff(y(x),x)+c*x*(-c*x^2+a*x+b+1) = 0;
dsolve(ode,y(x), singsol=all);
\[
y = \frac {c_2 \,a^{3}-\int \left (-{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}-{\mathrm e}^{-a x} x^{-b} c_1 \,a^{3}+c \left (\left (-b^{2}+\left (a x -3\right ) b -x^{2} a^{2}+2 a x -2\right ) c +x \,a^{3}\right )\right )d x}{a^{3}}
\]
Maple trace
Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
-> Calling odsolve with the ODE, diff(_b(_a),_a) = -(-_a^3*c^2+_a^2*a*c+_b(_a)*
_a*a+_a*b*c+_b(_a)*b+c*_a)/_a, _b(_a)
*** Sublevel 2 ***
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful
<- high order exact linear fully integrable successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \left (\frac {d^{2}}{d x^{2}}y \left (x \right )\right )+\left (a x +b \right ) \left (\frac {d}{d x}y \left (x \right )\right )+c x \left (-c \,x^{2}+a x +b +1\right )=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right ) \\ \bullet & {} & \textrm {Make substitution}\hspace {3pt} u =\frac {d}{d x}y \left (x \right )\hspace {3pt}\textrm {to reduce order of ODE}\hspace {3pt} \\ {} & {} & x \left (\frac {d}{d x}u \left (x \right )\right )+\left (a x +b \right ) u \left (x \right )+c x \left (-c \,x^{2}+a x +b +1\right )=0 \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}u \left (x \right )=-\frac {\left (a x +b \right ) u \left (x \right )+c x \left (-c \,x^{2}+a x +b +1\right )}{x} \\ \bullet & {} & \textrm {Collect w.r.t.}\hspace {3pt} u \left (x \right )\hspace {3pt}\textrm {and simplify}\hspace {3pt} \\ {} & {} & \frac {d}{d x}u \left (x \right )=-\frac {\left (a x +b \right ) u \left (x \right )}{x}-c \left (-c \,x^{2}+a x +b +1\right ) \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} u \left (x \right )\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & \frac {d}{d x}u \left (x \right )+\frac {\left (a x +b \right ) u \left (x \right )}{x}=-c \left (-c \,x^{2}+a x +b +1\right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (\frac {d}{d x}u \left (x \right )+\frac {\left (a x +b \right ) u \left (x \right )}{x}\right )=-\mu \left (x \right ) c \left (-c \,x^{2}+a x +b +1\right ) \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (u \left (x \right ) \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (\frac {d}{d x}u \left (x \right )+\frac {\left (a x +b \right ) u \left (x \right )}{x}\right )=\left (\frac {d}{d x}u \left (x \right )\right ) \mu \left (x \right )+u \left (x \right ) \left (\frac {d}{d x}\mu \left (x \right )\right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \frac {d}{d x}\mu \left (x \right ) \\ {} & {} & \frac {d}{d x}\mu \left (x \right )=\frac {\mu \left (x \right ) \left (a x +b \right )}{x} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{a x} x^{b} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (u \left (x \right ) \mu \left (x \right )\right )\right )d x =\int -\mu \left (x \right ) c \left (-c \,x^{2}+a x +b +1\right )d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & u \left (x \right ) \mu \left (x \right )=\int -\mu \left (x \right ) c \left (-c \,x^{2}+a x +b +1\right )d x +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=\frac {\int -\mu \left (x \right ) c \left (-c \,x^{2}+a x +b +1\right )d x +\mathit {C1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{a x} x^{b} \\ {} & {} & u \left (x \right )=\frac {\int -{\mathrm e}^{a x} x^{b} c \left (-c \,x^{2}+a x +b +1\right )d x +\mathit {C1}}{{\mathrm e}^{a x} x^{b}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & u \left (x \right )=\frac {-\frac {\left (-a \right )^{-b} c^{2} \left (x^{b} \left (-a \right )^{b} b \left (b^{2}+3 b +2\right ) \Gamma \left (b \right ) \left (-a x \right )^{-b}-x^{b} \left (-a \right )^{b} \left (a^{2} x^{2}-a b x -2 a x +b^{2}+3 b +2\right ) {\mathrm e}^{a x}-x^{b} \left (-a \right )^{b} b \left (b^{2}+3 b +2\right ) \left (-a x \right )^{-b} \Gamma \left (b , -a x \right )\right )}{a^{3}}-\frac {\left (-a \right )^{-b} c \left (x^{b} \left (-a \right )^{b} \left (b +1\right ) b \Gamma \left (b \right ) \left (-a x \right )^{-b}+x^{b} \left (-a \right )^{b} \left (a x -b -1\right ) {\mathrm e}^{a x}-x^{b} \left (-a \right )^{b} \left (b +1\right ) b \left (-a x \right )^{-b} \Gamma \left (b , -a x \right )\right )}{a}+\frac {\left (-a \right )^{-b} c b \left (x^{b} \left (-a \right )^{b} b \Gamma \left (b \right ) \left (-a x \right )^{-b}-x^{b} \left (-a \right )^{b} {\mathrm e}^{a x}-x^{b} \left (-a \right )^{b} b \left (-a x \right )^{-b} \Gamma \left (b , -a x \right )\right )}{a}+\frac {\left (-a \right )^{-b} c \left (x^{b} \left (-a \right )^{b} b \Gamma \left (b \right ) \left (-a x \right )^{-b}-x^{b} \left (-a \right )^{b} {\mathrm e}^{a x}-x^{b} \left (-a \right )^{b} b \left (-a x \right )^{-b} \Gamma \left (b , -a x \right )\right )}{a}+\mathit {C1}}{{\mathrm e}^{a x} x^{b}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & u \left (x \right )=\frac {{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} \mathit {C1} \,a^{3}-\left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +x \,a^{3}\right ) c}{a^{3}} \\ \bullet & {} & \textrm {Solve 1st ODE for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=\frac {{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} \mathit {C1} \,a^{3}-\left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +x \,a^{3}\right ) c}{a^{3}} \\ \bullet & {} & \textrm {Make substitution}\hspace {3pt} u =\frac {d}{d x}y \left (x \right ) \\ {} & {} & \frac {d}{d x}y \left (x \right )=\frac {{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} \mathit {C1} \,a^{3}-\left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +x \,a^{3}\right ) c}{a^{3}} \\ \bullet & {} & \textrm {Integrate both sides to solve for}\hspace {3pt} y \left (x \right ) \\ {} & {} & \int \left (\frac {d}{d x}y \left (x \right )\right )d x =\int \frac {{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} \mathit {C1} \,a^{3}-\left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +x \,a^{3}\right ) c}{a^{3}}d x +\mathit {C2} \\ \bullet & {} & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y \left (x \right )=\int \frac {{\mathrm e}^{-a x} \left (\left (b^{3}+3 b^{2}+2 b \right ) \Gamma \left (b , -a x \right )-\Gamma \left (b +3\right )\right ) c^{2} \left (-a x \right )^{-b}+{\mathrm e}^{-a x} x^{-b} \mathit {C1} \,a^{3}-\left (\left (-a^{2} x^{2}+x \left (b +2\right ) a -b^{2}-3 b -2\right ) c +x \,a^{3}\right ) c}{a^{3}}d x +\mathit {C2} \end {array} \]
2.29.17.4 ✓ Mathematica. Time used: 61.169 (sec). Leaf size: 92
ode=x*D[y[x],{x,2}]+(a*x+b)*D[y[x],x]+c*x*(-c*x^2+a*x+b+1)==0;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \int _1^xe^{-a K[1]} K[1]^{-b} \left (\frac {c \left (-\left ((b+1) \Gamma (b+1,-a K[1]) a^2\right )+\Gamma (b+2,-a K[1]) a^2+c \Gamma (b+3,-a K[1])\right ) K[1]^b (-a K[1])^{-b}}{a^3}+c_1\right )dK[1]+c_2 \end{align*}
2.29.17.5 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
b = symbols("b")
c = symbols("c")
y = Function("y")
ode = Eq(c*x*(a*x + b - c*x**2 + 1) + x*Derivative(y(x), (x, 2)) + (a*x + b)*Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
Timed Out