6.25 problem 171

6.25.1 Solving as riccati ode
6.25.2 Maple step by step solution

Internal problem ID [3427]
Internal file name [OUTPUT/2920_Sunday_June_05_2022_08_47_06_AM_43991331/index.tex]

Book: Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section: Various 6
Problem number: 171.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "riccati"

Maple gives the following as the ode type

[_rational, [_Riccati, _special]]

\[ \boxed {x y^{\prime }+x y^{2}=-a} \]

6.25.1 Solving as riccati ode

In canonical form the ODE is \begin {align*} y' &= F(x,y)\\ &= -\frac {x \,y^{2}+a}{x} \end {align*}

This is a Riccati ODE. Comparing the ODE to solve \[ y' = -y^{2}-\frac {a}{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}{x}\), \(f_1(x)=0\) and \(f_2(x)=-1\). Let \begin {align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{-u} \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' &=0\\ f_1 f_2 &=0\\ f_2^2 f_0 &=-\frac {a}{x} \end {align*}

Substituting the above terms back in equation (2) gives \begin {align*} -u^{\prime \prime }\left (x \right )-\frac {a u \left (x \right )}{x} &=0 \end {align*}

Solving the above ODE (this ode solved using Maple, not this program), gives

\[ u \left (x \right ) = \left (\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{2} +\operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{1} \right ) \sqrt {x} \] The above shows that \[ u^{\prime }\left (x \right ) = \sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{1} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{2} \right ) \] Using the above in (1) gives the solution \[ y = \frac {\sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{1} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{2} \right )}{\left (\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{2} +\operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{1} \right ) \sqrt {x}} \] Dividing both numerator and denominator by \(c_{1}\) gives, after renaming the constant \(\frac {c_{2}}{c_{1}}=c_{3}\) the following solution

\[ y = \frac {\sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right )\right )}{\left (\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right )+\operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} \right ) \sqrt {x}} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \frac {\sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right )\right )}{\left (\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right )+\operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} \right ) \sqrt {x}} \\ \end{align*}

Verification of solutions

\[ y = \frac {\sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right )\right )}{\left (\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right )+\operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right ) c_{3} \right ) \sqrt {x}} \] Verified OK.

6.25.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x y^{\prime }+x y^{2}=-a \\ \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 y^{2}}{x} \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 Special 
<- Riccati Special successful`
 

Solution by Maple

Time used: 0.0 (sec). Leaf size: 59

dsolve(x*diff(y(x),x)+a+x*y(x)^2 = 0,y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {\sqrt {a}\, \left (\operatorname {BesselJ}\left (0, 2 \sqrt {a}\, \sqrt {x}\right ) c_{1} +\operatorname {BesselY}\left (0, 2 \sqrt {a}\, \sqrt {x}\right )\right )}{\sqrt {x}\, \left (c_{1} \operatorname {BesselJ}\left (1, 2 \sqrt {a}\, \sqrt {x}\right )+\operatorname {BesselY}\left (1, 2 \sqrt {a}\, \sqrt {x}\right )\right )} \]

Solution by Mathematica

Time used: 0.244 (sec). Leaf size: 289

DSolve[x y'[x]+a+x y[x]^2==0,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to \frac {2 \sqrt {a} \sqrt {x} \operatorname {BesselY}\left (0,2 \sqrt {a} \sqrt {x}\right )+2 \operatorname {BesselY}\left (1,2 \sqrt {a} \sqrt {x}\right )-2 \sqrt {a} \sqrt {x} \operatorname {BesselY}\left (2,2 \sqrt {a} \sqrt {x}\right )-i \sqrt {a} c_1 \sqrt {x} \operatorname {BesselJ}\left (0,2 \sqrt {a} \sqrt {x}\right )-i c_1 \operatorname {BesselJ}\left (1,2 \sqrt {a} \sqrt {x}\right )+i \sqrt {a} c_1 \sqrt {x} \operatorname {BesselJ}\left (2,2 \sqrt {a} \sqrt {x}\right )}{4 x \operatorname {BesselY}\left (1,2 \sqrt {a} \sqrt {x}\right )-2 i c_1 x \operatorname {BesselJ}\left (1,2 \sqrt {a} \sqrt {x}\right )} \\ y(x)\to \frac {\sqrt {a} \sqrt {x} \operatorname {BesselJ}\left (0,2 \sqrt {a} \sqrt {x}\right )+\operatorname {BesselJ}\left (1,2 \sqrt {a} \sqrt {x}\right )-\sqrt {a} \sqrt {x} \operatorname {BesselJ}\left (2,2 \sqrt {a} \sqrt {x}\right )}{2 x \operatorname {BesselJ}\left (1,2 \sqrt {a} \sqrt {x}\right )} \\ \end{align*}