2.1.21 problem 21

Solved as first order ode of type Riccati
Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [8681]
Book : First order enumerated odes
Section : section 1
Problem number : 21
Date solved : Tuesday, December 17, 2024 at 12:57:34 PM
CAS classification : [_rational, _Riccati]

Solve

\begin{align*} c y^{\prime }&=\frac {a x +b y^{2}}{r x} \end{align*}

Solved as first order ode of type Riccati

Time used: 2.946 (sec)

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= \frac {b \,y^{2}+a x}{r x c} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = \frac {a}{r c}+\frac {b \,y^{2}}{c r x} \]

With Riccati ODE standard form

\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]

Shows that \(f_0(x)=\frac {a}{r c}\), \(f_1(x)=0\) and \(f_2(x)=\frac {b}{c r x}\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\frac {u b}{c r x}} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification)in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=-\frac {b}{c r \,x^{2}}\\ f_1 f_2 &=0\\ f_2^2 f_0 &=\frac {b^{2} a}{c^{3} r^{3} x^{2}} \end{align*}

Substituting the above terms back in equation (2) gives

\begin{align*} \frac {b u^{\prime \prime }\left (x \right )}{c r x}+\frac {b u^{\prime }\left (x \right )}{c r \,x^{2}}+\frac {b^{2} a u \left (x \right )}{c^{3} r^{3} x^{2}} = 0 \end{align*}

In normal form the ode

\begin{align*} \frac {b \left (\frac {d^{2}u}{d x^{2}}\right )}{c r x}+\frac {b \left (\frac {d u}{d x}\right )}{c r \,x^{2}}+\frac {b^{2} a u}{c^{3} r^{3} x^{2}} = 0 \tag {1} \end{align*}

Becomes

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

Where

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

Which is solved for \(\xi (x)\). Writing the ode as

\begin{align*} x^{2} \xi ^{\prime \prime }-x \xi ^{\prime }+\left (1+\frac {a b x}{r^{2} c^{2}}\right ) \xi = 0\tag {1} \end{align*}

Bessel ode has the form

\begin{align*} x^{2} \xi ^{\prime \prime }+x \xi ^{\prime }+\left (-n^{2}+x^{2}\right ) \xi = 0\tag {2} \end{align*}

The generalized form of Bessel ode is given by Bowman (1958) as the following

\begin{align*} x^{2} \xi ^{\prime \prime }+\left (1-2 \alpha \right ) x \xi ^{\prime }+\left (\beta ^{2} \gamma ^{2} x^{2 \gamma }-n^{2} \gamma ^{2}+\alpha ^{2}\right ) \xi = 0\tag {3} \end{align*}

With the standard solution

\begin{align*} \xi &=x^{\alpha } \left (c_5 \operatorname {BesselJ}\left (n , \beta \,x^{\gamma }\right )+c_6 \operatorname {BesselY}\left (n , \beta \,x^{\gamma }\right )\right )\tag {4} \end{align*}

Comparing (3) to (1) and solving for \(\alpha ,\beta ,n,\gamma \) gives

\begin{align*} \alpha &= 1\\ \beta &= \frac {2 \sqrt {a b}}{r c}\\ n &= 0\\ \gamma &= {\frac {1}{2}} \end{align*}

Substituting all the above into (4) gives the solution as

\begin{align*} \xi = c_5 x \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 x \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \end{align*}

Will add steps showing solving for IC soon.

The original ode now reduces to first order ode

\begin{align*} \xi \left (x \right ) u^{\prime }-u \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) u&=\int \xi \left (x \right ) r \left (x \right )d x\\ u^{\prime }+u \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*} u^{\prime }+u \left (\frac {1}{x}-\frac {c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )-\frac {c_5 \sqrt {x}\, \operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c}+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )-\frac {c_6 \sqrt {x}\, \operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c}}{c_5 x \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 x \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )}\right )&=0 \end{align*}

Which is now a first order ode. This is now solved for \(u\). In canonical form a linear first order is

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

Comparing the above to the given ode shows that

\begin{align*} q(x) &=\frac {\sqrt {a b}\, \left (\operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) c_5 +\operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) c_6 \right )}{\sqrt {x}\, r c \left (c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right )}\\ p(x) &=0 \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int \frac {\sqrt {a b}\, \left (\operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) c_5 +\operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) c_6 \right )}{\sqrt {x}\, r c \left (c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right )}d x}\\ &= \frac {1}{c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\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 (\frac {u}{c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )}\right ) &= 0 \end{align*}

Integrating gives

\begin{align*} \frac {u}{c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )}&= \int {0 \,dx} + c_7 \\ &=c_7 \end{align*}

Dividing throughout by the integrating factor \(\frac {1}{c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )}\) gives the final solution

\[ u = \left (c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right ) c_7 \]

Hence, the solution found using Lagrange adjoint equation method is

\begin{align*} u &= \left (c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right ) c_7 \\ \end{align*}

The constants can be merged to give

\[ u = c_5 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+c_6 \operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \]

Will add steps showing solving for IC soon.

Taking derivative gives

\[ u^{\prime }\left (x \right ) = -\frac {c_5 \operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}}-\frac {c_6 \operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}} \]

Doing change of constants, the solution becomes

\[ y = -\frac {\left (-\frac {c_8 \operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}}-\frac {\operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}}\right ) c r x}{b \left (c_8 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+\operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right )} \]

Summary of solutions found

\begin{align*} y &= -\frac {\left (-\frac {c_8 \operatorname {BesselJ}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}}-\frac {\operatorname {BesselY}\left (1, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right ) \sqrt {a b}}{r c \sqrt {x}}\right ) c r x}{b \left (c_8 \operatorname {BesselJ}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )+\operatorname {BesselY}\left (0, \frac {2 \sqrt {a b}\, \sqrt {x}}{r c}\right )\right )} \\ \end{align*}

Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & c \left (\frac {d}{d x}y \left (x \right )\right )=\frac {x a +b y \left (x \right )^{2}}{r x} \\ \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 {x a +b y \left (x \right )^{2}}{r x c} \end {array} \]

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 
trying exact 
Looking for potential symmetries 
trying Riccati 
trying Riccati sub-methods: 
      -> Trying a Liouvillian solution using Kovacics algorithm 
      <- No Liouvillian solutions exists 
   <- Abel AIR successful: ODE belongs to the 0F1 1-parameter (Bessel type) class`
 
Maple dsolve solution

Solving time : 0.016 (sec)
Leaf size : 98

dsolve(c*diff(y(x),x) = (a*x+b*y(x)^2)/r/x, 
       y(x),singsol=all)
 
\[ y = \frac {\sqrt {\frac {x b a}{r^{2} c^{2}}}\, c r \left (\operatorname {BesselY}\left (1, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right ) c_{1} c r +\operatorname {BesselJ}\left (1, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )\right )}{b \left (c_{1} c r \operatorname {BesselY}\left (0, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )+\operatorname {BesselJ}\left (0, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )\right )} \]
Mathematica DSolve solution

Solving time : 0.288 (sec)
Leaf size : 207

DSolve[{c*D[y[x],x]==(a*x+b*y[x]^2)/(r*x),{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {\sqrt {a} \sqrt {x} \left (2 \operatorname {BesselY}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )+c_1 \operatorname {BesselJ}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )\right )}{\sqrt {b} \left (2 \operatorname {BesselY}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )+c_1 \operatorname {BesselJ}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )\right )} \\ y(x)\to \frac {\sqrt {a} \sqrt {x} \operatorname {BesselJ}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )}{\sqrt {b} \operatorname {BesselJ}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )} \\ \end{align*}