48.1.10 problem Example 3.10

Internal problem ID [7511]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.2 FIRST ORDER ODE. Page 114
Problem number : Example 3.10
Date solved : Wednesday, March 05, 2025 at 04:42:47 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

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

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