29.6.20 problem 166

Internal problem ID [4766]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 166
Date solved : Sunday, March 30, 2025 at 03:53:30 AM
CAS classification : [_separable]

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

Maple. Time used: 0.005 (sec). Leaf size: 24
ode:=x*diff(y(x),x) = a+b*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\tan \left (\sqrt {a b}\, \left (\ln \left (x \right )+c_1 \right )\right ) \sqrt {a b}}{b} \]
Mathematica. Time used: 12.568 (sec). Leaf size: 69
ode=x D[y[x],x]==a+b y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {\sqrt {a} \tan \left (\sqrt {a} \sqrt {b} (\log (x)+c_1)\right )}{\sqrt {b}} \\ y(x)\to -\frac {i \sqrt {a}}{\sqrt {b}} \\ y(x)\to \frac {i \sqrt {a}}{\sqrt {b}} \\ \end{align*}
Sympy. Time used: 2.772 (sec). Leaf size: 61
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a - b*y(x)**2 + x*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \frac {\sqrt {- \frac {1}{a b}} \log {\left (- a \sqrt {- \frac {1}{a b}} + y{\left (x \right )} \right )}}{2} + \frac {\sqrt {- \frac {1}{a b}} \log {\left (a \sqrt {- \frac {1}{a b}} + y{\left (x \right )} \right )}}{2} - \log {\left (x \right )} = C_{1} \]