23.1.13 problem 2(c)

Internal problem ID [4103]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(c)
Date solved : Tuesday, March 04, 2025 at 05:26:06 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

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

Maple. Time used: 0.002 (sec). Leaf size: 17
ode:=diff(y(x),x) = 1/2*(x^2+y(x)^2)/x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {x \left (\ln \left (x \right )+c_{1} -2\right )}{\ln \left (x \right )+c_{1}} \]
Mathematica. Time used: 0.157 (sec). Leaf size: 29
ode=D[y[x],x]==(x^2+y[x]^2)/(2*x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x (\log (x)-2+2 c_1)}{\log (x)+2 c_1} \\ y(x)\to x \\ \end{align*}
Sympy. Time used: 0.174 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x**2 + y(x)**2)/(2*x**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (1 - 16 x^{2}\right ) \]