2.100   ODE No. 100

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ a+x y'(x)+x y(x)^2=0 \] Mathematica : cpu = 0.00855797 (sec), leaf count = 133

\[\left \{\left \{y(x)\to \frac {i \sqrt {-a} \left (c_1-2\right ) \sqrt {x} J_0\left (2 i \sqrt {-a} \sqrt {x}\right )+c_1 \left (J_1\left (2 i \sqrt {-a} \sqrt {x}\right )-i \sqrt {-a} \sqrt {x} J_2\left (2 i \sqrt {-a} \sqrt {x}\right )\right )}{2 \left (c_1-1\right ) x J_1\left (2 i \sqrt {-a} \sqrt {x}\right )}\right \}\right \}\]

Maple : cpu = 0.084 (sec), leaf count = 59

\[ \left \{ y \left ( x \right ) ={1\sqrt {a} \left ( {{\sl J}_{0}\left (2\,\sqrt {a}\sqrt {x}\right )}{\it \_C1}+{{\sl Y}_{0}\left (2\,\sqrt {a}\sqrt {x}\right )} \right ) {\frac {1}{\sqrt {x}}} \left ( {\it \_C1}\,{{\sl J}_{1}\left (2\,\sqrt {a}\sqrt {x}\right )}+{{\sl Y}_{1}\left (2\,\sqrt {a}\sqrt {x}\right )} \right ) ^{-1}} \right \} \]

Hand solution

\begin {align*} xy^{\prime }+xy^{2}+a & =0\\ y^{\prime } & =-\frac {a}{x}-y^{2} \end {align*}

This is Riccati first order non-linear. Let \(y=-\frac {u^{\prime }}{uR}=\frac {u^{\prime }}{u}\), hence \(y^{\prime }=\frac {u^{\prime \prime }}{u}-\frac {\left ( u^{\prime }\right ) ^{2}}{u^{2}}\). Equating this to RHS of the above gives\begin {align*} \frac {u^{\prime \prime }}{u}-\frac {\left ( u^{\prime }\right ) ^{2}}{u^{2}} & =-\frac {a}{x}-\left ( \frac {u^{\prime }}{u}\right ) ^{2}\\ \frac {u^{\prime \prime }}{u} & =-\frac {a}{x}\\ u^{\prime \prime }+\frac {a}{x}u & =0 \end {align*}

This is linear second order, an Emden Fowler ODE, with removal singularity. Solved using power series method. The solution is\[ u=C_{1}\sqrt {x}\operatorname {BesselJ}\left ( 1,2\sqrt {ax}\right ) +C_{2}\sqrt {x}\operatorname {BesselY}\left ( 1,2\sqrt {ax}\right ) \] But \[ \frac {d}{dx}\operatorname {BesselJ}\left ( 1,2\sqrt {ax}\right ) =\frac {\sqrt {a}}{\sqrt {x}}\left ( \operatorname {BesselJ}\left ( 0,2\sqrt {ax}\right ) -\frac {1}{2}\frac {1}{\sqrt {ax}}\operatorname {BesselJ}\left ( 1,2\sqrt {ax}\right ) \right ) \] And\[ \frac {d}{dx}\operatorname {BesselY}\left ( 1,2\sqrt {ax}\right ) =\frac {\sqrt {a}}{\sqrt {x}}\left ( \operatorname {BesselY}\left ( 0,2\sqrt {ax}\right ) -\frac {1}{2}\frac {1}{\sqrt {ax}}\operatorname {BesselY}\left ( 1,2\sqrt {ax}\right ) \right ) \] Therefore, \begin {align*} u^{\prime } & =C_{1}\left ( \frac {1}{2\sqrt {x}}\operatorname {BesselJ}\left ( 1,2\sqrt {a}\sqrt {x}\right ) +\sqrt {x}\frac {\sqrt {a}}{\sqrt {x}}\left ( \operatorname {BesselJ}\left ( 0,2\sqrt {a}\sqrt {x}\right ) -\frac {1}{2}\frac {1}{\sqrt {ax}}\operatorname {BesselJ}\left ( 1,2\sqrt {a}\sqrt {x}\right ) \right ) \right ) \\ & +C_{2}\left ( \frac {1}{2\sqrt {x}}\operatorname {BesselY}\left ( 1,2\sqrt {a}\sqrt {x}\right ) +\sqrt {x}\frac {\sqrt {a}}{\sqrt {x}}\left ( \operatorname {BesselY}\left ( 0,2\sqrt {ax}\right ) -\frac {1}{2}\frac {1}{\sqrt {ax}}\operatorname {BesselY}\left ( 1,2\sqrt {a}\sqrt {x}\right ) \right ) \right ) \end {align*}

Which is simplified to\[ u^{\prime }=C_{1}\sqrt {a}\operatorname {BesselJ}\left ( 0,2\sqrt {a}\sqrt {x}\right ) +C_{2}\sqrt {a}\operatorname {BesselY}\left ( 0,2\sqrt {a}\sqrt {x}\right ) \] Therefore, from \(y=\frac {u^{\prime }}{u}\), the solution is\[ y=\frac {C_{1}\sqrt {a}\operatorname {BesselJ}\left ( 0,2\sqrt {a}\sqrt {x}\right ) +C_{2}\sqrt {a}\operatorname {BesselY}\left ( 0,2\sqrt {a}\sqrt {x}\right ) }{C_{1}\sqrt {x}\operatorname {BesselJ}\left ( 1,2\sqrt {a}\sqrt {x}\right ) +C_{2}\sqrt {x}\operatorname {BesselY}\left ( 1,2\sqrt {a}\sqrt {x}\right ) }\] Let \(C=\frac {C_{1}}{C_{2}}\), hence\[ y=\frac {C\sqrt {a}\operatorname {BesselJ}\left ( 0,2\sqrt {a}\sqrt {x}\right ) +\ \sqrt {a}\operatorname {BesselY}\left ( 0,2\sqrt {a}\sqrt {x}\right ) }{C\sqrt {x}\operatorname {BesselJ}\left ( 1,2\sqrt {a}\sqrt {x}\right ) +\ \sqrt {x}\operatorname {BesselY}\left ( 1,2\sqrt {a}\sqrt {x}\right ) }\]

Verification

restart; 
ode:=x*diff(y(x),x)+x*y(x)^2+a=0; 
num:=_C1*sqrt(a)*BesselJ(0,2*sqrt(a)*sqrt(x))+sqrt(a)*BesselY(0,2*sqrt(a)*sqrt(x)); 
den:=_C1*sqrt(x)*BesselJ(1,2*sqrt(a)*sqrt(x))+sqrt(x)*BesselY(1,2*sqrt(a)*sqrt(x)); 
my_solution:=num/den; 
odetest(y(x)=my_solution,ode); 
0