83.8.10 problem 11

Internal problem ID [19057]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter II. Equations of first order and first degree. Misc examples on chapter II at page 25
Problem number : 11
Date solved : Thursday, March 13, 2025 at 01:34:34 PM
CAS classification : [_rational, _Bernoulli]

\begin{align*} y^{\prime }&=\frac {x^{2}+y^{2}+1}{2 x y} \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 29
ode:=diff(y(x),x) = 1/2*(1+x^2+y(x)^2)/x/y(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \sqrt {c_{1} x +x^{2}-1} \\ y \left (x \right ) &= -\sqrt {c_{1} x +x^{2}-1} \\ \end{align*}
Mathematica. Time used: 0.278 (sec). Leaf size: 37
ode=D[y[x],x]==(x^2+y[x]^2+1)/(2*x*y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {x^2+c_1 x-1} \\ y(x)\to \sqrt {x^2+c_1 x-1} \\ \end{align*}
Sympy. Time used: 0.318 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x**2 + y(x)**2 + 1)/(2*x*y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {C_{1} x + x^{2} - 1}, \ y{\left (x \right )} = \sqrt {C_{1} x + x^{2} - 1}\right ] \]