2.28.47 Problem 57

2.28.47.1 Solved as second order ode adjoint method
2.28.47.2 Maple
2.28.47.3 Mathematica
2.28.47.4 Sympy

Internal problem ID [13718]
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-2
Problem number : 57
Date solved : Sunday, January 18, 2026 at 09:09:49 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

2.28.47.1 Solved as second order ode adjoint method

4.517 (sec)

\begin{align*} y^{\prime \prime }+\left (x^{n} a +b \,x^{m}\right ) y^{\prime }+\left (a \left (n +1\right ) x^{n -1}+b \left (1+m \right ) x^{m -1}\right ) y&=0 \\ \end{align*}
Entering second order ode lagrange adjoint equation method solverIn normal form the ode
\begin{align*} y^{\prime \prime }+\left (x^{n} a +b \,x^{m}\right ) y^{\prime }+\left (a \left (n +1\right ) x^{n -1}+b \left (1+m \right ) x^{m -1}\right ) y = 0 \tag {1} \end{align*}

Becomes

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

Where

\begin{align*} p \left (x \right )&=x^{n} a +b \,x^{m}\\ q \left (x \right )&=\frac {b \left (1+m \right ) x^{m}+a \,x^{n} \left (n +1\right )}{x}\\ 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} a +b \,x^{m}\right ) \xi \left (x \right )\right )' + \left (\frac {\left (b \left (1+m \right ) x^{m}+a \,x^{n} \left (n +1\right )\right ) \xi \left (x \right )}{x}\right ) &= 0\\ \frac {\xi ^{\prime \prime }\left (x \right ) x -\left (x \xi ^{\prime }\left (x \right )-\xi \left (x \right )\right ) \left (x^{n} a +b \,x^{m}\right )}{x}&= 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*} \frac {\xi ^{\prime \prime } x -\left (x \xi ^{\prime }-\xi \right ) \left (x^{n} a +b \,x^{m}\right )}{x} = 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} a -b \,x^{m}\\ q \left (x \right )&=\frac {x^{n} a +b \,x^{m}}{x} \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} a -b \,x^{m}\right )}{x}+\frac {x^{n} a +b \,x^{m}}{x}&=0 \tag {5} \end{align*}

Solving (5) for \(n\) gives

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

Substituting this value in (3) gives

\begin{align*} v^{\prime \prime }\left (x \right )+\left (\frac {2}{x}-x^{n} a -b \,x^{m}\right ) v^{\prime }\left (x \right )&=0 \\ v^{\prime \prime }\left (x \right )+\left (\frac {2}{x}-x^{n} a -b \,x^{m}\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 {2}{x}-x^{n} a -b \,x^{m}\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 {x^{n +1} a +b \,x^{1+m}-2}{x}\\ p(x) &=0 \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {x^{n +1} a +b \,x^{1+m}-2}{x}d x}\\ &= x^{2} {\mathrm e}^{-\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} \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 \,x^{2} {\mathrm e}^{-\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}}\right ) &= 0 \end{align*}

Integrating gives

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

Dividing throughout by the integrating factor \(x^{2} {\mathrm e}^{-\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}}\) gives the final solution

\[ u \left (x \right ) = \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}} \]
Simplifying the above gives
\begin{align*} u \left (x \right ) &= \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}} \\ \end{align*}
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 \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \end{align*}

Hence

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

The original ode now reduces to first order ode

\begin{align*} \xi \left (x \right ) y^{\prime }-y \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) y&=\int \xi \left (x \right ) r \left (x \right )d x\\ y^{\prime }+y \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*} y^{\prime }+y \left (x^{n} a +b \,x^{m}-\frac {\frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x}+\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2}{\left (\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \right ) x}\right )&=0 \end{align*}

Which is now a first order ode. This is now solved for \(y\). Entering first order ode linear solverIn canonical form a linear first order is

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

