1.22 problem 22

1.22.1 Solved as first order ode of type Riccati
1.22.2 Maple step by step solution
1.22.3 Maple trace
1.22.4 Maple dsolve solution
1.22.5 Mathematica DSolve solution

Internal problem ID [7986]
Book : First order enumerated odes
Section : section 1
Problem number : 22
Date solved : Friday, October 25, 2024 at 12:04:46 PM
CAS classification : [_rational, _Riccati]

Solve

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

1.22.1 Solved as first order ode of type Riccati

Time used: 4.582 (sec)

In canonical form the ODE is

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

This is a Riccati ODE. Comparing the ODE to solve

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

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}{x c r}\), \(f_1(x)=0\) and \(f_2(x)=\frac {b}{c r \,x^{2}}\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\frac {u b}{c r \,x^{2}}} \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 {2 b}{c r \,x^{3}}\\ f_1 f_2 &=0\\ f_2^2 f_0 &=\frac {b^{2} a}{c^{3} r^{3} x^{5}} \end{align*}

Substituting the above terms back in equation (2) gives

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

In normal form the ode

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

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

\begin{align*} x^{2} \xi ^{\prime \prime }-2 x \xi ^{\prime }+\left (2+\frac {a b}{x \,c^{2} r^{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 &= {\frac {3}{2}}\\ \beta &= \frac {2 \sqrt {a b}}{c r}\\ n &= -1\\ \gamma &= -{\frac {1}{2}} \end{align*}

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

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

Integrating gives

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

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

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

Hence, the solution found using Lagrange adjoint equation method is

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

The constants can be merged to give

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

Will add steps showing solving for IC soon.

Taking derivative gives

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

Doing change of constants, the solution becomes

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

1.22.2 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & c y^{\prime }=\frac {a x +b y^{2}}{r \,x^{2}} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=\frac {a x +b y^{2}}{r \,x^{2} c} \end {array} \]

1.22.3 Maple trace
Methods for first order ODEs:
 
1.22.4 Maple dsolve solution

Solving time : 0.010 (sec)
Leaf size : 106

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

Solving time : 0.341 (sec)
Leaf size : 492

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