2.29.36 Problem 96

2.29.36.1 Solved as second order ode adjoint method
2.29.36.2 Maple
2.29.36.3 Mathematica
2.29.36.4 Sympy

Internal problem ID [13757]
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 : 96
Date solved : Sunday, January 18, 2026 at 09:13:26 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

2.29.36.1 Solved as second order ode adjoint method

1.893 (sec)

\begin{align*} x y^{\prime \prime }+\left (x^{n} a +b \right ) y^{\prime }+a \left (b +n -1\right ) x^{n -1} y&=0 \\ \end{align*}
Entering second order ode lagrange adjoint equation method solverIn normal form the ode
\begin{align*} x y^{\prime \prime }+\left (x^{n} a +b \right ) y^{\prime }+a \left (b +n -1\right ) x^{n -1} 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 )&=\frac {x^{n} a +b}{x}\\ q \left (x \right )&=a \,x^{n -2} \left (b +n -1\right )\\ r \left (x \right )&=0 \end{align*}

The Lagrange adjoint ode is given by

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

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

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

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

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

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

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

Solving (5) for \(n\) gives

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

Substituting this value in (3) gives

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

The integrating factor \(\mu \) is

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

Integrating gives

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

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

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

Hence

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

Integrating gives

\begin{align*} y \,{\mathrm e}^{\int -\frac {\left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}} c_1 x -x^{n} c_1 \int \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}d x a -a \,x^{n} c_2}{x \left (c_1 \int \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}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 {\left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}} c_1 x -x^{n} c_1 \int \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}d x a -a \,x^{n} c_2}{x \left (c_1 \int \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}d x +c_2 \right )}d x}\) gives the final solution

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

Summary of solutions found

\begin{align*} y &= {\mathrm e}^{\int \frac {\int -c_1 a \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}d x x^{n}+\left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}} c_1 x -a \,x^{n} c_2}{\left (\int \left (x^{n}\right )^{-\frac {b}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}} c_1 d x +c_2 \right ) x}d x} \\ \end{align*}
2.29.36.2 Maple. Time used: 0.018 (sec). Leaf size: 56
ode:=x*diff(diff(y(x),x),x)+(a*x^n+b)*diff(y(x),x)+a*(b+n-1)*x^(n-1)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {a \,x^{n}}{n}} \left (x^{-b +1} c_2 \operatorname {hypergeom}\left (\left [\frac {-b +1}{n}\right ], \left [\frac {n -b +1}{n}\right ], \frac {a \,x^{n}}{n}\right )+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 Liouvillian solution using Kovacics algorithm 
      A Liouvillian solution exists 
      Reducible group (found an exponential solution) 
      Group is reducible, not completely reducible 
      Solution has integrals. Trying a special function solution free of integr\ 
als... 
      -> Trying a solution in terms of special functions: 
         -> Bessel 
         -> elliptic 
         -> Legendre 
         <- Kummer successful 
      <- special function solution successful 
         Solution using Kummer functions still has integrals. Trying a hypergeo\ 
metric solution. 
         -> hyper3: Equivalence to 2F1, 1F1 or 0F1 under a power @ Moebius 
         <- hyper3 successful: received ODE is equivalent to the 1F1 ODE 
         -> Trying to convert hypergeometric functions to elementary form... 
         <- elementary form could result into a too large expression - returnin\ 
g special function form of solution, free of uncomputed integrals 
      <- Kovacics algorithm successful 
<- Equivalence, under non-integer power transformations successful
 
2.29.36.3 Mathematica. Time used: 0.076 (sec). Leaf size: 93
ode=x*D[y[x],{x,2}]+(a*x^n+b)*D[y[x],x]+a*(b+n-1)*x^(n-1)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {(-1)^{-1/n} e^{-\frac {a x^n}{n}} \left ((b-1) c_2 (-1)^{b/n} \Gamma \left (\frac {1-b}{n},-\frac {a x^n}{n}\right )-(b-1) c_2 (-1)^{b/n} \operatorname {Gamma}\left (\frac {1-b}{n}\right )+c_1 (-1)^{\frac {1}{n}} n\right )}{n} \end{align*}
2.29.36.4 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
n = symbols("n") 
y = Function("y") 
ode = Eq(a*x**(n - 1)*(b + n - 1)*y(x) + x*Derivative(y(x), (x, 2)) + (a*x**n + b)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Expected Expr or iterable but got None
 
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_regular')