Comparing the above to the given ode shows that

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

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {-c_1 \left (a \,x^{n +2}+b \,x^{m +2}-x \right ) \int \frac {{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{x^{2} \left (c_1 \int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_2 \right )}d x}\\ &= {\mathrm e}^{\int -\frac {-c_1 \left (a \,x^{n +2}+b \,x^{m +2}-x \right ) \int \frac {{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{x^{2} \left (c_1 \int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_2 \right )}d x} \end{align*}

The ode becomes

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

Integrating gives

\begin{align*} y \,{\mathrm e}^{\int -\frac {-c_1 \left (a \,x^{n +2}+b \,x^{m +2}-x \right ) \int \frac {{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{x^{2} \left (c_1 \int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x +c_2 \right )}d x}&= \int {0 \,dx} + c_3 \\ &=c_3 \end{align*}

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

\[ y = {\mathrm e}^{\int \frac {\int -\frac {c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x \left (a \,x^{n +2}+b \,x^{m +2}-x \right )+c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{\left (\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \right ) x^{2}}d x} c_3 \]
Hence, the solution found using Lagrange adjoint equation method is
\begin{align*} y &= {\mathrm e}^{\int \frac {\int -\frac {c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x \left (a \,x^{n +2}+b \,x^{m +2}-x \right )+c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{\left (\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \right ) x^{2}}d x} c_3 \\ \end{align*}
The constants can be merged to give
\[ y = {\mathrm e}^{\int \frac {\int -\frac {c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x \left (a \,x^{n +2}+b \,x^{m +2}-x \right )+c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{\left (\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \right ) x^{2}}d x} \]

Summary of solutions found

\begin{align*} y &= {\mathrm e}^{\int \frac {\int -\frac {c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}}{x^{2}}d x \left (a \,x^{n +2}+b \,x^{m +2}-x \right )+c_1 \,{\mathrm e}^{\frac {b \left (n +1\right ) x^{1+m}+a \,x^{n +1} \left (1+m \right )}{\left (n +1\right ) \left (1+m \right )}}-c_2 \left (a \,x^{n +2}+b \,x^{m +2}-x \right )}{\left (\int \frac {{\mathrm e}^{\frac {x \left (a \left (1+m \right ) x^{n}+b \left (n +1\right ) x^{m}\right )}{\left (n +1\right ) \left (1+m \right )}} c_1}{x^{2}}d x +c_2 \right ) x^{2}}d x} \\ \end{align*}
2.28.47.2 Maple. Time used: 0.044 (sec). Leaf size: 77
ode:=diff(diff(y(x),x),x)+(a*x^n+b*x^m)*diff(y(x),x)+(a*(n+1)*x^(n-1)+b*(m+1)*x^(m-1))*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x \left (b \left (n +1\right ) x^{m}+a \,x^{n} \left (m +1\right )\right )}{\left (n +1\right ) \left (m +1\right )}} x \left (\int \frac {{\mathrm e}^{\frac {x \left (b \left (n +1\right ) x^{m}+a \,x^{n} \left (m +1\right )\right )}{\left (n +1\right ) \left (m +1\right )}}}{x^{2}}d x c_2 +c_1 \right ) \]

Maple trace

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 
-> Trying an equivalence, under non-integer power transformations, 
   to LODEs admitting Liouvillian solutions. 
-> Trying a solution in terms of special functions: 
   -> Bessel 
   -> elliptic 
   -> Legendre 
   -> Kummer 
      -> hyper3: Equivalence to 1F1 under a power @ Moebius 
   -> hypergeometric 
      -> heuristic approach 
      -> hyper3: Equivalence to 2F1, 1F1 or 0F1 under a power @ Moebius 
   -> Mathieu 
      -> Equivalence to the rational form of Mathieu ODE under a power @ Moebi\ 
us 
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a power \ 
@ Moebius 
-> 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 
<- 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)] 
   <- linear_1 successful 
   <- 2nd order, integrating factors of the form mu(x,y) successful
 
2.28.47.3 Mathematica
ode=D[y[x],{x,2}]+(a*x^n+b*x^m)*D[y[x],x]+(a*(n+1)*x^(n-1)+b*(m+1)*x^(m-1))*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

2.28.47.4 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
m = symbols("m") 
n = symbols("n") 
y = Function("y") 
ode = Eq((a*x**n + b*x**m)*Derivative(y(x), x) + (a*x**(n - 1)*(n + 1) + b*x**(m - 1)*(m + 1))*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : Add object cannot be interpreted as an integer
 
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', '2nd_power_series_ordinary')