2.29.34 Problem 94

2.29.34.1 second order linear exact ode
2.29.34.2 second order integrable as is
2.29.34.3 Maple
2.29.34.4 Mathematica
2.29.34.5 Sympy

Internal problem ID [13755]
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 : 94
Date solved : Thursday, January 01, 2026 at 02:32:12 AM
CAS classification : [[_2nd_order, _with_linear_symmetries], [_2nd_order, _linear, `_with_symmetry_[0,F(x)]`]]

2.29.34.1 second order linear exact ode

0.792 (sec)

\begin{align*} x y^{\prime \prime }+\left (x^{n} a +b \right ) y^{\prime }+a n \,x^{n -1} y&=0 \\ \end{align*}
Entering second order linear exact ode solverAn ode of the form
\begin{align*} p \left (x \right ) y^{\prime \prime }+q \left (x \right ) y^{\prime }+r \left (x \right ) y&=s \left (x \right ) \end{align*}

is exact if

\begin{align*} p''(x) - q'(x) + r(x) &= 0 \tag {1} \end{align*}

For the given ode we have

\begin{align*} p(x) &= x\\ q(x) &= x^{n} a +b\\ r(x) &= a n \,x^{n -1}\\ s(x) &= 0 \end{align*}

Hence

\begin{align*} p''(x) &= 0\\ q'(x) &= \frac {a n \,x^{n}}{x} \end{align*}

Therefore (1) becomes

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

Hence the ode is exact. Since we now know the ode is exact, it can be written as

\begin{align*} \left (p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y\right )' &= s(x) \end{align*}

Integrating gives

\begin{align*} p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y&=\int {s \left (x \right )\, dx} \end{align*}

Substituting the above values for \(p,q,r,s\) gives

\begin{align*} y^{\prime } x +\left (x^{n} a +b -1\right ) y&=c_1 \end{align*}

We now have a first order ode to solve which is

\begin{align*} y^{\prime } x +\left (x^{n} a +b -1\right ) y = c_1 \end{align*}

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 {-x^{n} a -b +1}{x}\\ p(x) &=\frac {c_1}{x} \end{align*}

The integrating factor \(\mu \) is

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

The ode becomes

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

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

\[ y = \left (x^{n}\right )^{-\frac {b -1}{n}} {\mathrm e}^{-\frac {a \,x^{n}}{n}} \left (\int \frac {c_1 \left (x^{n}\right )^{\frac {b -1}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}}{x}d x +c_2 \right ) \]

Summary of solutions found

\begin{align*} y &= \left (x^{n}\right )^{-\frac {b -1}{n}} {\mathrm e}^{-\frac {a \,x^{n}}{n}} \left (\int \frac {c_1 \left (x^{n}\right )^{\frac {b -1}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}}{x}d x +c_2 \right ) \\ \end{align*}
2.29.34.2 second order integrable as is

0.528 (sec)

\begin{align*} x y^{\prime \prime }+\left (x^{n} a +b \right ) y^{\prime }+a n \,x^{n -1} y&=0 \\ \end{align*}
Entering second order integrable as is solverIntegrating both sides of the ODE w.r.t \(x\) gives
\begin{align*} \int \left (x y^{\prime \prime }+\left (x^{n} a +b \right ) y^{\prime }+a n \,x^{n -1} y\right )d x &= 0 \\ y^{\prime } x +\left (x^{n} a +b -1\right ) y = c_1 \end{align*}

Which 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 {-x^{n} a -b +1}{x}\\ p(x) &=\frac {c_1}{x} \end{align*}

The integrating factor \(\mu \) is

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

The ode becomes

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

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

\[ y = \left (x^{n}\right )^{-\frac {b -1}{n}} {\mathrm e}^{-\frac {a \,x^{n}}{n}} \left (\int \frac {c_1 \left (x^{n}\right )^{\frac {b -1}{n}} {\mathrm e}^{\frac {a \,x^{n}}{n}}}{x}d x +c_2 \right ) \]

Summary of solutions found

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

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a symmetry of the form [xi=0, eta=F(x)] 
   One independent solution has integrals. Trying a hypergeometric solution fre\ 
e of integrals... 
   -> 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 is not straightforward to achieve - returning hypergeomet\ 
ric solution free of uncomputed integrals 
<- linear_1 successful
 
2.29.34.4 Mathematica. Time used: 0.07 (sec). Leaf size: 121
ode=x*D[y[x],{x,2}]+(a*x^n+b)*D[y[x],x]+a*n*x^(n-1)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to (-1)^{-\frac {b}{n}} n^{\frac {b-n-1}{n}} a^{\frac {1-b}{n}} e^{-\frac {a x^n}{n}} \left (x^n\right )^{\frac {1-b}{n}} \left (-(b-1) c_1 (-1)^{\frac {1}{n}} \Gamma \left (\frac {b-1}{n},-\frac {a x^n}{n}\right )+c_2 n (-1)^{b/n}+(b-1) c_1 (-1)^{\frac {1}{n}} \operatorname {Gamma}\left (\frac {b-1}{n}\right )\right ) \end{align*}
2.29.34.5 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
n = symbols("n") 
y = Function("y") 
ode = Eq(a*n*x**(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